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 projects prune
Remove stale project registry entries
Remove entries from ~/.agentkit/projects.json that no longer correspond to a directory on disk (orphans). Default is dry-run - pass --yes to actually prune. Use --all --force --yes to wipe the entire registry.
Who it's for: Power devs who need to clean up stale registry entries after moving or deleting projects.
When to use it: ak doctor reports orphaned registry entries and suggests ak projects prune --orphans.
What changes on disk: Writes ~/.agentkit/projects.json atomically (removes matched entries). No-op in dry-run mode.
Usage
ak projects prune [flags]Examples
ak projects prune --orphans # dry-run: preview orphans
ak projects prune --orphans --yes # remove orphan entries
ak projects prune --orphans --yes --json # machine-readable output
ak projects prune --all --force --yes # wipe entire registryFlags
| Flag | Description |
|---|---|
--all | Remove every registry entry (requires --force and --yes) |
--dry-run | Preview what would be removed without modifying the registry |
--force | Required safety gate when using --all |
-h, --help | help for prune |
--json | Emit machine-readable JSON (implies --no-interactive) |
--no-interactive | Disable interactive prompts (CI-safe) |
--orphans | Remove entries whose project directory no longer exists on disk |
-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 projects— Manage the global AK project registry