Getting started
Install, first run, first pipeline.
1. Install
On Linux, install the getcaffeine package from pkg.getcaffeine.dev (amd64 and arm64, glibc 2.34 or later: Debian 12, Ubuntu 22.04, Fedora, RHEL / Rocky 9, openSUSE and later). The package is named getcaffeine; the command stays caffeine.
Debian, Ubuntu (add the repository once per machine):
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://pkg.getcaffeine.dev/caffeine.asc -o /etc/apt/keyrings/caffeine.asc
sudo tee /etc/apt/sources.list.d/caffeine.sources >/dev/null <<'EOF'
Types: deb
URIs: https://pkg.getcaffeine.dev
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/caffeine.asc
EOF
sudo apt-get update && sudo apt-get install getcaffeineFedora, RHEL, Rocky, Alma:
sudo curl -fsSL https://pkg.getcaffeine.dev/rpm/caffeine.repo -o /etc/yum.repos.d/caffeine.repo
sudo dnf install getcaffeineopenSUSE:
sudo zypper addrepo https://pkg.getcaffeine.dev/rpm/caffeine.repo
sudo zypper install getcaffeineAccept the signing key when its fingerprint is B5D8 8D77 5DDE 5288 E98F 1765 DF85 BEF8 5C41 6DB0. Pin a version with getcaffeine=0.5.0-1 (apt) or getcaffeine-0.5.0-1 (dnf).
Debian, Ubuntu and openSUSE already ship an unrelated caffeine package (a screen-idle inhibitor) that also installs /usr/bin/caffeine: getcaffeine conflicts with it, so installing one removes the other. The packages install the zsh completion; for bash or fish, see caffeine completions.
What else you need depends on what your pipelines use:
| Tool | Needed for |
|---|---|
git | always |
Claude Code CLI (claude), logged in | steps that use the claude runner |
GitHub CLI (gh), logged in | caffeine pr |
| An OpenAI-compatible endpoint | steps that use the llm runner |
podman or docker, bwrap (Linux), or kubectl and a cluster (from Linux) | pipelines that run in a sandbox |
If claude is not on your PATH, set claude_bin in config.yaml or the CAFFEINE_CLAUDE_BIN environment variable.
2. Create your home
caffeine initThis creates ~/.caffeine (or $CAFFEINE_HOME) without overwriting anything:
~/.caffeine/
config.yaml model roles, MCP servers, guard
workspace.yaml targets: your repos and folders
prompts/rules.md appended to every agent's system prompt
pipelines/hello.yaml an example pipeline
prompts/hello/02-describe.md its prompt
checks/ your own check scriptsThen check everything:
caffeine doctor3. First run
Go into any project and run the example:
cd ~/code/some-project
caffeine run hellohello has two steps. A script lists the files into .agent/FILES.txt, then an agent (role cheap) reads a few of them and writes .agent/REPORT.md. verify: test -s .agent/REPORT.md fails the step if the report is empty.
Without a target, caffeine run works in the current folder. .agent/ is the scratch space shared between steps: caffeine copies it into the run's log folder and deletes it at the end.
caffeine runs # the run you just did
ls ~/.caffeine/runs/$(date +%F)/hello/*/*/ # its logs, REPORT.md and summary.json4. Your own pipeline
A pipeline is a YAML file in ~/.caffeine/pipelines/. The file name is the pipeline name.
# ~/.caffeine/pipelines/deps.yaml
description: "Update dependencies, keep the build green"
steps:
- name: 01-gate # free: stop here when there is nothing to do
run: cargo update --dry-run 2>&1 | grep -qE "Updating [^ ]+ v[0-9]" || { echo "dependencies up to date"; exit 78; }
- name: 02-update
prompt: prompts/deps/update.md
model: cheap
fallback: smart # retried with a stronger model if verify fails
max_turns: 40
allowed_tools: [Read, Edit, Grep, "Bash(cargo update*)", "Bash(cargo build*)", "Bash(cargo test*)"]
verify: caffeine scope Cargo.toml Cargo.lock && cargo build -q && cargo test -qExit code 78 means "nothing to do": the pipeline stops and counts as a success. See Pipelines.
5. Run it on repos
Declare your repos as targets in workspace.yaml:
# ~/.caffeine/workspace.yaml
targets:
- name: my-api
git: [email protected]:me/my-api.git
pipelines: [deps]Add a last step that opens a pull request:
- name: 99-pr
run: caffeine prThen:
caffeine run deps --all -n # dry run: everything except commit, push and PR
caffeine run deps --allEach git target is cloned fresh into ~/.caffeine/app/, worked on in a branch, and deleted at the end. Your own checkout is never touched.
Next
- Configuration: model roles, MCP servers, per-project
.caffeine.conf - Runners: mix Claude, a local model and other agent CLIs
- Safety: what the guard, the allowlist, sandboxes and
network:protect - Pipelines: caches between runs, review steps that fix, skills, sandboxes