Skip to content
stage

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

CommandDoes
stage task ls [--project P] [--state S,..] [-q TEXT] [--closed true|all] [--limit N]list tasks; open tasks by default
stage task show IDa 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 IDstart (requires completed prerequisites), stop, duplicate
stage task rm IDdelete 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 IDcompletion 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 IDwhat 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 TEXTas 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

FlagMeaning
--project Pproject id or title
--connection IDthe connection that owns the selected workspace
--workspace-id IDexact workspace on that connection, from stage projects ls. An empty value clears the pin on an untimed backlog task edit
--execution-config JSONharness 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-meadopt the calling session as a task and make it the first need
--tree IDjoin a tree (a parallel root unless --needs)
--start-mode auto|manual|inheritper-task exception to the tree's start mode; inherit clears it
--handoff=falseturn off handoff (task edit --handoff=true|false)
--startlaunch now
--start-at YYYY-MM-DDTHH:mm --tz ZONEone-shot start at a wall time (task edit --start-at "" clears it)
--initial-note TEXTfirst journal note
--origin-connection ID --origin-session IDon 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

CommandDoes
stage tree ls [--status active|done|archived|all] [--all] [--project P]list trees; active by default
stage tree show IDlevels, 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_IDtake 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 IDstart every ready member
stage tree done|archive ID [--undo]mark done or archive (--undo reopens)
stage tree rm-tree IDdelete 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 IDstop 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

CommandDoes
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_IDone entry in full

Categories are optional: finding, decision, blocker, outcome. The CLI generates a request id when you omit one.

Schedules

CommandDoes
stage schedule ls [--project P]list schedules
stage schedule show IDa 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 IDdelete (spawned tasks stay), run now, pause, resume
stage schedule preview --cron CRON --tz ZONEthe next three fire times

Sessions, context and lookup

CommandDoes
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 REFwhat 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 contextyour session, cwd, resolved project, owning task and tree
stage projects ls [--json]logical projects, connections and exact workspace selectors
stage projects add --title Tcreate 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|rundeclared harness actions. For a project workspace, pass --project ID --on-connection ID --workspace-id ID

Tools

CommandDoes
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 mcpthe tools over stdio MCP (MCP tools)

Setup

CommandDoes
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 --checkreport 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

CommandDoes
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 disconnectforget the credentials (tasks stay)

Fields and actions: Connections.

Server

CommandDoes
stage serve [--listen ADDR]... [--multi-user]run in the foreground (also stage with no arguments). --multi-user enables shared access.
stage serve --managedrun 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-setupreplace the private first-admin setup link while setup is pending
stage owner recover-admin --email EMAILissue a 30-minute password reset link for an active admin
stage db invalidate-accessclear 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

CommandDoes
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 restartstart, and restart a running server (apply service.env edits)
stage service stopstop through the service manager; the server drains for up to 100s
stage service statusstate, Stage health and T3 reported separately, log location, problems with fixes
stage service logs [-f] [-n 100]recent log lines
stage service enable / disablelogin startup on or off (neither starts nor stops it)
stage service uninstallstop, 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.

ExitMeaning
0ok (status: running and ready)
1failed
2usage
3--wait expired
4status only: not running or not installed
5another (foreground) server holds the data dir
6no usable service manager
7invalid configuration (for example an invalid service.env)

Worker and machines

CommandDoes
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 LABELrename a machine
stage machine rm IDremove a remote machine: revokes its token, keeps its connections as history
stage machine ping IDa 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 statusconfig, 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|uninstallthe 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

CommandDoes
stage update [--check] [--version X] [--from DIR]install the latest stable release (or X) in the same mode
stage uninstallremove this installation; keeps data, config, logs and backups
stage install --from DIRinstall 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:

  1. --url URL
  2. STAGE_AGENT_URL for agent commands, then STAGE_URL. Both accept an HTTP(S) address or unix:///abs/path.sock
  3. the private shared agent socket for agent commands, then the default Stage socket, when live
  4. 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.com

The 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.com

The 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:

  1. --caller-connection ID --caller-session ID
  2. STAGE_CALLER_SESSION=<connectionId>:<externalSessionId>
  3. the harness's session variable (T3CODE_THREAD_ID for T3, OPENCODE_SESSION_ID for OpenCode, CODEX_THREAD_ID for Codex, CLAUDE_CODE_SESSION_ID for Claude Code; inside a Claude process T3 runs, T3's wins), on that harness's connection on this machine. The CLI and stage mcp run 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; --json for agents and scripts.
  • Usage errors exit 2; other failures exit 1.
  • Documented exit codes: stage task wait exits 3 on timeout; stage status 1 or 3 (above); stage call 1 on a tool error; stage setup --check 1 on problems; stage service 0 to 7; stage worker status 0, 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