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

Flags

FlagDescription
--allRemove every registry entry (requires --force and --yes)
--dry-runPreview what would be removed without modifying the registry
--forceRequired safety gate when using --all
-h, --helphelp for prune
--jsonEmit machine-readable JSON (implies --no-interactive)
--no-interactiveDisable interactive prompts (CI-safe)
--orphansRemove entries whose project directory no longer exists on disk
-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 projects — Manage the global AK project registry

On this page