ReferenceCLI commands
BetaYou are reading docs for the beta channel (
2.4.1-beta.1) — updated automatically on every beta release.Switch to stable →CLI commands
ak recover
Recover AgentKit state from a snapshot
Replay every file in a rollback snapshot back to its original on-host path. Top-level alias for ak backups restore so scripts, docs, and dashboard guidance can use the product verb without a separate recovery path. Manifest is verified end-to-end before any live file is touched.
Who it's for: Both: non-technical users recovering from a bad install, and power devs rolling back in CI.
When to use it: After a failed update or migration, or when you need to roll back to a known-good prior state.
What changes on disk: Overwrites files under ~/.claude/plugins/ and ~/.agentkit/skills/ to match the snapshot.
Usage
ak recover [id] [flags]Examples
ak recover --latest # restore the newest snapshot
ak recover --latest --yes # CI-friendly, skip confirmation
ak recover 20260426T123005Z-deadbeef --dry-run # preview the restore plan
ak recover 20260426T123005Z-deadbeef --json # machine-readable resultFlags
| Flag | Description |
|---|---|
--dry-run | Print the restore plan without modifying live files |
-h, --help | help for recover |
--json | Emit machine-readable JSON (implies --no-interactive) |
--latest | Restore the most recently created snapshot (mutually exclusive with positional <id>) |
--no-interactive | Disable interactive prompts (CI-safe) |
-q, --quiet | Suppress non-error output on stderr |
-V, --verbose | Extra diagnostic output on stderr (loses to --quiet) |
-y, --yes | Assume yes for all prompts |
Output modes
| Mode | Behavior |
|---|---|
pretty | default on TTY (colors, ASCII markers) |
plain | auto when stdout piped or --no-interactive |
json | --json (single-object envelope, NDJSON-safe) |
Exit codes
| Code | Meaning |
|---|---|
0 | success |
1 | runtime error |
2 | invalid flags |
3 | user-cancel (SIGINT, prompt-cancel) |
3 | user declined the confirmation prompt |
4 | another ak backups operation already holds the lock |
5 | snapshot id not found or no snapshots exist |
Related commands
ak— AgentKit CLI