CLI
stage is one binary: stage serve (or stage with no arguments) runs the server, and every other subcommand is the CLI. The desktop app and the headless install both put it in ~/.local/bin. This page groups the commands; stage help lists every flag.
Coding agents with a shell use the CLI by default: it costs no context until used, while a registered MCP server loads every tool schema into every session (Agents).
Tasks
| Command | Does |
|---|---|
stage task ls [--project P] [--state S,..] [-q TEXT] [--closed true|all] [--limit N] | list tasks; open tasks by default |
stage task show ID | a task with its final reply, available session link, launch options and handoff |
stage task add --title T --prompt TEXT|- [config] | create a task, saved to backlog unless --start |
stage task edit ID [config] | edit a task; outside backlog only the title changes |
stage task needs ID [NEED...] | replace a backlog task's needs (none clears them) |
stage task start|stop|dup ID | start (requires completed prerequisites), stop, duplicate |
stage task rm ID | delete a task that never started and has no recorded work |
stage task archive ID [--undo] | archive a standalone task (--undo unarchives) |
stage task wait ID [--until S,..] [--timeout 10m] | wait for a state; exit 3 on timeout |
stage task notes ID ... | the task's journal (Journals) |
stage task preview ID | completion preview: revision, evidence version, dependents |
stage task complete ID --revision N --evidence-version V [--note TEXT] [--request-id KEY] | complete another task with the preview's values |
stage task reopen ID --revision N [--request-id KEY] | reopen a completed task |
stage task requests ID | what the task's session waits on |
stage task respond ID RID [--option O] [--text T] [--answers JSON] [--expect-revision N] | answer one request |
stage task send ID --text TEXT [--steer or --queue] [--expect-revision N] | Send after a turn or explicitly Steer or Queue during it |
stage task activity ID [--attempt N] [--limit N] | read recent activity from the current session or an earlier attempt |
stage task queue ID [--cancel QID or --steer QID or --edit QID --text T or --move QID [--before QID]] | list, cancel, promote, edit or reorder native queued messages (--move without --before moves to the end) |
stage task escalate ID --reason TEXT | as the tree's steerer, notify the user about a member's wait now |
stage task opening-prompt ID [--full] | an adopted task's opening prompt |
complete, reopen, respond, send and queue writes refuse your own task or session.
Task flags
| Flag | Meaning |
|---|---|
--project P | project id or title |
--connection ID | the connection that owns the selected workspace |
--workspace-id ID | exact workspace on that connection, from stage projects ls. An empty value clears the pin on an untimed backlog task edit |
--execution-config JSON | harness options advertised by stage models ls, launch options included (a worktree, and on T3 its baseRef and branch). --workspace, --base-ref, --branch, --base and --base-task were removed |
--prompt-file PATH, --prompt - | read the prompt from a file or stdin |
--image PATH... | attach local images (PNG, JPEG, GIF, WebP, up to 8) |
--needs ID,.. | wait for completion of those tasks (joins their tree, or starts one) |
--after-me | adopt the calling session as a task and make it the first need |
--tree ID | join a tree (a parallel root unless --needs) |
--start-mode auto|manual|inherit | per-task exception to the tree's start mode; inherit clears it |
--handoff=false | turn off handoff (task edit --handoff=true|false) |
--start | launch now |
--start-at YYYY-MM-DDTHH:mm --tz ZONE | one-shot start at a wall time (task edit --start-at "" clears it) |
--initial-note TEXT | first journal note |
--origin-connection ID --origin-session ID | on task ls: tasks a session created |
Use stage projects ls --json to select a matching connection and
workspace. Pass both flags for immediate or one-shot starts and schedule
creation. An untimed backlog task can use --connection ID --project P
and omit the workspace. When upgrading scripts, replace --binding with
--workspace-id and pass the workspace's connection. Use Projects in the
app to move or separate workspaces previously managed by projects merge
or projects split.
Trees
| Command | Does |
|---|---|
stage tree ls [--status active|done|archived|all] [--all] [--project P] | list trees; active by default |
stage tree show ID | levels, states, needs, readiness |
stage tree new --title T [--start-mode auto|manual] ID[:NEED,..]... | build a tree from existing tasks |
stage tree add TREE_ID TASK_ID [--needs ID,..] | add a task (a task in another tree moves) |
stage tree rm TASK_ID | take a task out of its tree (dependents take its needs) |
stage tree edit ID [--title T] [--start-mode auto|manual] [--hold DURATION] | rename, set the shared start mode, or how long a member's needs input waits for the steerer (5m, 0/off) |
stage tree start ID | start every ready member |
stage tree done|archive ID [--undo] | mark done or archive (--undo reopens) |
stage tree rm-tree ID | delete a tree and its tasks (none started) |
stage tree steer ID --prompt TEXT --connection ID --workspace-id ID [--title T] [--execution-config JSON] [--replace] | give the tree a steerer task and launch it with the harness options (models ls shows them; omitted: the connection's pinned model, else the defaults); --replace ends the current one and stops its session. Steer a tree |
stage tree unsteer ID | stop steering (ends the binding, stops the steerer's session) |
stage tree steering-events ID [--after N] [--limit N] | the tree's steering event feed |
stage tree notes ID ... | the tree's journal (Journals) |
Journals
| Command | Does |
|---|---|
stage task|tree notes ID [list] [--kind notes|events|all] [--category C] [--q TEXT] [--cursor C] [--limit N] | read entries; a tree read takes --task ID to filter |
stage task|tree notes ID add --text TEXT [--category C] [--request-id KEY] | append a note; --text - reads stdin; a tree note takes --source-task ID |
stage task|tree notes ID get ENTRY_ID | one entry in full |
Categories are optional: finding, decision, blocker, outcome. The CLI generates a request id when you omit one.
Schedules
| Command | Does |
|---|---|
stage schedule ls [--project P] | list schedules |
stage schedule show ID | a schedule with its recent runs |
stage schedule add --title T --prompt TEXT --cron CRON --tz ZONE [config] [--paused] [--notes TEXT] | create a schedule; --notes is a template for each spawned task's note |
stage schedule edit ID [config] [--cron CRON] [--tz ZONE] | edit it |
stage schedule rm|run|pause|resume ID | delete (spawned tasks stay), run now, pause, resume |
stage schedule preview --cron CRON --tz ZONE | the next three fire times |
Sessions, context and lookup
| Command | Does |
|---|---|
stage sessions adopt [--target-connection ID --target-session ID] [--title T] [--initial-note TEXT] [--tree ID] [--project ID | --new-project TITLE] | track a session as a task (default: your own session) |
stage show REF | what a Stage link, a harness session link, #ID or a scoped session path names; --target-connection ID --target-session ID names a session by id |
stage context | your session, cwd, resolved project, owning task and tree |
stage projects ls [--json] | logical projects, connections and exact workspace selectors |
stage projects add --title T | create an empty project |
stage projects edit ID [--title T] [--archived true|false] | rename, archive or unarchive; omitted flags keep their value |
stage models ls --connection ID [--workspace-id ID] | models, agents and options for a connection or an exact workspace |
stage action ls|run | declared harness actions. For a project workspace, pass --project ID --on-connection ID --workspace-id ID |
Tools
| Command | Does |
|---|---|
stage tools [NAME] | list every MCP tool, or one tool's description and input schema |
stage call TOOL [JSON|-] | run one tool with JSON arguments (- reads stdin) and print its JSON result exactly as over MCP; exit 1 on a tool error |
stage mcp | the tools over stdio MCP (MCP tools) |
Setup
| Command | Does |
|---|---|
stage setup [--claude] [--codex] [--opencode] [--mcp] | the Stage skill and an instruction pointer for every agent found (or those named), then a check; --mcp also registers stdio MCP with Claude Code and Codex |
stage setup --check | report only: CLI on PATH, server, caller detection, per-agent skill and MCP; exit 1 on problems |
stage setup skill [--claude] [--codex] [--opencode] | the skill only |
stage setup mcp [--claude] [--codex] [--http | --credential-file FILE] | register MCP only. Use a private credential file for shared stdio MCP over the network |
stage setup instructions [--claude] [--codex] [--file PATH] | the instruction pointer only |
Agents are found by their command on PATH or their config directory. The skill is SKILL.md in ~/.claude/skills/stage/ (Claude Code) and ~/.agents/skills/stage/ (Codex and OpenCode). The instruction pointer is a two-line block in ~/.claude/CLAUDE.md and ~/.codex/AGENTS.md.
Harness
| Command | Does |
|---|---|
stage harness [list] | harnesses this server knows, its machine profile, which can run here |
stage harness KIND [status] | KIND's connection: state, settings, actions |
stage harness KIND set FIELD=VALUE... [--reset FIELD]... | save settings |
stage harness KIND run ACTION [FIELD=VALUE...] | t3: auto-pair, pair code=CODE; opencode: connect-local, pair link=LINK; codex: connect; claude: connect |
stage harness KIND disconnect | forget the credentials (tasks stay) |
Fields and actions: Connections.
Server
| Command | Does |
|---|---|
stage serve [--listen ADDR]... [--multi-user] | run in the foreground (also stage with no arguments). --multi-user enables shared access. |
stage serve --managed | run as the per-user service (what stage service registers) |
stage status [--wait DUR] | the server this CLI reaches: version, readiness, harness states; exit 1 unreachable or another API version, 3 when --wait expires |
stage owner reissue-setup | replace the private first-admin setup link while setup is pending |
stage owner recover-admin --email EMAIL | issue a 30-minute password reset link for an active admin |
stage db invalidate-access | clear copied sessions and grants after restoring a database, before starting the server |
Run the owner commands on the server as its OS user. For restore, set STAGE_DATA_DIR explicitly and leave the server stopped until invalidation succeeds. Configuration
Service
| Command | Does |
|---|---|
stage service start [--wait 30s] | register or update the definition, create service.env, start if not running, wait for readiness; never restarts a running server |
stage service restart | start, and restart a running server (apply service.env edits) |
stage service stop | stop through the service manager; the server drains for up to 100s |
stage service status | state, Stage health and T3 reported separately, log location, problems with fixes |
stage service logs [-f] [-n 100] | recent log lines |
stage service enable / disable | login startup on or off (neither starts nor stops it) |
stage service uninstall | stop, disable and remove the definition; keeps data, service.env and logs |
Every command but logs takes --json. Service commands always act on this installation's own service; --url and STAGE_URL do not apply. Without a user manager (no logind session, containers, WSL without systemd) they exit 6.
| Exit | Meaning |
|---|---|
| 0 | ok (status: running and ready) |
| 1 | failed |
| 2 | usage |
| 3 | --wait expired |
| 4 | status only: not running or not installed |
| 5 | another (foreground) server holds the data dir |
| 6 | no usable service manager |
| 7 | invalid configuration (for example an invalid service.env) |
Worker and machines
| Command | Does |
|---|---|
stage machine [ls] | machines that run harnesses: kind, status, connections |
stage machine pair [--label L] | a one-time link (10 minutes) and the stage worker join command; needs STAGE_PUBLIC_URL on the server |
stage machine rename ID LABEL | rename a machine |
stage machine rm ID | remove a remote machine: revokes its token, keeps its connections as history |
stage machine ping ID | a round trip through the machine's worker channel |
stage worker join <link> [--label L] | redeem a pairing link; refuses when already joined |
stage worker run [--listen ADDR] | the worker in the foreground (instead of the service) |
stage worker status | config, the main server's view of this machine, the running process and its gateway addresses; exit 0 online, 1 not online, 4 not joined, 7 revoked |
stage worker leave [--local] | remove this machine on the main server, then delete the local config; --local deletes only locally |
stage worker service start|stop|restart|status|logs|enable|disable|uninstall | the worker service, with the same flags and exit codes as stage service |
Worker commands take --config PATH and --json, and never use --url or STAGE_URL: the main server's URL comes from the worker config. Setup: Workers.
Install
| Command | Does |
|---|---|
stage update [--check] [--version X] [--from DIR] | install the latest stable release (or X) in the same mode |
stage uninstall | remove this installation; keeps data, config, logs and backups |
stage install --from DIR | install a downloaded, verified release (run by the install script and stage update) |
stage version [--json] | this binary and its installation |
Exit codes: Install and update.
Server selection
The CLI and stage mcp reach the server at:
--url URLSTAGE_AGENT_URLfor agent commands, thenSTAGE_URL. Both accept an HTTP(S) address orunix:///abs/path.sock- the private shared agent socket for agent commands, then the default Stage socket, when live
http://127.0.0.1:7380
stage status shows which server the CLI reaches. Agent commands never start a server; when nothing answers, their error suggests stage service start. On a worker's machine the CLI finds the worker's agent gateway socket the same way.
Sign in to shared Stage
stage auth login --url https://stage.example.com --email you@example.com
stage auth whoami --url https://stage.example.com
stage projects ls --human --url https://stage.example.com
stage auth logout --url https://stage.example.comThe password prompt hides input. The CLI stores the session for this address
and installation in an owner-only file under
${XDG_CONFIG_HOME:-$HOME/.config}/stage/cli for the regular installation.
Use the same address for later commands. A human CLI session has the signed-in
account's current role. Logout revokes that session and removes the file.
Use the private agent socket for local agents. For a network integration,
create a separate 30-day agent credential. Use --target URL if the agent
will connect to the same installation at a different address from your CLI.
stage auth agent rotate --url https://stage.example.com --out "$HOME/.config/stage-agent/stage.json"
stage setup mcp --url https://stage.example.com --credential-file "$HOME/.config/stage-agent/stage.json"
stage auth agent revoke --url https://stage.example.comThe credential file and its directory are owner-only. A network CLI or stdio
MCP process reads the file from STAGE_AGENT_CREDENTIAL_FILE. Rotation
invalidates the previous bearer for your account. After revocation, remove
the retired file from the integration's secret storage.
Caller context
Commands that create tasks, write notes, adopt sessions or show context know the calling session:
--caller-connection ID --caller-session IDSTAGE_CALLER_SESSION=<connectionId>:<externalSessionId>- the harness's session variable (
T3CODE_THREAD_IDfor T3,OPENCODE_SESSION_IDfor OpenCode,CODEX_THREAD_IDfor Codex,CLAUDE_CODE_SESSION_IDfor Claude Code; inside a Claude process T3 runs, T3's wins), on that harness's connection on this machine. The CLI andstage mcprun as the agent's child processes, so they read it themselves.
stage context shows the session and where it came from. Without a session, supply a project or journal owner explicitly.
Output
- Human output by default;
--jsonfor agents and scripts. - Usage errors exit 2; other failures exit 1.
- Documented exit codes:
stage task waitexits 3 on timeout;stage status1 or 3 (above);stage call1 on a tool error;stage setup --check1 on problems;stage service0 to 7;stage worker status0, 1, 4, 7.
Examples
Set WORKSPACE_ID to a workspace selector listed on connection 2.
stage projects ls --json
stage task add --title "Fix flaky test" --prompt "..." --connection 2 --workspace-id "$WORKSPACE_ID" --execution-config '{"model":"m","options":[{"id":"effort","value":"high"}]}' # backlog
stage task add --title "Deploy" --prompt-file deploy.md --connection 2 --workspace-id "$WORKSPACE_ID" --after-me # eligible after user completion of this session's task
echo "..." | stage task add --title "Refactor" --prompt - --connection 2 --workspace-id "$WORKSPACE_ID" --execution-config '{"options":[{"id":"worktree","value":true},{"id":"baseRef","value":"origin/main"}]}' --start
stage task ls --state backlog --json
stage task wait 42 --until done --timeout 30m # exit 3 on timeout
stage tree new --title "Auth" 41 43:41 42:43 # 43 needs 41, 42 needs 43
stage task add --title "Docs" --prompt "..." --connection 2 --workspace-id "$WORKSPACE_ID" --needs 42 --start-mode manual # ready (not launched) once 42 is completed
stage tree start 7 # start every ready member
stage tree steer 7 --prompt "Answer members, accept good work" --connection 2 --workspace-id "$WORKSPACE_ID" # a steerer for tree 7
stage tree steering-events 7 --after 40 # what changed since event 40
stage task notes 42 add --text "Chose cookie sessions" --category decision
stage task ls --origin-connection 1 --origin-session "$T3CODE_THREAD_ID" # tasks a T3 session created (connection 1)
stage show "http://127.0.0.1:7380/tasks/12" # what a pasted link names
stage schedule add --title "Nightly deps" --prompt "..." --connection 2 --workspace-id "$WORKSPACE_ID" --cron "0 2 * * *" --tz Europe/Berlin