CLI Reference
Last updated April 7, 2026
All pnpm kb commands — how to discover them, what groups exist, and key flags.
The KB Labs CLI is the primary interface for developers. Commands are registered by plugins at runtime, so the full list is always dynamic — it reflects exactly what's installed. This page covers the structure, the built-in command groups, and how to navigate the CLI yourself.
The complete, always-current command list lives in your terminal: pnpm kb --help and pnpm kb plugins commands. This page explains the structure; the live output is the canonical reference.
How to discover commands
# Top-level: all registered groups + system commands
pnpm kb --help
# Commands in a specific group
pnpm kb <group> --help
# Examples:
pnpm kb marketplace --help
pnpm kb workflow --help
pnpm kb commit --help
# Full structured dump of all commands across all installed plugins
pnpm kb plugins commands
# Detailed help for a specific command
pnpm kb <group>:<command> --help
pnpm kb commit:commit --helpThe output of pnpm kb plugins commands is the authoritative list — it reads directly from the loaded plugin registry, including any locally linked plugins.
Command structure
Commands follow a two-level hierarchy:
pnpm kb <group> <command> [flags]
pnpm kb <group> <subgroup> <command> [flags] # with subgroupExamples:
pnpm kb commit commit --dry-run—commitgroup,commitcommandpnpm kb marketplace plugins list—marketplacegroup,pluginssubgroup,listcommandpnpm kb workflow:run --workflow-id=my-flow— colon syntax (equivalent)
Built-in command groups
These groups are part of the core platform and are always available.
marketplace
Manage plugins and adapters.
pnpm kb marketplace install <pkg> # Install from npm
pnpm kb marketplace uninstall <pkg> # Remove
pnpm kb marketplace update [pkg] # Update to latest
# Plugin subgroup
pnpm kb marketplace plugins list # List installed plugins
pnpm kb marketplace plugins enable <id>
pnpm kb marketplace plugins disable <id>
pnpm kb marketplace plugins link <path> # Link local plugin for development
pnpm kb marketplace plugins unlink <id>
pnpm kb marketplace plugins doctor # Diagnose plugin issues
pnpm kb marketplace clear-cache # Clear plugin registry snapshot
pnpm kb marketplace clear-cache --deep # Also clear Node.js module cacheworkflow
Run and manage workflows.
pnpm kb workflow:run --workflow-id <id> [--input '<json>']
pnpm kb workflow:list
pnpm kb workflow:status --run-id <id>
pnpm kb workflow:cancel --run-id <id>
pnpm kb workflow:logs --run-id <id>mind
Semantic code search (requires Mind plugin).
pnpm kb mind rag-query --text "your question" --agent
pnpm kb mind rag-query --text "question" --mode instant|auto|thinking
pnpm kb mind rag-index --scope default
pnpm kb mind rag-index --scope default --include "path/**/*.ts"commit
AI-powered commit generation (requires commit plugin).
pnpm kb commit commit
pnpm kb commit commit --dry-run
pnpm kb commit commit --scope "@kb-labs/package-name"
pnpm kb commit commit --with-pushagent
Run and manage agents.
pnpm kb agent:run --agentId <id> --task "description"
pnpm kb agent:run --agentId <id> --session-id <id> --approve
pnpm kb agent:list
pnpm kb agent:initreview
AI code review.
pnpm kb review:run --repos "<repo>" --mode full --agent
pnpm kb review:run --repos "<repo>" --mode heuristic
pnpm kb review:run --repos "<repo>" --mode llmdocs
Documentation tooling.
pnpm kb docs generate-cli-reference # Regenerate CLI-REFERENCE.mddevlink
Cross-repo dependency management.
pnpm kb devlink status
pnpm kb devlink switch --mode local --install
pnpm kb devlink switch --mode npm
pnpm kb devlink switch --mode local --dry-run
pnpm kb devlink undoGlobal flags
These flags work on any command:
| Flag | Description |
|---|---|
--help | Show help for the current command or group |
--json | Emit structured JSON output (supported by most commands) |
--log-level <level> | Override log level: debug, info, warn, error |
Output modes
Most commands support two output modes:
- Text mode (default) — formatted for human reading: tables, spinners, colored output
- JSON mode (
--json) — structured JSON on stdout, no decorations, suitable for piping and agent consumption
When building scripts or workflows that consume CLI output, always use --json.
Environment variables
| Variable | Effect |
|---|---|
KB_PROJECT_ROOT | Override project root (where .kb/kb.config.json lives) |
KB_PLATFORM_ROOT | Override platform root (where node_modules/@kb-labs/* lives) |
LOG_LEVEL | Set log level (debug, info, warn, error) |
OPENAI_API_KEY | LLM and embeddings access |
Generated reference
A static snapshot of all commands is maintained in CLI-REFERENCE.md at the workspace root. Regenerate it after adding or changing commands:
pnpm kb docs generate-cli-reference
git add CLI-REFERENCE.md
git commit -m "docs: update CLI reference"This file is useful for searching with grep or reading offline, but it can lag behind the live registry — always prefer pnpm kb --help for the authoritative list.
Adding commands (plugin authors)
Commands are declared in the cli.commands[] array of a plugin manifest. See Plugins → CLI Commands for the full authoring guide and Manifest Reference → cli for the schema.
After adding commands:
- Build the plugin:
pnpm --filter your-plugin build - Clear the registry cache:
pnpm kb marketplace clear-cache - Verify:
pnpm kb your-group --help