Skip to content
Apothem
CLI reference

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

OptionDescription
--harness NAMEHarness adapter to roll back, or all for the registry-wide set (required).
--install-id ULIDRoll back the named install pass. Defaults to the latest recorded install.
--lastRoll back the latest recorded install (the default; the explicit form). Mutually exclusive with --install-id.
--yesSkip the per-harness confirmation prompt.
--project PATHProject root for project-scope harnesses. Required when the selected set includes project-scope adapters.
--quiet, -qSuppress informational output; only errors are emitted.
--verbose, -vEmit additional diagnostic output.
--format plain|jsonOutput format (default: plain).
--jsonShorthand for --format json.
--no-colorDisable ANSI color codes in output.
-h, --helpShow 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 --json

Exit codes

CodeMeaning
0Rolled back successfully, or nothing to restore (the install captured no backups)
1Expected error — no install record, conflicting selectors, unknown harness, missing project root, or confirmation declined or unavailable (non-interactive or JSON mode without --yes)
2Partial restore after at least one target was rolled back

See also

On this page