CLI commands
ak uninstall
Remove an AK-managed project
ak uninstall
Remove an AK-managed project
Synopsis
What it does: Ownership-aware project removal. For each file in the manifest: clean (AK-owned, hash matches) -> deleted modified (user has edited) -> refused unless --force orphan (in dir, not in manifest) -> reported only, never deleted missing (in manifest, gone) -> skipped
A snapshot is taken via ak backups BEFORE any deletion, even with --force.
Default behaviour is dry-run: pass --yes or confirm the prompt to execute.
Who it's for: Both: power devs (--yes --json) and non-tech users (interactive prompt).
When to use it:
Removing a project that AK bootstrapped with ak new.
Examples: ak uninstall # dry-run from cwd ak uninstall ./myproj # dry-run for explicit path ak uninstall --yes # execute without prompt ak uninstall --force --yes # delete even user-modified files ak uninstall --dry-run --json # machine-readable plan
What changes on disk:
Deletes AK-owned files from the project directory and removes .agentkit/ownership.json (and .agentkit/ if empty). Snapshots prior state via ak backups before any deletion.
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) 1 project directory not found or not an AK project 2 invalid flags or arguments 3 user declined confirmation prompt or --dry-run 6 user-modified files detected without --force
ak uninstall [path] [flags]Options
--dry-run Show classification plan without deleting anything (exit 3)
--force Delete user-modified files (requires confirmation; snapshot always taken)
-h, --help help for uninstall
--json Emit machine-readable JSON (implies --no-interactive)
--keep-registry Skip deregistration from ~/.agentkit/projects.json after uninstall
--no-interactive Disable interactive prompts (CI-safe)
--project-dir string Explicit project root (default: cwd or first AK project found walking up)
-q, --quiet Suppress non-error output on stderr
-V, --verbose Extra diagnostic output on stderr (loses to --quiet)
-y, --yes Assume yes for all promptsSEE ALSO
- ak - AgentKit CLI