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
Using pipx (Recommended)β
# 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β
- CLI Commands - All available commands
- Configuration - Advanced configuration
- Scripting - Automation and CI/CD