Developer docs · v0.2

CLI & Overlay 0.2.0 · Schema 23step.run/v4 /docs/cli.md

The 23step CLI

23step is one static binary for macOS (arm64, amd64) and Linux (amd64, arm64). It runs the capture daemon, talks to it over a 0600 socket in its state directory, reconciles local agent transcripts, and updates itself. Install it with the installer.

Commands

23step <command>
CommandWhat it does
startStart the capture daemon and create a run. Exits with an error if one is already running in the same state directory.
stopUpload anything queued, finalize the run, and stop the daemon.
statusPrint the daemon state, run_id, step_url, and captured / uploaded / failed counts. Exit code 1 and 23step is not running when no daemon is up.
finalizeClose the open run (--prompt TEXT seeds the next one) and keep the daemon running. Prints finalized, or no open run.
note TEXTAttach an agent note (at most 500 characters) to the latest frame of the running step. Prints queued.
feedbackFetch review comments and pins that people left on the running step, so an agent can react mid-run.
reconcileSync local Claude Code, Cursor, Antigravity, and Grok Bot sessions with the server, closing runs whose hooks never fired.
loginSign in via browser OAuth 2.1 PKCE (/oauth/cli-key) and save a revocable runs:write key to ~/.config/23step-otel-key (mode 0600).
updateDownload and install the latest release now (SHA-256 verified).
versionPrint the version. --json adds build metadata.

API key and server

The CLI never takes a key as an argument. start reads it from STEP23_TOKEN or --token-file PATH; the file must be mode 600 and the key at least 16 characters. Use a key with the runs:write scope, created on Account.

reconcile also looks at STEP23_OTEL_KEY, STEP23_OTEL_KEY_FILE, ~/.config/23step-otel-key, and ~/.config/23step/token, in that order, so it works with the key the hooks already use.

Set the server with --api or STEP23_API (https://api.23step.com). The state directory defaults to $XDG_DATA_HOME/23step or ~/.local/share/23step; pass --state-dir to run more than one daemon at a time.

23step start

On an X11 display the daemon takes a full-screen frame on each click and typing burst. Key presses are classified (letter, digit, enter, …) and never stored. With --headless it captures Chrome through the DevTools Protocol instead and needs no display. It only ever connects to DevTools on 127.0.0.1 or localhost.

Terminal headless Chrome
export STEP23_API=https://api.23step.com
nohup 23step start --headless --cdp http://127.0.0.1:9222 \
  --token-file ~/.config/23step-otel-key \
  --run-name checkout-test --prompt "Verify the checkout total" > /tmp/23step.log 2>&1 &
sleep 1 && 23step status
23step start flags
FlagEnvDefaultMeaning
--api URLSTEP23_APIAPI base URL.
--token-file PATHSTEP23_TOKENFile holding the runs:write key.
--run-name NAMELabel stored with the run.
--prompt TEXTSTEP23_PROMPTThe user prompt that started the run. Redacted and capped at 16 KB.
--session IDSTEP23_SESSIONAgent conversation id. Successive prompts in one session chain together.
--join-sessionoffAttach to the open run in ~/.local/share/23step/current.json or to an open run for --session instead of making a second run.
--run-id IDSTEP23_RUN_IDAttach directly to a specific open run id.
--previous-step IDSTEP23_PREVIOUS_STEPEarlier run id in this conversation.
--backgroundSTEP23_BACKGROUNDoffMark the run as a background task.
--background-kind KINDSTEP23_BACKGROUND_KINDcommand, subagent, schedule, workflow, or swarm.
--hostname NAMESTEP23_HOSTNAMEdetectedMachine name shown on the run.
--headlessSTEP23_HEADLESSoffCapture Chrome over DevTools instead of X11.
--cdp URLSTEP23_CDP_URLdiscoveredLoopback DevTools base URL, e.g. http://127.0.0.1:9222.
--no-urlsoffDo not record the active tab URL on frames.
--no-cdp-inputoffDo not capture clicks and keys through DevTools.
--debounce D400msTyping burst window: one frame per burst.
--settle D300msExtra frame after a click or burst. 0 turns it off.
--max-duration D0 (off)Stop on its own after this long.
--scale N1Scale sent with the screen size.
--state-dir PATHsee abovepid, status, socket, and retry queue.

23step status

Output 23step status
state: running
pid: 41822
run_id: 6f0c2a7e-5d1b-4c39-9a51-0b7f3f8e2c11
hostname: build-vm-3
step_url: https://app.23step.com/s/<share_id>
sign in to view
captured: 14
uploaded: 14
failed: 0

Notes and live feedback

23step note lets an agent explain a frame while it works. 23step feedback is the other direction: when someone comments on a running step or pins a spot on a frame, the item is waiting for the agent. The hooks call it for you and add the comment to the agent's context on the next tool call; your own scripts can poll it the same way.

feedback prints JSON by default and marks the items it returns as seen. --peek leaves them unseen; --json=false prints one line per item.

Terminal
23step note "Checkout total verified at $42.10"
23step feedback --peek
Output 23step feedback
{
  "run_id": "6f0c2a7e-5d1b-4c39-9a51-0b7f3f8e2c11",
  "step_url": "https://app.23step.com/s/<share_id>",
  "items": [
    { "id": "c_19", "kind": "pin", "frame_kind": "image", "seq": 7, "x": 0.62, "y": 0.41,
      "comment": "This total should include tax", "author": "maria@example.com" }
  ]
}

23step reconcile

Hooks can miss a turn: the agent was killed, the laptop slept, or a turn went idle without a stop event. reconcile reads the local session stores and makes the server match them. The hooks start 23step reconcile --watch --idle-exit 15m in the background, and the desktop overlay runs it every 20 seconds. Set STEP23_DISABLE_RECONCILER=1 to turn that off.

23step reconcile flags
FlagDefaultMeaning
--api URLSTEP23_APIAPI base URL.
--token-file PATHKey file; see the lookup order above.
--watchoffKeep running and poll.
--interval D15sPoll interval with --watch.
--idle-exit D0 (never)Exit after this long with nothing to do.
--lookback D20mHow far back to look on the first run.
--hostname NAMEdetectedMachine name.
--state-dir PATHLock and cursor files.
--jsonoffPrint the pass statistics as JSON.

23step login

23step login starts a temporary loopback callback server, opens the 23step OAuth 2.1 PKCE consent screen in your browser, exchanges the single-use authorization code at POST /oauth/cli-key for a revocable st_ key, and saves it atomically with mode 0600 to ~/.config/23step-otel-key (or ~/.config/23step-dev-key when --dev is set).

Pass --status to verify that a configured key is accepted by POST /v1/traces without printing the secret, or --no-browser on remote/headless machines to print the login URL without launching a browser.

Terminal
23step login
23step login --status

Updates

Release builds check https://api.23step.com/dist/manifest.json in the background at most every 15 minutes and install a newer version on their own. Every download is checked against its SHA-256. 23step update --check only reports; 23step update installs now.

Update settings
EnvMeaning
STEP23_AUTO_UPDATE0 turns background updates off; 1 forces them on.
STEP23_UPDATE_CHECK_INTERVALHow often to check, as a Go duration (default 15m).
STEP23_UPDATE_URLWhere to read the manifest from instead of STEP23_API.