rollback
CLI reference for the apothem rollback command.
Restore a harness to the state before its recorded install.
Synopsis
apothem rollback --harness NAME|all [--install-id ULID | --last] [--yes]
[--project PATH]
[--quiet|-q] [--verbose|-v]
[--format plain|json] [--json] [--no-color]rollback reconstructs each selected harness's pre-install bytes from the
Apothem backup root. It resolves the recorded install pass — the latest by
default, or the one named by --install-id — restores every backup that
install captured, then appends a rollback record to the harness ledger.
Confirmation is prompted per harness unless --yes is supplied. When no
prompt is possible — --format json (prompt text would corrupt the single
JSON document) or a non-interactive shell (no TTY) — the command refuses up
front with a structured rollback.confirmation_required error (exit 1)
unless --yes is supplied. --install-id and --last select the install
pass and are mutually exclusive.
A --harness all rollback is deliberately exhaustive: it covers every
registered harness, including any the profile's exclude_harnesses skips
during install — restoring pre-install state is a cleanup operation, so it
reaches records a previously broader install may have left. Harnesses with
no recorded install report a per-harness "nothing to roll back".
Options
| Option | Description |
|---|---|
--harness NAME | Harness adapter to roll back, or all for the registry-wide set (required). |
--install-id ULID | Roll back the named install pass. Defaults to the latest recorded install. |
--last | Roll back the latest recorded install (the default; the explicit form). Mutually exclusive with --install-id. |
--yes | Skip the per-harness confirmation prompt. |
--project PATH | Project root for project-scope harnesses. Required when the selected set includes project-scope adapters. |
--quiet, -q | Suppress informational output; only errors are emitted. |
--verbose, -v | Emit additional diagnostic output. |
--format plain|json | Output format (default: plain). |
--json | Shorthand for --format json. |
--no-color | Disable ANSI color codes in output. |
-h, --help | Show help and exit. |
JSON output
{
"status": "success",
"command": "rollback",
"action": "rolled_back",
"harness": "claude-code",
"profile_path": null,
"project": null,
"files_written": [],
"results": [],
"warnings": [],
"error": null,
"output_path": "C:\\Users\\Example\\.claude\\settings.json"
}Each restored target appears in results with "operation": "rollback" and
an outcome of created or updated (and in files_written). A target the
install created fresh — with no prior bytes to restore — is reported with
"outcome": "skipped"; a failed restore is "outcome": "error". When no
matching install record exists, the command reports a rollback.no_record
error with "status": "error".
Examples
apothem rollback --harness claude-code --last
apothem rollback --harness claude-code --install-id 01J9Z… --yes
apothem rollback --harness cursor --project . --last --jsonExit codes
| Code | Meaning |
|---|---|
| 0 | Rolled back successfully, or nothing to restore (the install captured no backups) |
| 1 | Expected error — no install record, conflicting selectors, unknown harness, missing project root, or confirmation declined or unavailable (non-interactive or JSON mode without --yes) |
| 2 | Partial restore after at least one target was rolled back |
See also
- apothem install — install a harness configuration
- apothem update — re-install from the current shared profile
- apothem uninstall — remove a harness configuration
- apothem status — report install, verify, and drift state