CLI command reference
This page is the complete list of commands and flags in the shipped SynapseX CLI
(synapsex-code, version 1.17.9). Use it to look up an exact flag name, its
default and what it does, so you can write a working command on the first try
instead of guessing.
New to the CLI? Install it first at /cli/install, then come back here for the exhaustive list.
Why you cannot discover these flags with --help
synapsex-code --help and one-level help such as synapsex-code run --help
work. Help at sub-subcommand depth does not. Running
synapsex-code lab run --help, synapsex-code mcp add --help or
synapsex-code agent create --help prints the top-level help instead of the
subcommand’s own help. That is a defect in the shipped binary.
This page is therefore the authoritative flag list for lab, mcp and the
other nested command groups. Do not try to discover those flags from the
terminal.
Which commands exist
These are the top-level commands registered by the binary, in registration order:
completion, acp, mcp, the default TUI command ([project]), attach,
run, generate, debug, a hidden console group, providers, agent,
upgrade, uninstall, serve, web, models, stats, export, import,
github, gitlab, pr, session, lab, plugin, db.
Not documented here — do not use:
| Command | Why it is excluded |
|---|---|
upgrade | Every endpoint it depends on returns 404. It cannot update the binary. To update, re-run the install command from /cli/install. |
github, gitlab, pr | Never exercised end to end. Their setup requirements and flags are unverified. |
| the hidden console group | Deliberately hidden from --help by the binary. Not a supported surface. |
generate | Registered, but its behaviour was not verified. |
Global flags
These work on every command.
| Flag | What it does | Default |
|---|---|---|
--print-logs | Print logs to stderr | off |
--log-level DEBUG|INFO|WARN|ERROR | Set the log level | unset |
--pure | Run without external plugins | off |
-h, --help | Show help | — |
-v, --version | Print the version number | — |
Each of the three has an environment-variable equivalent — see /reference/cli-configuration.
Terminal agent: the default command and run
synapsex-code [project] opens the interactive terminal agent in the current
directory (or in project if you pass a path). synapsex-code run [message..]
does a single non-interactive turn, which is what you want in scripts and CI.
# Interactive agent in the current project
synapsex-code
# One-shot turn
synapsex-code run -m synapsex/synapsex-atlas-7b-v1 "explain quantum superposition in two lines"| Flag | What it does | Default |
|---|---|---|
-m, --model <provider/model> | Model to use, in provider/model form | account default |
-c, --continue | Continue the last session | off |
-s, --session <id> | Continue a specific session id | — |
--fork | Fork the session when continuing (requires --continue or --session) | off |
-f, --file <path...> | Attach one or more files to the message (run only) | none |
--agent <name> | Agent to use. Run synapsex-code agent list for the names | — |
--share | Share the session (run only) | off |
--title <text> | Title for the session; uses a truncated prompt when no value is given (run only) | — |
--attach <url> | Send the turn to an already-running server, for example http://localhost:4096 | — |
--dir <path> | Directory to run in; a path on the remote server when attaching | current directory |
--variant <name> | Provider-specific reasoning effort, for example high, max, minimal (run only) | — |
--thinking | Show thinking blocks (run only) | off |
--replay / --no-replay | Replay interactive session history on resume and after resize | --replay |
--replay-limit <n> | Cap the replay to the newest N messages | unset |
-i, --interactive | Run in direct interactive split-footer mode | false |
--format default|json | Output format; json emits raw JSON events | default |
--dangerously-skip-permissions | Auto-approve permissions that are not explicitly denied. The binary’s own help marks this “(dangerous!)” | false |
run also accepts --port, -u and -p from the network table below when you
point it at a server with --attach.
providers — sign in and manage credentials
The group is also aliased auth. There is no separate top-level auth
command.
| Command | What it does |
|---|---|
synapsex-code providers list (alias ls) | List configured credentials and the file they live in |
synapsex-code providers login | Interactive sign-in |
synapsex-code providers logout [provider] | Remove a stored credential |
| Flag | What it does | Default |
|---|---|---|
-p, --provider <id> | Skip the provider picker | prompts |
-m, --method <label> | Skip the login-method picker | prompts |
Only two provider ids are accepted: synapsex (AI models) and
synapsex-compute (SynapseX Compute). Third-party providers are rejected —
providers login --provider anthropic fails with Unknown provider "anthropic". Full sign-in walkthrough: /cli/authentication.
models — list model ids
synapsex-code models| Flag | What it does | Default |
|---|---|---|
[provider] | Filter to one provider id | all |
--verbose | More verbose output, including metadata such as costs | off |
--refresh | Refresh the models cache | off |
The CLI writes model ids as synapsex/<id>. See
/reference/models for how ids are written on each surface.
lab — local runs and SynapseX Compute
Two lab capabilities work offline, with no account and no credits:
lab run --local and lab run --sim. Everything else in this group requires
SynapseX Compute access, which is not generally available today — those
commands exist in the binary and reach live endpoints, but they are gated and
their signed-in behaviour is not something these docs can promise.
# Free local OpenQASM simulator, no account required
synapsex-code lab run bell.qasm --sim --shots 100 --seed 7| Command | What it does |
|---|---|
lab run <file> | Run a file. With no --backend it uses the free local OpenQASM simulator |
lab login | Connect this device to SynapseX Compute (device flow; stores an sxc_ token). Not generally available |
lab open [session] | Attach or create a Lab session and make it this project’s active session. Not generally available |
lab ask <prompt..> | Ask the Lab agent; runs the file/edit/run tool-calls it emits locally. Not generally available |
lab backends | List compute backends with allowed/affordable status. Not generally available |
lab recommend <file> | Rank backends for a workload. Not generally available |
lab credits | Show credit balance. Not generally available |
lab allowlist <action> [id] | Manage the compute allowlist; action is add, remove or list. Not generally available |
Flags for lab run:
| Flag | What it does | Default |
|---|---|---|
--local | Run on this machine. $0, off-ledger, no gate, works offline | false |
--sim | Run on the free local OpenQASM simulator. $0, off-ledger, offline. This is what happens when no --backend is given | false |
--backend <id> | Paid QPU backend id (implies qcos mode). Not generally available | — |
--shots <n> | Number of shots. On the local simulator it is clamped to 1–4096 | 1024 |
--seed <n> | Random seed; simulator only. Makes sampled counts reproducible | time-based |
--max-cost <usd> | USD cost ceiling for a paid run. It can only lower risk, never raise an estimate | — |
--yes | Auto-confirm a parked cost estimate, within the server budget policy | false |
--session <id> | Run against a specific Lab session instead of the project’s active one | active session |
Flags for lab ask:
| Flag | What it does | Default |
|---|---|---|
--session <id> | Target an existing Lab session | active session |
--model <id> | Override the server default model | server default |
Simulator limits you must know. The local simulator supports only the gates
h, x, z, s and cx. OPENQASM, include, qreg, creg, measure
and barrier lines are skipped. Any gate it does not recognise is silently
ignored — no error, no warning. A circuit using unsupported gates will still
print counts, and those counts will be wrong. Treat --sim as a fast
diagnostic probe, not a transpiler. Details:
/cli/quantum-simulator.
lab run --local picks the interpreter from the file extension: .py uses the
interpreter in SYNAPSEX_PYTHON (default python3); .js, .mjs, .cjs and
.ts use node; .sh and .bash use sh; .rb uses ruby; .pl uses
perl; a file with no extension is executed directly. Anything else returns an
explicit unsupported-extension error. See /cli/local-runs.
serve, web, attach, acp — network commands
| Command | What it does |
|---|---|
synapsex-code serve | Start a headless HTTP server exposing the agent |
synapsex-code web | Start the server and open the web interface |
synapsex-code attach <url> | Attach a terminal to a running server |
synapsex-code acp | Start an ACP (Agent Client Protocol) server |
| Flag | What it does | Default |
|---|---|---|
--port <n> | Port to listen on | 0 (random) |
--hostname <host> | Hostname to listen on | 127.0.0.1 |
--mdns | Enable mDNS service discovery (defaults hostname to 0.0.0.0) | false |
--mdns-domain <name> | Custom mDNS domain | synapsexCode.local |
--cors <domain...> | Additional domains to allow for CORS | [] |
-u, --username <name> | Basic-auth username | SYNAPSEX_CODE_SERVER_USERNAME, else synapsexCode |
-p, --password <pass> | Basic-auth password | SYNAPSEX_CODE_SERVER_PASSWORD |
--cwd <dir> | Working directory (acp only) | current directory |
With no password set, serve and web print
Warning: SYNAPSEX_CODE_SERVER_PASSWORD is not set; server is unsecured. and
start anyway. Set a password before binding to anything other than loopback.
See /cli/headless-server.
mcp — Model Context Protocol servers
| Command | What it does |
|---|---|
mcp add [name] --url <url> | Add a remote MCP server |
mcp add [name] -- <command...> | Add a local MCP server, given as a command after -- |
mcp list (alias ls) | List servers and their status |
mcp auth [name] | Authenticate with an OAuth-enabled MCP server |
mcp logout [name] | Remove that server’s OAuth credentials |
mcp debug <name> | Debug an MCP server’s OAuth connection |
| Flag | What it does | Applies to |
|---|---|---|
--url <url> | URL of a remote MCP server | remote only |
--env KEY=VALUE | Environment variable, repeatable | local only — rejected with --env is only valid for local MCP servers |
--header KEY=VALUE | HTTP header, repeatable | remote only — rejected with --header is only valid for remote MCP servers |
Exactly one of --url or a command after -- is required; supplying neither
fails with Provide either --url <url> or a command after --. Guide:
/cli/mcp-servers.
agent and session
| Command | What it does |
|---|---|
synapsex-code agent create | Create a new agent |
synapsex-code agent list | List all available agents |
synapsex-code session list | List stored sessions |
synapsex-code session delete <sessionID> | Delete a session |
stats, export, import, db
| Command | What it does |
|---|---|
synapsex-code stats | Show token usage and cost statistics |
synapsex-code export [sessionID] | Export session data as JSON |
synapsex-code import <file> | Import session data from a JSON file path or a share URL |
synapsex-code db [query] | Open an interactive sqlite3 shell, or run a query |
synapsex-code db path | Print the local database path |
| Flag | Command | What it does | Default |
|---|---|---|---|
--days <n> | stats | Limit to the last N days | all |
--tools <n> | stats | Show the top N tools | — |
--models [n] | stats | Show model statistics (hidden by default; pass a number for top N) | hidden |
--project [name] | stats | Filter by project; an empty string means the current project | all |
--sanitize | export | Redact sensitive transcript and file data | off |
--format json|tsv | db | Output format | tsv |
More detail: /cli/sessions-and-usage.
plugin, completion, uninstall, debug
| Command | What it does |
|---|---|
synapsex-code plugin <module> (alias plug) | Install an npm plugin module and update the config |
synapsex-code completion | Generate a shell completion script |
synapsex-code uninstall | Uninstall the CLI and remove related files |
| Flag | Command | What it does | Default |
|---|---|---|---|
-g, --global | plugin | Install into the global config | false |
-f, --force | plugin | Replace an existing plugin version | false |
-c, --keep-config | uninstall | Keep configuration files | false |
-d, --keep-data | uninstall | Keep session data and snapshots | false |
--dry-run | uninstall | Show what would be removed without removing it | false |
-f, --force | uninstall | Skip confirmation prompts | false |
synapsex-code debug exposes these subcommands:
| Subcommand | What it does |
|---|---|
debug paths | Print the resolved global paths (data, config, cache, state, log, bin, repos, tmp) |
debug config | Print the resolved configuration |
debug info | Print version, OS, terminal and loaded plugins |
debug lsp | Language-server diagnostics |
debug rg | Ripgrep diagnostics |
debug file | File-handling diagnostics |
debug scrap | Scratch diagnostics |
debug skill | Skill diagnostics |
debug snapshot | Snapshot diagnostics |
debug startup | Startup diagnostics |
debug agent <name> | Diagnostics for one agent |
debug v2 | v2 diagnostics |
debug wait | Wait helper |
debug paths and debug config are the fastest way to see exactly which files
your machine is reading — see
/reference/cli-configuration.