Skip to Content
ReferenceCLI commands

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:

CommandWhy it is excluded
upgradeEvery endpoint it depends on returns 404. It cannot update the binary. To update, re-run the install command from /cli/install.
github, gitlab, prNever exercised end to end. Their setup requirements and flags are unverified.
the hidden console groupDeliberately hidden from --help by the binary. Not a supported surface.
generateRegistered, but its behaviour was not verified.

Global flags

These work on every command.

FlagWhat it doesDefault
--print-logsPrint logs to stderroff
--log-level DEBUG|INFO|WARN|ERRORSet the log levelunset
--pureRun without external pluginsoff
-h, --helpShow help
-v, --versionPrint 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"
FlagWhat it doesDefault
-m, --model <provider/model>Model to use, in provider/model formaccount default
-c, --continueContinue the last sessionoff
-s, --session <id>Continue a specific session id
--forkFork 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
--shareShare 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 attachingcurrent directory
--variant <name>Provider-specific reasoning effort, for example high, max, minimal (run only)
--thinkingShow thinking blocks (run only)off
--replay / --no-replayReplay interactive session history on resume and after resize--replay
--replay-limit <n>Cap the replay to the newest N messagesunset
-i, --interactiveRun in direct interactive split-footer modefalse
--format default|jsonOutput format; json emits raw JSON eventsdefault
--dangerously-skip-permissionsAuto-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.

CommandWhat it does
synapsex-code providers list (alias ls)List configured credentials and the file they live in
synapsex-code providers loginInteractive sign-in
synapsex-code providers logout [provider]Remove a stored credential
FlagWhat it doesDefault
-p, --provider <id>Skip the provider pickerprompts
-m, --method <label>Skip the login-method pickerprompts

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
FlagWhat it doesDefault
[provider]Filter to one provider idall
--verboseMore verbose output, including metadata such as costsoff
--refreshRefresh the models cacheoff

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
CommandWhat it does
lab run <file>Run a file. With no --backend it uses the free local OpenQASM simulator
lab loginConnect 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 backendsList compute backends with allowed/affordable status. Not generally available
lab recommend <file>Rank backends for a workload. Not generally available
lab creditsShow 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:

FlagWhat it doesDefault
--localRun on this machine. $0, off-ledger, no gate, works offlinefalse
--simRun on the free local OpenQASM simulator. $0, off-ledger, offline. This is what happens when no --backend is givenfalse
--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–40961024
--seed <n>Random seed; simulator only. Makes sampled counts reproducibletime-based
--max-cost <usd>USD cost ceiling for a paid run. It can only lower risk, never raise an estimate
--yesAuto-confirm a parked cost estimate, within the server budget policyfalse
--session <id>Run against a specific Lab session instead of the project’s active oneactive session

Flags for lab ask:

FlagWhat it doesDefault
--session <id>Target an existing Lab sessionactive session
--model <id>Override the server default modelserver 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

CommandWhat it does
synapsex-code serveStart a headless HTTP server exposing the agent
synapsex-code webStart the server and open the web interface
synapsex-code attach <url>Attach a terminal to a running server
synapsex-code acpStart an ACP (Agent Client Protocol) server
FlagWhat it doesDefault
--port <n>Port to listen on0 (random)
--hostname <host>Hostname to listen on127.0.0.1
--mdnsEnable mDNS service discovery (defaults hostname to 0.0.0.0)false
--mdns-domain <name>Custom mDNS domainsynapsexCode.local
--cors <domain...>Additional domains to allow for CORS[]
-u, --username <name>Basic-auth usernameSYNAPSEX_CODE_SERVER_USERNAME, else synapsexCode
-p, --password <pass>Basic-auth passwordSYNAPSEX_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

CommandWhat 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
FlagWhat it doesApplies to
--url <url>URL of a remote MCP serverremote only
--env KEY=VALUEEnvironment variable, repeatablelocal only — rejected with --env is only valid for local MCP servers
--header KEY=VALUEHTTP header, repeatableremote 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

CommandWhat it does
synapsex-code agent createCreate a new agent
synapsex-code agent listList all available agents
synapsex-code session listList stored sessions
synapsex-code session delete <sessionID>Delete a session

stats, export, import, db

CommandWhat it does
synapsex-code statsShow 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 pathPrint the local database path
FlagCommandWhat it doesDefault
--days <n>statsLimit to the last N daysall
--tools <n>statsShow the top N tools
--models [n]statsShow model statistics (hidden by default; pass a number for top N)hidden
--project [name]statsFilter by project; an empty string means the current projectall
--sanitizeexportRedact sensitive transcript and file dataoff
--format json|tsvdbOutput formattsv

More detail: /cli/sessions-and-usage.

plugin, completion, uninstall, debug

CommandWhat it does
synapsex-code plugin <module> (alias plug)Install an npm plugin module and update the config
synapsex-code completionGenerate a shell completion script
synapsex-code uninstallUninstall the CLI and remove related files
FlagCommandWhat it doesDefault
-g, --globalpluginInstall into the global configfalse
-f, --forcepluginReplace an existing plugin versionfalse
-c, --keep-configuninstallKeep configuration filesfalse
-d, --keep-datauninstallKeep session data and snapshotsfalse
--dry-rununinstallShow what would be removed without removing itfalse
-f, --forceuninstallSkip confirmation promptsfalse

synapsex-code debug exposes these subcommands:

SubcommandWhat it does
debug pathsPrint the resolved global paths (data, config, cache, state, log, bin, repos, tmp)
debug configPrint the resolved configuration
debug infoPrint version, OS, terminal and loaded plugins
debug lspLanguage-server diagnostics
debug rgRipgrep diagnostics
debug fileFile-handling diagnostics
debug scrapScratch diagnostics
debug skillSkill diagnostics
debug snapshotSnapshot diagnostics
debug startupStartup diagnostics
debug agent <name>Diagnostics for one agent
debug v2v2 diagnostics
debug waitWait helper

debug paths and debug config are the fastest way to see exactly which files your machine is reading — see /reference/cli-configuration.