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 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 rollback

Flags

FlagDescription
-h, --helphelp for rollback
--jsonEmit machine-readable JSON (implies --no-interactive)
--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)
  • ak migrate — Migrate an existing ClaudeKit install to AgentKit

On this page