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 add
Register a project directory in the global registry
Add <path> to ~/.agentkit/projects.json. If the directory is already registered, its entry is refreshed (UpdatedAt). This command is called automatically by ak new and ak init.
Who it's for: Power devs who need to manually register an existing AK project.
When to use it: Onboarding a project that was cloned or moved from another machine.
What changes on disk: Writes ~/.agentkit/projects.json atomically.
Usage
ak projects add <path> [flags]Examples
ak projects add ./myproj # register relative path
ak projects add $HOME/projects/myproj # register absolute path
ak projects add . --json # register cwd, machine-readable outputFlags
| Flag | Description |
|---|---|
-h, --help | help for add |
--json | Emit machine-readable JSON (implies --no-interactive) |
--no-interactive | Disable interactive prompts (CI-safe) |
-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) |
0 | success (new or updated entry) |
1 | path does not exist or is not a directory |
2 | invalid arguments |
Related commands
ak projects— Manage the global AK project registry