CLI commands
ak recover
Recover AgentKit state from a snapshot
ak recover
Recover AgentKit state from a snapshot
Synopsis
What it does:
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.
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 result
What changes on disk: Overwrites files under ~/.claude/plugins/ and ~/.agentkit/skills/ to match the snapshot.
Output modes: pretty default on TTY (colors, ASCII markers) plain auto when stdout piped or --no-interactive json --json (single-object envelope, NDJSON-safe)
Exit codes: 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
ak recover [id] [flags]Options
--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 promptsSEE ALSO
- ak - AgentKit CLI