Docs

The caret command

caret is Caret's command line, and the engine every machine runs. The app starts it in the background; you can also script threads, projects, servers and moves with it.

Put it on your PATH

On a Mac, Settings → About → The caret command → Install links it into /usr/local/bin (which asks for your password) or ~/.local/bin. Remove takes the link away.

On a server the app installed, the engine is ~/.caret/runtime/current/caret-engine, and it takes the engine's own commands (serve, status, doctor, service, update, pair, auth).

Each command talks to this machine's engine, starting it if it isn't running. caret --help and caret <command> --help list every option. Where a command takes a thread, you can name it by its id, the start of its id, or a piece of its title. A project is named by its id, name or folder.

Check the engine

status [--json]: who the engine is and which agents it found.

caret status

stop [--wait <seconds>]: stop the engine for this data folder (it waits 10 seconds by default).

caret stop

Open the app

open [path]: open the app on a folder (this one by default); it becomes a project, with a new thread in it. Mac only.

caret open ~/code/web

Work with threads

thread start <prompt>: start a thread. Options: --agent (claude, codex, cursor, opencode, gemini, grok, kiro, goose or fx; claude by default), --project <folder> (added as a project if it isn't one; a scratch folder otherwise), --mode (supervised, auto-accept-edits, auto or full-access; auto by default), --model, --effort, --worktree (a new worktree on a new branch), --wait (wait for the first turn and print the reply) and --json.

caret thread start "Fix the failing test in parser.rs" --project . --worktree --wait

thread send <thread> <text>: send a message. It starts a turn, or with --steer joins the running one, or with --queue waits for it. --wait prints the reply.

caret thread send "failing test" "Now run the whole suite" --wait

thread show <thread> [--json]: a thread's messages and work.

thread list [--json]: every thread that isn't archived. threads prints the same list.

caret thread list --json

run <prompt>: start a thread and follow it on the terminal until it settles, answering its approvals as you go (--yes approves them all). Takes --agent (codex by default), --project, --mode, --model and --effort.

caret run "Add a CHANGELOG entry for 1.0" --agent claude --project .

models [agent]: the models an agent offers (codex by default).

caret models claude

Work with projects

project add <folder>, or add <folder>: add a folder as a project.

project remove <project> [--delete-threads]: forget a project. Its folder is left alone; --delete-threads deletes its threads and their history too.

project rename <project> <name> and project list [--json].

caret project add ~/code/api
caret project rename api "API server"

actions <folder> [--run <id>]: a project's actions (from caret.json, t3.json and the settings), or run one in an engine terminal.

caret actions . --run dev

servers: the servers listening in the engine's terminals and agent sessions.

files find <query>: Go to file, fuzzy. --project (the current folder by default), --limit (20) and --dirs for folders too.

caret files find sidebar

search <query>: search the project's files. -e for a regular expression, -s to match case, -w for whole words, -g <glob> to include and -x <glob> to exclude (both repeatable), -C <n> lines of context, --max <n> matches at most, --project.

caret search "fn render" -g "*.rs" -C 2

Move threads between machines

move <thread> --to <where>: move a thread to an engine's socket, a machine the app knows (by its name or id), or an ssh host.

  • --carry <file>: an ignored file to take along (.env), relative to the thread's folder; repeatable.
  • --into <folder> or --checkout <folder>: when the other machine has no project for the repository, clone it into that folder, or use that checkout.
  • --worktree or --in-checkout: work in a new worktree there, or in the project's own checkout.
  • --agent <claude|codex>: carry on with another agent there.
  • --stop stops a running turn first; --wait moves once it ends.
  • --engine <path>: the engine's path on an ssh host.
caret move "sidebar jitter" --to devbox --carry .env

export <thread> [-o <file>] [--carry <file>]: pack a thread into a .caretmove file. It stays here too.

import <file>: bring a thread in from a .caretmove file. Takes the same --into, --checkout, --worktree, --in-checkout and --agent as move.

caret export "sidebar jitter" -o jitter.caretmove
caret import jitter.caretmove --worktree

Run the engine as a service

service install [--listen <addr>]: run the engine all the time, as a LaunchAgent on a Mac or a systemd user service on Linux, started again at every login. Agents keep working with no app connected. --listen takes direct connections (see serve).

service status [--json]: whether it's installed and running. It exits 0 when running, 3 not installed, 4 stopped, 5 engine down, 6 outdated (run service install again from this build), 7 restart pending (service.env changed), 8 linger disabled (run loginctl enable-linger).

service restart and service uninstall.

The service reads environment variables from ~/.caret/engines/caret/service.env first: one KEY=value a line, # for comments. Put your PATH there so the service finds agents installed with Homebrew, nvm or in ~/.local/bin, then run caret service restart.

caret service install
caret service status

Update engines

update [version] [--machine <name>] [--now] [--wait <seconds>]: update this machine's engine, or a named machine's (one the app knows, or an ssh host), once its running turns end. --now doesn't wait; --wait sets the longest wait (1800 seconds by default).

caret update --machine devbox

Without a version, the engine becomes this caret's own version. --channel stable or --channel nightly takes that track's newest release instead, and update <version> a given one: either is downloaded from caret.gg's releases and checked against its SHA256SUMS before it's put in place.

caret update --channel nightly

Pair devices

pair [--scopes <list>] [--tailscale] [--json]: make a pairing code, with its caret://pair link and a QR code in the terminal. --scopes limits what the device may do (threads, terminal, files, git, settings, agents, access, ports; all by default). --tailscale keeps only the tailnet's links. Direct connections must be on (Settings → Access, or serve --listen).

caret pair --scopes threads,files

auth pairing create|list|revoke: make a code (as pair does), list the codes not used yet, or withdraw one by the id list shows.

auth session list|revoke: the paired devices, with their scopes and whether they're connected; revoke one and its connections close at once.

caret auth session list
caret auth session revoke <id>

Run the engine yourself

serve: run this machine's engine until it's stopped. The app and the service do this for you.

  • --listen <addr>: also take direct connections at ip:port, an address alone (port 7443), or auto (every LAN and tailnet address). Repeatable. Public addresses are refused.
  • --idle-exit <seconds>: stop after that long with no clients (0, never, by default).
  • --env-file <file>: read KEY=value lines first.
  • --verbose: log to the terminal as well as the log file.

proxy: join stdin and stdout to the engine, starting it if needed. The app reaches a server with ssh host caret proxy.

Check the database

doctor [--fix] [--dry-run] [--json]: check this machine's engine database and what deleted threads left behind: the database's integrity, the search index, space that can be reclaimed, and orphaned attachments, uploads, checkpoints and terminal saves. --fix repairs and reclaims; --dry-run says what --fix would do and changes nothing. It goes through the engine (starting it if it isn't running), so it's safe while agents work. It exits 0 when there's nothing to do and 3 when something needs fixing.

caret doctor
caret doctor --fix