2.4.1-beta.1) — updated automatically on every beta release.Switch to stable →CLI commands
ak uninstall
Remove an AK-managed project
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.
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.
Usage
ak uninstall [path] [flags]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 planFlags
| Flag | Description |
|---|---|
--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 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) |
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 |
Related commands
ak— AgentKit CLI