AgentKit
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 backups restore

Restore AgentKit state from a snapshot

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.

What changes on disk: Overwrites files under ~/.claude/plugins/ and ~/.agentkit/skills/ to match the snapshot.

Usage

ak backups restore [id] [flags]

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

Flags

FlagDescription
--dry-runPrint the restore plan without modifying live files
-h, --helphelp for restore
--jsonEmit machine-readable JSON (implies --no-interactive)
--latestRestore the most recently created snapshot (mutually exclusive with positional <id>)
--no-interactiveDisable interactive prompts (CI-safe)
-q, --quietSuppress non-error output on stderr
-V, --verboseExtra diagnostic output on stderr (loses to --quiet)
-y, --yesAssume yes for all prompts

Output modes

ModeBehavior
prettydefault on TTY (colors, ASCII markers)
plainauto when stdout piped or --no-interactive
json--json (single-object envelope, NDJSON-safe)

Exit codes

CodeMeaning
0success
1runtime error
2invalid flags
3user-cancel (SIGINT, prompt-cancel)
3user declined the confirmation prompt
4another ak backups operation already holds the lock
5snapshot id not found or no snapshots exist

On this page