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 cli/credentials inside the data folder, 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 folder or credentials. If the host does not stop, the command fails and keeps the install. --force works with or without --all: it forces the stop and removes the install even if the host remains running. Running terminal sessions and in-flight agent work are killed. Options for these commands: The CLI reads the host’s connection details from host/ inside the selected data folder.

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

Data Folder

On Windows, choose a new data folder or move an existing installation to a fixed local NTFS drive. Use a new or empty folder that is not inside, or a parent of, the current data folder. Network drives, removable drives, links, junctions, and FAT/exFAT volumes are refused. Status, dry-run, recovery, and cleanup commands work on all platforms. Each command accepts --json. Commands that change data ask for confirmation; --yes skips that question.

Move Existing Data on Windows

  1. Preview with traycer data migrate --to "D:\TraycerData" --dry-run.
  2. Quit Desktop, finish other Traycer commands, and close shells or editors using Traycer-managed worktrees.
  3. Run traycer data migrate --to "D:\TraycerData". Review the session-impact report before confirming. Some agents may need a new provider session or be held; native provider-only state does not always carry over. A dry-run cannot check session impact.
  4. Reopen Traycer and check your work. The old copy still uses disk space until you run traycer data cleanup <migration-id>. Cleanup refuses if recorded source content has changed.
In scripts, if session impact needs acceptance, rerun with the report’s --accept-session-impact <digest>; --yes alone does not accept it. Do not manually move the folder or run an older Traycer version after moving it: older versions can use the old copy and repeat queued work. The app, Desktop caches, and provider folders outside Traycer (such as ~/.claude) do not move. Windows read-only and hidden file attributes are not preserved. The selected location is recorded in ~/.traycer-bootstrap/location.json, which stays in your home folder. If the selected drive is missing, reconnect it; Traycer does not fall back to the default folder. For interrupted moves, see data folder recovery.

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 cli/config.json inside the selected data folder. 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.

Task Commands

task create runs as the person signed in with traycer login, on this machine’s host, so the host must be running (traycer host ensure). The Task is yours and appears in your Task list like one you started in the app. It needs no agent context and is refused inside an agent session. Exit code 0 means the Task and its first agent exist and the host accepted the message, not that the first turn has started. With --json, the result is { "taskId", "agentId", "alreadyCreated" }.

Task Create Options

If a run with a key sends the request and cannot tell whether the Task was created, it exits non-zero naming the Task id and the key’s record file, and later runs with that key refuse instead of starting a second Task. A sign-in that expires while the request is in flight is one such case: the run does not refresh it and send again. A sign-in that had already expired when the run started is refreshed, and the run creates as usual. Check your Task list, then delete that file to use the key again. A run that finds a run with the same key still creating its Task waits for it, and exits 75 having created nothing if that run takes too long. Run it again to read that run’s result.

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 Agents.

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 rename, agent stop, agent archive, agent send, agent role claim, agent role relinquish, task create, 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

These are the default paths. On Windows they are under %USERPROFILE%\.traycer\. After a data-folder move, the same relative paths are inside the selected folder; traycer data status shows it. 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.

Start a Task Every Night

On a machine where you ran traycer login, add this as one line in your crontab, replacing <model-id> with your model id. It starts one Task per day, even if the job runs twice:
The first agent spends your provider plan as soon as it starts. Without --idempotency-key, every run starts its own Task.

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.