Command reference
Every command and flag, exit codes, environment variables.
Every command accepts --plain (no colors, no animations, one timestamped line per event), -h/--help and -V/--version.
caffeine run
caffeine run <pipeline> [targets...] [--all] [-n/--dry-run] [-q/--quiet]| Form | Runs on |
|---|---|
caffeine run p | the current folder |
caffeine run p site api | the targets site and api from workspace.yaml |
caffeine run p . or caffeine run p ~/code/site | that folder, in place |
caffeine run p --all | every target whose pipelines lists p |
| Flag | Effect |
|---|---|
-n, --dry-run | Everything runs except commit, push and pull request (caffeine pr does nothing), and {{last_run}} does not move. The diff is in the run's logs. In a folder run in place, the files are still changed: use a named git target for a run that leaves your checkout untouched. |
-q, --quiet | Hide agent text and tool calls, keep steps, checks and results. |
--all | Every target that lists the pipeline. Cannot be combined with target names. |
Up to max_parallel targets run at the same time. In a terminal, each target gets a live progress line, and a receipt sums up the run at the end: cost, duration, pull requests, and where the logs are.
A folder (the current one, . or a path) that is a declared target is run as that target, in place: same name, same context, same {{last_run}} history. A folder matches a target when it is the target's dir:, or when one of its git remotes points to the target's git: repo, whatever the spelling ([email protected]:me/site.git, https://github.com/me/site, ssh://[email protected]:22/me/site.git…). A folder that matches two targets is refused: name the one you want. A name declared in workspace.yaml always wins over a folder with the same name.
caffeine runs
caffeine runs [-n/--limit 15]Recent runs, newest first: status (✔ ok, ⏭ nothing to do, ✘ failed), time, pipeline, target, cost, duration, and the pull request or the error.
caffeine list
caffeine list [pipelines|targets|sessions|models] [--pipeline <name>]pipelines(default): steps, which targets use each one, description. A pipeline that fails to load is shown in red with the reason.targets: kind (git,dir,scratch) and pipelines.--pipeline pkeeps only the targets that usep.sessions: open work sessions.models: model roles and their runner.
caffeine init
Creates the home (~/.caffeine or $CAFFEINE_HOME) with a commented config.yaml and workspace.yaml, prompts/rules.md, and an example pipeline hello. Existing files are never overwritten.
caffeine doctor
Checks the home, config.yaml, workspace.yaml, git, gh and its login, the Claude Code CLI, the API key variables of the model roles (api_key_env, and ANTHROPIC_API_KEY for auth: api_key), the cache store (writable, and whether copies share blocks), each sandbox's engine binary and image (present, or pullable: nothing is pulled), the Claude Code CLI in it and its login when a claude step runs there (for kubernetes: the context answers, you may create pods, exec, Secrets and network policies, and the Cilium API and hubble CLI when set), every pipeline (loaded and validated like a run would), and that every pipeline a target lists exists. Exits 1 when something is broken. Warnings (!) don't fail it.
caffeine open / close
caffeine open <target> [--no-shell]
caffeine close [<target>] [--force]A work session is a full clone of a git target in ~/.caffeine/work/<target>, for working by hand next to the pipelines. Runs never touch it.
openclones (or resumes an open session) and starts your$SHELLin it.exitleaves the shell and keeps the session.--no-shellclones and prints the path.closedeletes the clone. It is refused when deleting it would lose work: changed or untracked files, commits never pushed, or stashes.--forcedeletes anyway. Without a target, it lists the open sessions.
caffeine changed
caffeine changedInside a run, lists the files the run changed so far, one per line, compared with a snapshot taken when the run started. Work that was already in the folder (uncommitted edits, untracked files) never shows up. Use it in your check scripts instead of git diff HEAD. Outside a run, it falls back to git: changes since HEAD plus untracked files.
caffeine scope
caffeine scope <glob>...For verify:. Exits 1 and lists the offending files when the run changed a file outside the globs. See Pipelines.
caffeine pr
caffeine pr [--auto-merge] [--title <title>]For the last step of a pipeline on git targets: commits, pushes to the target's git: URL (not the clone's origin, which a step could change) and opens or updates the pull request on that repository (gh … --repo). The default title is [<pipeline>] <date>. See Pipelines. Refused in a podman, docker or bwrap sandbox; on kubernetes, only the last step, which alone gets the token (Pull requests from a pod).
caffeine completions
caffeine completions zsh > "${fpath[1]}/_caffeine"
caffeine completions bash > ~/.local/share/bash-completion/completions/caffeine
caffeine completions fish > ~/.config/fish/completions/caffeine.fishThe zsh completion is dynamic: caffeine run <Tab> lists your pipelines, then the targets that use the chosen pipeline. open lists targets and close lists open sessions. Bash and fish complete commands and flags.
caffeine stats
caffeine stats [-d/--days 30] [--no-gh]Runs, cost, cost per useful run and duration per pipeline; steps, cost and fallback rate per model role; and with gh, what became of the pull requests. See Automation.
caffeine inbox / approve / reject
caffeine inbox [<id>] [--all]
caffeine approve <id> [--only a1,a3] [-q]
caffeine reject <id> [reason...]What waits for your decision, and the decision. See Inbox.
caffeine gate
caffeine gate changed <url> | --cmd "<command>" [--key <name>]
caffeine gate release <owner/repo>
caffeine gate cargo
caffeine gate npmFirst steps that exit 78 when there is nothing to do. See Automation.
caffeine check
caffeine check urls <file>... [--strict]
caffeine check json <file>...
caffeine check unchanged <glob>...
caffeine check actions [file]
caffeine check smoke --start "<cmd>" --url <base> <route>... [--save] [--status-only] [--wait 120] [--baseline <file>]
caffeine check deployed <url> [--status 200] [--contains <text>] [--wait 600] [--interval 15]Checks for verify:. See Pipelines.
caffeine feedback / digest / gc
caffeine feedback [<pipeline> <reason...>] [--target <t>] [--pr <url>] [-d 30]
caffeine digest [-d/--days 7] [-o/--out <file>]
caffeine gc [-d/--days 90] [--keep-summaries] [-n/--dry-run]
caffeine cache ls
caffeine cache rm <pipeline> [--target <t>] [--key <k>] [--memory]Notes on what you edited or rejected, a Markdown digest of the period, and housekeeping: old runs, the pipelines' caches, and containers or pods left by sandboxed runs. See Automation.
caffeine pack
caffeine pack add <git url or folder> [--name <n>] [--subdir <dir>]
caffeine pack list | update [<name>] | remove <name>See Packs.
caffeine mcp
caffeine mcp [--read-only] [--allow-decisions]See MCP server.
caffeine schedule
caffeine schedule list | install [--no-load] | remove [--no-load] | cronSee Automation.
caffeine secret
caffeine secret set <NAME>
caffeine secret delete <NAME>macOS keychain entries for keychain_env. See Automation.
Exit codes
| Code | Meaning |
|---|---|
0 | Success. For run: every target ok or skipped. |
1 | Error before or outside the run (bad config, unknown pipeline…), doctor found a problem, close refused, scope found files out of bounds. |
2 | run: at least one target failed. approve: the apply run failed. |
78 | gate: nothing to do (the pipeline stops as a success). |
130 | run: interrupted by Ctrl-C or SIGTERM. |
Environment variables
| Variable | Effect |
|---|---|
CAFFEINE_HOME | The home folder. Default ~/.caffeine. |
CAFFEINE_CLAUDE_BIN | Claude Code CLI to use. Wins over claude_bin. |
CAFFEINE_NO_ANIM=1 | No animations, colors kept. |
NO_COLOR | No colors and no animations. |
CAFFEINE_LAUNCHD_DIR | Where caffeine schedule writes LaunchAgents. Default ~/Library/LaunchAgents. |
CLAUDE_CODE_OAUTH_TOKEN | Passed to the claude runner. When set, ANTHROPIC_API_KEY is removed from its environment. |
Output is plain automatically when stdout is not a terminal or TERM=dumb.
Environment variables for steps
run: steps, verify: commands and the cmd runner get:
| Variable | Value |
|---|---|
CAFFEINE_HOME | The home folder. |
CAFFEINE_PIPELINE | Pipeline name. |
CAFFEINE_TARGET | Target name. |
CAFFEINE_TODAY | Run date, YYYY-MM-DD. |
CAFFEINE_LOGDIR | This run's log folder. |
CAFFEINE_DRY_RUN | 1 in a dry run, empty otherwise. |
CAFFEINE_BASE | Commit the workspace started from (git workspaces). |
CAFFEINE_BRANCH | The run's branch (git targets only). |
CAFFEINE_GIT | The target's git: URL, where caffeine pr pushes (git targets only). |
CAFFEINE_WORKDIR | The workspace folder (clone, folder or scratch). |
CAFFEINE_SNAPSHOT | The snapshot taken at the start of the run, read by caffeine changed and caffeine scope. |
The folder of the running caffeine binary is put first on PATH, so caffeine scope and caffeine pr inside steps use the same version.