Skip to main content

CLI Installation

The QCOS Command Line Interface provides powerful tools for executing quantum circuits, managing jobs, and automating workflows.

Installation​

Using pip​

pip install softqcos-cli
# Install pipx if needed
pip install pipx
pipx ensurepath

# Install QCOS CLI
pipx install softqcos-cli

Verify Installation​

softqcos --version
# QCOS CLI v1.0.0

Initial Setup​

Configure API Key​

# Interactive setup
softqcos configure

# Enter your API key:
# > softqcos-xxxx-xxxx-xxxx
# βœ“ Configuration saved to ~/.softqcos/config.json

Using Environment Variable​

export QCOS_API_KEY="softqcos-xxxx-xxxx-xxxx"

Test Connection​

softqcos health

# Output:
# βœ“ API Gateway: healthy (v1.0.0)
# βœ“ Queue Service: connected
# βœ“ GPU Workers: 8 available
# βœ“ Your tier: pro (73/100 jobs today)

Quick Start​

Execute a Circuit​

# From file
softqcos execute circuit.qasm --shots 1024

# Inline (using heredoc)
softqcos execute - --shots 1024 << 'EOF'
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0],q[1];
measure q -> c;
EOF

View Results​

# Immediate output
softqcos execute circuit.qasm --shots 1024

# βœ“ Job submitted: job_abc123
# ⏳ Waiting for result...
# βœ“ Completed in 1.2s
#
# Results:
# β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
# β”‚ State β”‚ Count β”‚ Percent β”‚
# β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
# β”‚ 00 β”‚ 512 β”‚ 50.0% β”‚
# β”‚ 11 β”‚ 512 β”‚ 50.0% β”‚
# β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Async Execution​

# Submit without waiting
softqcos execute circuit.qasm --no-wait
# βœ“ Job submitted: job_abc123

# Check status
softqcos status job_abc123
# Status: processing
# Progress: 45%

# Get results
softqcos results job_abc123 --format json

Output Formats​

# Table (default)
softqcos execute circuit.qasm --format table

# JSON
softqcos execute circuit.qasm --format json

# CSV
softqcos execute circuit.qasm --format csv

# Save to file
softqcos execute circuit.qasm --output results.json

Shell Completion​

Bash​

softqcos completion bash >> ~/.bashrc
source ~/.bashrc

Zsh​

softqcos completion zsh >> ~/.zshrc
source ~/.zshrc

Fish​

softqcos completion fish > ~/.config/fish/completions/softqcos.fish

Configuration File​

Location: ~/.softqcos/config.json

{
"api_key": "softqcos-xxxx-xxxx-xxxx",
"api_url": "https://api.softquantus.com",
"default_shots": 1024,
"timeout": 60,
"output_format": "table",
"color": true
}

Next Steps​