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

Flags

FlagDescription
--dry-runShow classification plan without deleting anything (exit 3)
--forceDelete user-modified files (requires confirmation; snapshot always taken)
-h, --helphelp for uninstall
--jsonEmit machine-readable JSON (implies --no-interactive)
--keep-registrySkip deregistration from ~/.agentkit/projects.json after uninstall
--no-interactiveDisable interactive prompts (CI-safe)
--project-dir stringExplicit project root (default: cwd or first AK project found walking up)
-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)
1project directory not found or not an AK project
2invalid flags or arguments
3user declined confirmation prompt or --dry-run
6user-modified files detected without --force
  • ak — AgentKit CLI

On this page