Skip to main content
The Traycer CLI is the traycer command. Use it to sign in, run and update the host on a machine, configure the shell Traycer uses, manage provider profiles and worktrees, and let agents work with other agents in a Task.

Installation

Traycer Desktop comes with the CLI, so you only need to install it yourself to use it on its own: on a remote machine, in scripts, or from your own terminal.
Requires Node.js 22.13 or later.
The npm package is @traycerai/cli.
Check the install:

Use the CLI That Comes With Desktop

Traycer keeps a copy of the CLI at ~/.traycer/cli/bin/traycer (%USERPROFILE%\.traycer\cli\bin\traycer.exe on Windows). The agents and terminals that Traycer launches already have this directory on their PATH. Your own terminal does not. To run traycer there, add the directory to your PATH, or install the CLI with npm or Homebrew.

Upgrading

traycer cli upgrade does not replace a CLI that a package manager installed. It prints that package manager’s upgrade command instead.

Global Flags

--json, --quiet, and --no-progress work with every command.

Auth Commands

CLI credentials are stored in ~/.traycer/cli/credentials, which Traycer Desktop shares.

Host Commands

The host is the background process that runs agents, terminals, and Tasks on a machine. Traycer Desktop manages it for you. Use these commands on a machine without Desktop, or to troubleshoot.

Check and Run

Install, Update, and Remove

Neither form of host uninstall touches your data or credentials under ~/.traycer. Options for these commands: The CLI reads the host’s connection details from ~/.traycer/host/.

Background Service

The host service commands manage the OS registration that keeps the host running: launchd on macOS, a systemd user service on Linux, and a Scheduled Task on Windows.

Host Lifecycle

traycer host lifecycle get shows the current mode, whether Desktop is open, how the host was started, and whether its supervisor supports the chosen mode. traycer host lifecycle set <mode> accepts background, linked, ask, stop-if-idle, or none. See When you quit Traycer for the corresponding behavior. Setting a mode does not start or stop the host. Startup changes apply to the next automatic start. Quit behavior can update while Desktop is open, but a quit already in progress keeps its earlier choice. A running host with an older supervisor may need a restart; the command reports this. In particular, set none leaves a running host alone and switches Desktop to remote hosts on its next launch. This differs from choosing Don’t run a host in Settings, which can ask you to confirm stopping the local host. Manually started foreground hosts remain unaffected when Desktop quits.

CLI Commands

Config Commands

The shell and environment settings apply when Traycer starts the host and opens terminals. They are the same settings as Settings › Shell, stored in ~/.traycer/cli/config.json. Provider credentials are not set here. Configure them in Settings › Providers.

Provider Profile Commands

A profile is an account a provider runs under. The provider’s own CLI login is the Terminal account, which these commands call ambient. Managed profiles are extra accounts next to it, available for Claude Code, Codex, Grok, and Antigravity. These commands change the same profiles as Profiles & Limits in Settings › Providers, on the host running on this machine.
  • <provider> is claude, codex, grok, or antigravity.
  • <profile> is ambient or a profile ID from traycer profile list.
  • add and login need a person at a terminal, so they are refused with --json and in CI. Claude Code is also refused when input is piped or redirected, because you may need to paste a code. Press Ctrl-C to cancel a sign-in; a profile that was being created is discarded.
  • For Claude Code, if the browser shows a code instead of finishing, paste it into the terminal and press Enter.
  • If the account you sign in to already belongs to another profile, add reports that profile and adds nothing.

Workspace and Worktree Commands

For worktree create:
  • --workspace is required.
  • Pass exactly one of --branch or --existing.
  • --source-branch and --carry-uncommitted work only with --branch.
worktree create prints the new worktree’s path. Pass it to traycer agent create --cwd to run an agent there. Traycer creates worktrees under ~/.traycer/worktrees/. See Worktrees and Setup and Teardown Scripts.

Terminal and Comment Commands

These commands need agent context.

Agent Commands

Agent commands are for agents that Traycer launches. They read the Task and the calling agent from the environment; see Agent Context. For how agents coordinate, see Agent-to-Agent. agent stop and agent archive need the full agent id. agent fork accepts an unambiguous id prefix.

Create Options

The new agent’s parent is the calling agent. Settings you leave out are inherited from the calling agent where they apply, and the permission mode defaults to full_access. auto is Auto mode, which is experimental: a judge approves routine commands and sends risky ones to you. Not every coding agent supports every mode; see Agents & Models.

Fork Options

Configure Options

agent configure requires --agent-id, --harness, --model, and --profile. The changes apply from the agent’s next turn.
agent configure does not keep the agent’s current optional settings. Any of these options you leave out is reset, so pass every one you want to keep.

Agent Roles

These commands exist only when Agent roles is turned on in Settings › General, under Experimental.

Agent Context

Traycer sets two environment variables for every agent it launches:
  • TRAYCER_EPIC_ID is the Task the agent belongs to.
  • TRAYCER_AGENT_ID is the agent itself.
There is no flag for the Task. Commands that need these values read them from the environment, and a few accept --agent-id in place of TRAYCER_AGENT_ID: Run outside an agent, these commands fail with “epic id required - set TRAYCER_EPIC_ID.” or “sender agent id required - set TRAYCER_AGENT_ID.” monitor checks the agent first: “agent id required — pass —agent-id or set TRAYCER_AGENT_ID.”

Read-Only Agents

Traycer sets TRAYCER_AGENT_CLI_SURFACE=readonly for Codex and OpenCode agents on the Terminal interface. These agents can list agents and read transcripts, but these commands are hidden from their help and refused if they run them: agent create, agent fork, agent configure, agent stop, agent archive, agent send, agent role claim, agent role relinquish, and worktree delete. The profile commands that change a profile (add, login, rename, enable, disable, remove) are refused too; profile list still works.

JSON Output

With --json, the CLI writes NDJSON to stdout: one JSON object per line. A command writes zero or more progress lines, then exactly one result line. For example, an agent command run outside an agent ends with:
  • --no-progress drops the progress lines. Setting CI or TRAYCER_NONINTERACTIVE does the same.
  • --help and --version with --json return one result line with the text in data.output.
  • A few commands differ: monitor ignores --json, link-phone, profile add, and profile login do not support it, host logs ignores --follow with it, and host capabilities --json prints a single JSON document instead of NDJSON.

Exit Codes

Paths and Logs

On Windows, the same paths are under %USERPROFILE%\.traycer\. To change how much the CLI and the host log, use CLI log level and Host log level in Settings › Host › Diagnostics.

Environment Variables

Provider API keys and model credentials belong in Settings › Providers, not in the CLI’s environment.

Examples

Set Up a Host on Another Machine

On a machine without Traycer Desktop, such as a server you reach over SSH:
Then connect to it from the app. See Remote hosts.

Start a Child Agent on a New Worktree

Inside an agent session, create a worktree on a new branch, then start a Codex agent there:
agent create prints the new agent’s id. Use traycer agent list-harness-models codex to find a model id.

Send a Message and Get a Reply

The reply arrives in the sending agent’s inbox. traycer monitor streams inbox messages as they arrive, and traycer agent inbox prints recent ones in full. To answer a request you received, pass its id with --response-id.

Diagnose the Host

Clean Up Worktrees

To review and remove many worktrees at once from the app, see Sweep.