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 migrate rollback
Roll back a failed migration to its pre-apply state
Restore the migration target to its pre-apply state using the most recent rollback journal written by a failed ak migrate apply. A failed apply is resumable by default; use rollback to undo it instead.
Who it's for: Anyone recovering from a failed or unwanted migration apply.
When to use it: After ak migrate --dry-run=false failed or produced an unwanted result.
What changes on disk: Restores files recorded in the rollback journal; removes the journal on success.
Usage
ak migrate rollback [flags]Examples
ak migrate rollbackFlags
| Flag | Description |
|---|---|
-h, --help | help for rollback |
--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 migrate— Migrate an existing ClaudeKit install to AgentKit