CLI Reference
Every command, argument and option of the qubithub CLI in 0.2.4, generated from the CLI
itself, with each example run once. For a guided start, see the
CLI / SDK Quickstart.
pip install --upgrade qubithub==0.2.4qubithub --version # qubithub 0.2.4Global options
Section titled “Global options”Global options go before the command: qubithub --format json runs list.
| Option | Type | Default | Description |
|---|---|---|---|
--version | flag | — | Show the installed qubithub version and exit. |
--base-url | str | https://qubithub.co/api | API base URL |
--api-key | str | — | Git only: qubithub clone passes it to git. Never sent to the API. (hidden from --help) |
--token | str | — | JWT access token (the access_token that login returns; see Authentication). It is not renewed: when it expires, run qubithub login |
--format, -f | str | rich | Output format: rich | json |
Environment variables: QUBITHUB_API_URL (same as --base-url), QUBITHUB_TOKEN
(same as --token) and QUBITHUB_API_KEY (the hidden --api-key, which qubithub clone uses for
git only; it is never sent to the API).
Account and running
Section titled “Account and running”qubithub login
Section titled “qubithub login”Log in with your email or username and password, or a JWT token.
qubithub login [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--email, --username | str | — | Email address or username |
--password | str | — | Password |
--api-key | str | — | Refused with an error: API keys authenticate git only, not the API. (hidden from --help) |
--token | str | — | JWT access token to store instead of signing in. It is not renewed: when it expires, run qubithub login |
Signs in with your email or username and your password, and stores the tokens in
~/.qubithub/config.toml. If you omit the flags it prompts for them (“Email or
username”, then the password, hidden). --token stores a JWT access token you already
have instead (see Authentication).
Access tokens expire after 15 minutes. After an email-and-password login, the CLI
renews the access token itself with the stored refresh token (valid for 30 days). A token
passed with --token or QUBITHUB_TOKEN is not renewed. When a command fails with 401,
run qubithub login again.
qubithub logout
Section titled “qubithub logout”Log out and clear stored credentials.
qubithub logoutRevokes the session on the server and deletes the stored credentials. The file is cleared even when the server cannot be reached; the CLI then warns that the session ends when it expires.
qubithub whoami
Section titled “qubithub whoami”Show current authenticated user.
qubithub whoamiqubithub clone
Section titled “qubithub clone”Clone a circuit. Uses git when available; falls back to HTTP otherwise.
qubithub clone <repo_name> [directory] [OPTIONS]| Argument | Required | Description |
|---|---|---|
repo_name | yes | Repository name (e.g., qubithub/bell-state) |
directory | no | Target directory (default: circuit name) |
| Option | Type | Default | Description |
|---|---|---|---|
--no-git | flag | — | Skip git, fall back to HTTP file download (no .git/, no history). |
--git-base-url | str | — | Override the web origin for the git clone URL. Also read from QUBITHUB_WEB_URL. |
Uses git when it is installed and the server offers git for the circuit, so you get the
full history. Otherwise, or with --no-git, it downloads the files over HTTP into a flat
directory with no .git/. The target directory must be empty or missing.
qubithub execute
Section titled “qubithub execute”Execute a circuit and display results.
qubithub execute <repo_name> [OPTIONS]| Argument | Required | Description |
|---|---|---|
repo_name | yes | Repository name (e.g., QubitHub/bell-state) |
| Option | Type | Default | Description |
|---|---|---|---|
--framework | str | — | Framework (qiskit, cirq, pennylane). Sets the default backend |
--backend | str | — | Backend name (overrides —framework default) |
--backend-type | str | simulation | Backend type: simulation, emulation or hardware. Only simulation runs as named: emulation runs as a simulation, and hardware fails |
--shots | int | 1024 | Number of shots (1 to 100,000). A PennyLane circuit samples with the shots it sets itself |
--watch, -w | flag | — | Poll until the run ends (up to 3 minutes). Exits 1 if it failed or was cancelled, 124 if it is still running when polling stops |
Resolves owner/name, submits a run and prints the result. Every run today is on a
simulator.
--frameworkpicks the default backend:qiskit→qiskit_aer,cirq→cirq_simulator,pennylane→pennylane_default. Without it the backend isqiskit_aer.--backendoverrides both. For a Qiskit circuit, a--backendname the server does not recognise falls back to the Aer simulator (AerSimulator).--backend-type: onlysimulationworks as named.hardwarefails with “Hardware execution not yet implemented”.emulationis accepted but currently runs as a simulation.- Limits: up to 24 qubits on the simulator, and 1 to 100,000 shots. Above 20 qubits,
set
qubitsinqubithub.tomlto the circuit’s real count. One run above 20 qubits runs at a time; another is refused until it ends. - Quota: each run counts against your run quota (Free tier during beta: 100 runs per rolling 30 days). See Runs limit exceeded.
--watchpolls every 2 seconds for up to 3 minutes, then stops and tells you, on stderr, to check later withqubithub runs info <run-id>. The run keeps going on the server.- Exit status:
0when the run completed, or was submitted without--watchand is still pending.1when the run it reports failed or was cancelled, with or without--watch, or when the command itself fails.124when--watchstops polling before the run ends. A script can tell a failed run from a passed one. - PennyLane:
--shotsis ignored. Sampling follows the shots the circuit sets itself, on the QNode (@qml.qnode(dev, shots=1024), as theinittemplate does) or on the device (deprecated since PennyLane 0.43). With no shots, measurements such asqml.expval(),qml.probs()orqml.state()return exact (analytic) values, and sample-only measurements such asqml.counts()orqml.sample()fail, so set shots for those. - What the result shows: a run’s measurement counts as a histogram, with percentages
of the shots counted. A PennyLane
qml.counts()result is plotted the same way. Any other value a PennyLane circuit returns (a number, a vector, a dict) is printed under Returned value: a number to six significant digits (and in full precision when that differs), anything else as JSON. In the stored run that value isresults.pennylane_result, andresults.countsis empty. - In JSON mode the final run is one JSON object on stdout, and the polling lines and the
timeout notice go to stderr, so
qubithub --format json execute … --watch | jqworks.
Circuits
Section titled “Circuits”qubithub circuits list
Section titled “qubithub circuits list”List public circuits.
qubithub circuits list [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--framework | str | — | Filter by framework (qiskit, cirq, pennylane) |
--tag | str | — | Filter by tag |
--sort | str | created_at | Sort field (created_at, stars_count, name) |
--limit | int | 20 | Results per page |
--page | int | 1 | Page number |
Lists public circuits.
qubithub circuits info
Section titled “qubithub circuits info”Show detailed circuit information.
qubithub circuits info <repo_name>| Argument | Required | Description |
|---|---|---|
repo_name | yes | Repository name (e.g., QubitHub/bell-state) |
qubithub circuits fork
Section titled “qubithub circuits fork”Fork a circuit to your account.
qubithub circuits fork <repo_name> [OPTIONS]| Argument | Required | Description |
|---|---|---|
repo_name | yes | Repository name to fork |
| Option | Type | Default | Description |
|---|---|---|---|
--name | str | — | Custom name for the forked circuit |
qubithub circuits push
Section titled “qubithub circuits push”Push a local circuit directory to QubitHub.
qubithub circuits push [directory] [OPTIONS]| Argument | Required | Description |
|---|---|---|
directory | no | Circuit directory to push (default: the current directory) |
| Option | Type | Default | Description |
|---|---|---|---|
--name | str | — | Circuit name (default: name in qubithub.toml, else in metadata.json) |
-m, --message | str | — | Commit message |
--create | flag | — | Create the circuit if it doesn’t exist |
Uploads the circuit to your account (<your-username>/<name>). It is an HTTP upload,
not git push.
- Only files ending in
.py,.json,.qasm,.qpyor.tomlare uploaded. README.mdis not uploaded. With--create, its first 2,000 characters become the circuit’s description, once. Later edits toREADME.mdare not pushed.--createregisters a new circuit on its first push.
qubithub circuits init
Section titled “qubithub circuits init”Scaffold a new circuit directory with template files.
qubithub circuits init <name> [directory] [OPTIONS]| Argument | Required | Description |
|---|---|---|
name | yes | Circuit name (e.g., my-circuit) |
directory | no | Directory to create (default: ./ |
| Option | Type | Default | Description |
|---|---|---|---|
--framework | str | qiskit | Framework (qiskit, cirq, pennylane) |
--qubits | int | 2 | Number of qubits |
--title | str | — | Display title |
- Creates
README.md,circuit.py,qubithub.tomland.gitignore. The README’s run line names--framework, whichexecuteneeds to pick the right backend. - QubitHub runs whatever is bound to
circuit(orqc, or amain()function). - Every template runs as generated. The Qiskit and Cirq templates end with
circuit = create_circuit(). The PennyLane QNode sets its own shots,@qml.qnode(dev, shots=1024), and returnsqml.counts(); running it locally needs PennyLane 0.43 or later.
qubithub circuits metadata
Section titled “qubithub circuits metadata”Show parsed circuit metadata from qubithub.toml.
qubithub circuits metadata [directory] [OPTIONS]| Argument | Required | Description |
|---|---|---|
directory | no | Circuit directory (default: the current directory) |
| Option | Type | Default | Description |
|---|---|---|---|
--format, -f | str | json | Output format: json or toml |
qubithub circuits clone
Section titled “qubithub circuits clone”Clone a circuit via HTTP file download (legacy, no git).
qubithub circuits clone <repo_name> [directory]| Argument | Required | Description |
|---|---|---|
repo_name | yes | Repository name (e.g., QubitHub/bell-state) |
directory | no | Target directory (default: circuit name) |
Legacy HTTP download, hidden from --help. Use qubithub clone (it prefers git).
qubithub runs list
Section titled “qubithub runs list”List your runs.
qubithub runs list [OPTIONS]| Option | Type | Default | Description |
|---|---|---|---|
--circuit-id | str | — | Filter by circuit ID: the id field of qubithub --format json circuits info owner/name |
--status | str | — | Filter by status |
--limit | int | 20 | Results per page |
--page | int | 1 | Page number |
qubithub runs info
Section titled “qubithub runs info”Show run details and results.
qubithub runs info <run_id>| Argument | Required | Description |
|---|---|---|
run_id | yes | Run UUID |
Shows the result the way execute does: counts as a histogram, or a PennyLane circuit’s
returned value. For a failed run it prints the error as the run recorded it.
qubithub runs cancel
Section titled “qubithub runs cancel”Cancel a pending or running run, or delete a finished run’s record.
qubithub runs cancel <run_id>| Argument | Required | Description |
|---|---|---|
run_id | yes | Run UUID |
Cancels a pending or running run. On a run that has already finished (completed, failed or cancelled), it deletes the run’s record instead.
qubithub runs stats
Section titled “qubithub runs stats”Show your run statistics.
qubithub runs statsAPI keys
Section titled “API keys”qubithub keys create
Section titled “qubithub keys create”Create a new API key.
qubithub keys create <name> [OPTIONS]| Argument | Required | Description |
|---|---|---|
name | yes | Key name |
| Option | Type | Default | Description |
|---|---|---|---|
--scopes | str | circuit:read | Comma-separated scopes. Recorded on the key but not enforced yet: a key can clone and push every circuit you own |
Creates an API key and prints it once. Store it straight away.
Scopes are recorded on the key but not enforced today: git access follows ownership, so a personal key can clone and push every circuit you own, whatever its scopes (see Git authentication).
API keys authenticate git over HTTPS (clone and push) only; no API route accepts
them yet (see Git authentication). The CLI sets no
expiry: to create a key that expires, use the SDK
(APIKeyCreateRequest(..., expires_in_days=90), see the SDK reference).
qubithub keys list
Section titled “qubithub keys list”List your API keys.
qubithub keys listqubithub keys revoke
Section titled “qubithub keys revoke”Revoke an API key.
qubithub keys revoke <key_id>| Argument | Required | Description |
|---|---|---|
key_id | yes | API key UUID |
Config
Section titled “Config”qubithub config set
Section titled “qubithub config set”Set a CLI default value.
qubithub config set <key> <value>| Argument | Required | Description |
|---|---|---|
key | yes | Config key |
value | yes | Config value |
Stores a value in ~/.qubithub/config.toml. Known keys: default_framework,
default_backend, default_shots, default_format, default_base_url.
qubithub config get
Section titled “qubithub config get”Get a CLI default value.
qubithub config get <key>| Argument | Required | Description |
|---|---|---|
key | yes | Config key |
qubithub config list
Section titled “qubithub config list”List all CLI defaults.
qubithub config listqubithub config unset
Section titled “qubithub config unset”Remove a CLI default value.
qubithub config unset <key>| Argument | Required | Description |
|---|---|---|
key | yes | Config key to remove |
Next steps
Section titled “Next steps”- CLI / SDK Quickstart: a guided first run.
- Python SDK reference: the same operations from Python.
- Run lifecycle: what happens to a run after you submit it.
Need help? See Troubleshooting or email [email protected].