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
Manage rollback snapshots
Inspect and manage AgentKit rollback snapshots stored under ~/.agentkit/backups/. Each snapshot captures the project registry, kit plugin install dirs, and per-skill envs at a single point in time.
Who it's for: Power devs recovering from a bad migration; non-technical users via the matching dashboard surface.
When to use it: Snapshots are produced automatically before mutating commands (ak update, ak uninstall, ak migrate) once those epics ship; today they are also producible by future tooling that calls into this package directly.
What changes on disk: Read-only at this group level; subcommands document their own effects under ~/.agentkit/backups/.
Examples
ak backups list # newest-first listing
ak backups list --json # script-friendly envelope
ak backups show <id> # manifest detail
ak backups verify <id> # integrity check (ok | corrupt)
ak backups restore <id> # roll state back to snapshot
ak backups prune --older-than 30d # delete snapshots > 30 days
ak backups prune --keep-last 5 # retain the 5 newest
ak backups prune --older-than 30d --dry-run # preview the deletion planFlags
| Flag | Description |
|---|---|
-h, --help | help for backups |
--json | Emit machine-readable JSON (implies --no-interactive) |
--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) |
Related commands
ak— AgentKit CLIak backups list— List all rollback snapshots (newest first)ak backups prune— Delete snapshots older than a threshold or beyond a retention countak backups restore— Restore AgentKit state from a snapshotak backups show— Print the manifest of a single snapshotak backups verify— Recompute manifest hashes and report ok | corrupt