Skip to content
86% off$349 $48.86code BF2026

Docs

Sledbot docs30 pages

The sled CLI: commands, flags and exit codes

Sledbot's sled CLI reference: install it, every command and flag, exit codes, agent-to-agent messaging, and CLI-only checkpoint, explain and rename.

Updated 11 min read

On this page

This page is a reference for the sled CLI. It covers every command, its main flags, its exit codes, and how agents message each other. sled is one binary for terminals, agents, files, jobs, machines and Sled Core. Every Sledbot terminal already has it on its PATH, so you only need to install it if you want to use it in other terminals too.

Some things exist only in the CLI: turn checkpoints, sled explain and renaming a machine. They are collected under Features only in the CLI.

Install the sled CLI for other terminals

  1. Open Sledbot's settings with ⌘, (Command-Comma).
  2. Select General.
  3. Under Command line ▸ sled command, click Install….

Sledbot creates a symlink at ~/.local/bin/sled. If ~/.local/bin isn't on your PATH, it uses /usr/local/bin/sled instead, and macOS asks once for an administrator password. The result shows as "Installed at <path>". If you skip the password, sled stays at ~/.local/bin/sled only. In that case the result reads "<path> (add ~/.local/bin to your PATH)".

To add that folder to your PATH in zsh (the default shell on macOS), add this line to ~/.zshrc, then open a new terminal window:

bash
export PATH="$HOME/.local/bin:$PATH"

To undo it, delete the line from ~/.zshrc.

Check the install with sled --version, which prints 1.0.0. sled --skill prints the guide Sledbot gives to agents. If you see "The bundled sled helper is missing (Contents/Helpers/sled).", the app install is broken. Reinstall Sledbot from the DMG.

Addressing terminals

Wherever a command takes <t>, you can pass:

  • an id such as t7 or just 7;
  • a remote terminal as <machine>/t<N>, for example vps/t7;
  • the terminal's name.

sled ls lists ids and names. Add --all-machines to include remote machines.

Terminal commands

CommandWhat it doesMain flags
sled run [--] cmd…Starts a program in a new terminal. Without --bg it waits like a shell and returns the program's exit code.--bg, --name, --as <template>, --on <machine>, --cwd, --worktree BRANCH, --parent, --no-parent, --outlive-parent, --timeout (180; 0 = no limit), --label k=v, --keep, --json
sled lsLists terminals: id, name or agent, where, status.--all-machines, --json
sled get <t>Shows one terminal.--json
sled read <t>Prints a terminal's screen and history.--lines (the core caps it at 10,000), --json
sled send <t> <text…>Pastes text into a terminal and presses Enter. It waits for a person to pause typing.--if idle|working, --wait, --force, --timeout 180
sled keys <t> <keys…>Presses named keys: Enter, Escape, Tab, Up, C-c, M-x, F5, a and so on.none
sled interrupt <t>Presses Ctrl-C in a terminal.none
sled wait [t…]Waits for a terminal or your children to change state, or for a message to arrive. Use it instead of sleep.--children any|all, --output <regex>, --timeout 180, --json
sled attach <t>Puts your current terminal on a Sled terminal. Ctrl+\ detaches.--observe, --history 2000
sled kill <t>Ends a terminal's program (hangup, then escalates).none
sled rm <t>Removes a finished terminal.none
sled label <t> k=v…Sets labels. key= removes a label.none
sled keep <t>Replaces a lost program with a shell in its folder.--off
sled eventsPrints recent events.--follow, --limit 50, --json
sled status <state>Reports this terminal's status (used by agent hooks). States: working, blocked, done, idle, error.--kind permission|question|auth|limit, --msg
sled explain <t>Shows why a terminal has its status.--json
sled resume [t] [-- argv]Restarts an exited agent with its own resume command. --report tells Sledbot how to resume you.--dry-run, --report, --agent, --json
sled checkpoint ls|diff|restore|createTurn checkpoints of an agent's working tree.restore takes a safety checkpoint first; create --label
sled doctorChecks this machine or a remote one: core, socket, holders, PATH, agent CLIs and logins, git/gh/rg, language servers, disk, clock.--on, --json
sled stats [show]Tokens, cost and agent activity.--range (today, yesterday, 7d, 30d, month, lastMonth, all, <n>d), --by (model, provider, agent, account, space, machine, source, teammate, job), --limit, --on, --json
sled stats export / rescan / limitsWrites usage records to CSV or JSON / indexes local agent logs again / shows plan limits per account and how full each agent's context is.--format csv|json, --out; --full
sled topWhat uses CPU, memory and ports: by terminal, heaviest processes, Docker.--on, --limit 10, --no-docker, --json

sled run also accepts launch options for agents: --plan, --permission-mode default|acceptEdits|plan|bypass, --effort low|medium|high|xhigh and --model.

A typical session:

bash
sled run --bg --name tests -- npm test   # start in the background, return at once
sled ls                                  # find ids and names
sled read tests --lines 200              # read the last output
sled send t3 "Run the tests again"       # type into an agent and press Enter
sled wait t3 --timeout 600               # block until t3 changes state

If sled run hits its timeout, it prints "[sled] still running as tN after Ns; it keeps running…" and exits with 124. The program is not stopped.

Run programs without a terminal, and file commands

These commands don't create a terminal. They are useful in scripts and, with --on, on remote machines.

CommandWhat it doesFlags
sled exec -- cmdRuns one program, prints exactly what it wrote and exits with its code.--on, --cwd, --env k=v, --timeout 60, -i/--stdin, --json
sled file read <path>Prints a text file, or lines of it.--on, --offset, --limit
sled file write <path>Writes what is piped in as the file, creating missing folders.--on
sled file edit <path>Replaces exact text found once. Repeat --old/--new pairs; all edits apply or none do.--old, --new, --all, --on

sled file write replaces the whole file with what you pipe in.

bash
echo "PORT=3000" | sled file write --on vps /srv/app/.env.local

Use an absolute path for remote files. An unquoted ~ is expanded by your local shell to your Mac's home folder, not the remote one.

Agents and teams

CommandWhat it doesFlags
sled chat (alias agent)Chats with Sledbot's native coding agent in this terminal, or runs one prompt with --prompt.-p/--prompt, -m/--model, --plan, --cwd, --resume, --list, -v, --session, --via <command>
sled approve "why"Asks you for approval and blocks until you answer. Exit 0 allowed, 1 denied.--kind push|deploy|delete|publish|network|sudo|write|tool|other, --title, --command, --timeout, --json
sled ask "q"Asks you a question in Sledbot and blocks until you answer. Exit 0 answered, 1 declined, 2 expired.--option id or id=Label, --text, --body, --timeout, --json
sled notify "text"Posts to the activity feed and notifications.--level info|success|warning
sled memory read / append [text]Reads or appends to a teammate's memory (default: yours, else the shared TEAM.md).--teammate
sled routine ls / run <id> / logs <id>Lists routines, runs one now, shows its runs.--json
sled templatesLists role templates you can run with --as (from ~/.config/sledbot/templates). Built-ins: lead, reviewer, tester, fixer, docs, release.--json
sled job submit|ls|status|wait|followup|stop|collect|integrate|rmDelegated jobs: an agent working headless in its own copy of a project, here or on another machine.see below

sled job submit flags: --title, --on, --account, --agent claude|codex|gemini|opencode, --model, --effort, --project, --committed, --base, --allow, --permission-mode, --wait, --json. Use sled job integrate --dry-run to see what integrating would do before it writes anything.

sled approve and sled ask let a script or agent put a card in Needs you:

bash
sled approve "Push the release branch" --kind push --command "git push origin release/2.0"

Code and GitHub

CommandWhat it doesFlags
sled worktree info|create|setup|run|archiveCreates a worktree from a branch, a GitHub issue or a pull request, and runs the repo's setup, run and archive scripts.create: --branch / --issue N / --pr N, --base, --repo, --on, --no-setup, --prompt
sled pr status|create|merge|commentsPR, checks, review and mergeability for this branch / push the branch and open a PR / merge a PR / review threads.--method squash|merge|rebase, --delete-branch, --draft, --send <t>
sled thread archive|restore|lsStops the agent, keeps its worktree and a checkpoint ref, and runs the archive script / brings an archived thread back / lists archived threads.--no-script, --json
sled cleanFinds what can be cleaned up (worktrees, job copies, build folders, caches…) and moves it to the trash.--on, --category, --space, --id, --all-safe, --dry-run, -y/--yes, --delete, --delete-merged-branches, --gc, --refresh, --history, --json
  • sled pr needs the GitHub CLI (gh). sled pr merge run from an agent's terminal asks you first. sled pr comments --send <t> types the unresolved review threads into an agent.
  • Agents running in Sledbot terminals can scan with sled clean but can't clean. sled clean --delete deletes permanently instead of moving to the trash. Start with --dry-run.

Machines and the core

CommandWhat it doesFlags
sled machine add <target>Adds a machine you reach with ssh. Targets: vps, me@10.0.0.7, me@10.0.0.7:2222, [::1]:22, or an ssh-config Host.--name, --key, --jump, --policy ask|allow|never, --password-stdin, --generate-key, --store-secrets, --no-connect, --json
sled machine lsLists the machines added here.--json
sled machine login <name>Logs in with ssh in this terminal (password, code or host key), then reconnects.none
sled machine update <name>Copies this sled there and restarts its core. Its terminals keep running.none
sled machine rename <name> <new>Gives a machine a new name here.none
sled machine rm <name>Forgets a machine. Its terminals keep running there unless you pass --stop-agents.--stop-agents, --delete-remote-data
sled server start|stop|status|restartStarts the core / stops it / shows whether it runs, its version and features / restarts it (programs keep running).--session, --json
sled updateUpdates Sled Core and restarts it. Terminals keep running.--from <binary>
sled schemaPrints every core method with its parameter and result types (OpenRPC-style JSON).none
sled mcpServes the sled tools over MCP (stdio, JSON-RPC).none

sled server stop affects every terminal. Kept terminals get a shell on the next start. Use restart if you only want the core to pick up a new binary.

sled update without --from does not download anything. The app's own update supplies the new binary. After updating the app, run sled update or click Restart core in Settings ▸ General.

sled mcp is what Sledbot wires into supported agents at launch. See MCP integrations for its tools and which agents get it. Adding machines in the app is covered in Run agents on your own servers.

Verbs such as core, connect, hold, hook, askpass, skill and job render are internal. Don't call them yourself.

Agent-to-agent messaging

Agents start, message, wait for and read each other with the same commands you use: sled run, sled send, sled wait and sled read (or the matching MCP tools).

  • Messages are tagged. A sled send from inside a Sledbot terminal arrives wrapped as <sled from="t1 lead">text</sled>. It is pasted after the person at that terminal has paused typing for 600 ms.
  • Blocked terminals are protected. Sending to a terminal that needs you is refused with "<id> is blocked (<kind>); answer it first or use --force …" (exit 9). --force sends anyway.
  • Conditional sends. sled send --if idle only sends when the target is idle; a mismatch exits with 10.
  • Parents and children. A terminal started from a Sledbot terminal is its child and ends when the parent ends, unless you pass --outlive-parent or --no-parent. sled wait --children any (or all) waits on them.
  • Notes typed into the parent (local parents only):
    • <sled>t3 reviewer is blocked (permission). See: sled read t3</sled>
    • <sled>t3 x hit an error: …. See: sled read t3</sled>
    • <sled>t3 x exited (exit 0). Read: sled read t3</sled>

Agents inside Sledbot terminals can't make person-only core calls, such as secrets, approval rules or machines. Messages between agents only show inside the terminals; there is no separate feed.

Environment variables in every terminal

VariableMeaning
SLED_TERMINAL_IDThis terminal's id
SLED_SOCKETThe core socket
SLED_MACHINEThe machine it runs on
SLED_SESSIONThe core session (default default)
TERM, COLORTERMxterm-256color, truecolor
PATHHas sled first
SLED_TEAMMATE, SLED_THREAD, SLED_ROUTINEAdded in teammate threads
SLED_JOBAdded in delegated jobs

Worktree terminals also get SLED_PORT (plus SLED_PORT_1 to SLED_PORT_9), SLED_WORKTREE, SLED_ROOT, SLED_BRANCH and SLED_CONTEXT.

Variables you can set to change core behavior: SLED_NO_RESUME=1 (no resume after restart), SLED_NO_CHECKPOINTS=1, SLED_NO_NETWORK=1 (no model catalogue refresh), SLED_CHAT_MODEL (default model for sled chat) and SLED_GITHUB_HOSTS (GitHub Enterprise hosts).

Exit codes

CodeMeaning
0OK, including a sled wait check-in
1Error, or denied (approve) / declined (ask)
2sled ask expired
3Not found, e.g. "No terminal named "<x>". Use sled ls to see ids and names."
9Target is blocked
10sled send --if mismatch, or a sled job integrate conflict
124sled run or sled job wait timed out; the program is still running
otherThe program's own exit code

Features only in the CLI

Turn checkpoints

At the end of every agent turn in a git work tree, Sled Core snapshots the working tree into private refs refs/sled/checkpoints/<t>/<turn>. Your index and HEAD are not touched. The last 50 are kept.

Use sled checkpoint ls to list them, diff to compare, create (with --label) to make one by hand, and restore to go back. restore changes files in the working tree, but it first takes a safety-… checkpoint you can restore to undo it. There is no checkpoint view in the app.

To turn checkpoints off, set SLED_NO_CHECKPOINTS=1, label a terminal sled.checkpoints=off (for example with sled label t3 sled.checkpoints=off), or set {"checkpoints": false} in the settings/agents doc.

Explain a status

sled explain <t> shows why a terminal shows working, blocked, done and so on: which source decided it (escape sequences, agent hooks or screen heuristics), the last 10 signals, and the screen it judged. Use it when an agent seems stuck in the wrong state. Add --json for scripts.

Rename a machine

The app can't rename a remote machine. Use sled machine rename <name> <new>.

Troubleshooting

  • "Sled Core is not running (<socket>). Start it with sled server start." Run that command, or click Restart core in Settings ▸ General.
  • "This core does not support that yet (<method>). Try sled update." The CLI is newer than the running core. Run sled update.
  • command not found: sled in Terminal. You haven't installed it for other terminals, or ~/.local/bin isn't on your PATH. See Install the sled CLI for other terminals.
  • sled doctor suggests sled machine connect <m>. That subcommand doesn't exist. Use sled machine login <m> or Connect in the app.
  • A send exits with 9. The target needs you. Answer it in Needs you, or use --force if you mean to interrupt.

More fixes are in Troubleshooting Sledbot.

Every app.
One purchase.