AgentKit
ReferenceCLI commands

CLI commands

ak backups restore

Restore AgentKit state from a snapshot

ak backups restore

Restore AgentKit state from a snapshot

Synopsis

What it does: Replay every file in the snapshot's manifest back to its original on-host path. Replace-only: files added under the snapshotted scope AFTER the snapshot are NOT deleted. Manifest is verified end-to-end BEFORE any live file is touched.

Who it's for: Power devs rolling back a bad migration; CI guardrails.

When to use it: After a failed update / migration; or to recover a known-good prior state.

Examples: ak backups restore 20260426T123005Z-deadbeef # asks confirmation on TTY ak backups restore 20260426T123005Z-deadbeef --yes # CI-friendly ak backups restore 20260426T123005Z-deadbeef --json # machine envelope ak backups restore --latest # restore the newest snapshot ak backups restore --latest --yes # CI-friendly latest restore

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 backups restore [id] [flags]

Options

      --dry-run          Print the restore plan without modifying live files
  -h, --help             help for restore
      --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

SEE ALSO

On this page