CLI Reference
All git-kb commands. Click any row to expand its full help. This page is backed by src/lib/docs/cli-commands.ts, generated from git-kb 1.0.0.
This CLI reference mirrors command help for the generated git-kb 1.0.0 dataset. Output may differ for other installed GitKB versions. For the installed assistant dotfile and skill symlink layouts, see Agent Harnesses & Skills.
git-kb --version # Print version git-kb --help # Print help git-kb <command> --help # Help for a specific command
Start a knowledge base
git-kb init Initialize a new knowledge base
Initialize a new knowledge base
Usage: git-kb init [OPTIONS] [COMMAND]
Commands:
claude Install Claude Code integration files (.claude/, CLAUDE.md)
codex Install Codex integration files (.codex/, scripts, CODEX_HOME)
cursor Install Cursor integration files (.cursor/skills/, .cursor/rules/)
windsurf Install Windsurf integration files (.windsurf/skills/, .windsurf/rules/)
opencode Install OpenCode integration (opencode.json MCP server + .kb/ assets)
oh-my-pi Install oh-my-pi integration (.omp/mcp.json MCP server + .kb/ assets)
grok Install Grok Build integration (.grok/config.toml MCP server + .kb/ assets)
openclaw Install OpenClaw integration (.kb/ assets; MCP is global — prints how to enable)
antigravity Install Google Antigravity integration (.agents/ symlinks, .agents/mcp_config.json, AGENTS.md)
pi Install pi integration (.kb/ assets; pi has no built-in MCP)
Options:
--remote <REMOTE>
Remote to configure: a URL, or an org slug for gitkb://<host>/<org>/<kb>. Nothing is created on the remote
--cloud-remote <CLOUD_REMOTE>
Host of the gitkb:// remote when --remote is an org slug
--org <ORG>
Organization/namespace for federation
--instance <INSTANCE>
Instance name within organization
--name <NAME>
Display name for this KB
--no-verify
Skip connectivity check with remote
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb doctor Diagnose common configuration problems
Diagnose common configuration problems
Usage: git-kb doctor [OPTIONS]
Options:
--check <CHECK>
Only run specific checks (comma-separated). Available: repos, kb
--fix [<CHECK>]
Apply safe local repairs, then rerun checks. Bare `--fix` applies every safe repair; `--fix <check>` applies only that check's repair (kb.projection)
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
--progress
Emit one NDJSON progress event per line on stderr while checks run
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb repair Repair safe local KB state from canonical store data
Repair safe local KB state from canonical store data
Usage: git-kb repair [OPTIONS]
git-kb repair <COMMAND>
Commands:
projection Rebuild the document projection from the store
Options:
--from <REMOTE|BACKUP>
Re-fetch every damaged or missing object `fsck --full` names, by id, from a configured remote or a backup archive, and verify it
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb upgrade Upgrade a 0.1 knowledge base to the Protocol 1.0 store (the only command that migrates)
Upgrade a 0.1 knowledge base to the Protocol 1.0 store (the only command that migrates)
Usage: git-kb upgrade [OPTIONS]
Options:
--json
Output as JSON (the report; the first-run line still goes to stderr)
--report
List what the upgrade would convert, cut and leave unmapped, without changing anything
--allow-unmapped
Upgrade without the tips and publications `--report` lists as unmapped (their 0.1 bytes stay under `legacy-0.1/`)
--abort
Undo an interrupted upgrade: put the 0.1 layout back as it was and remove what the upgrade added, so `git-kb upgrade` can run again
--check
Check the store's upgrade state and change nothing: exit 0 only when it is a finished Protocol 1.0 store; otherwise name what to run
--dry-run
Print what would change without touching disk (same as --report)
--rollback
Undo the interrupted upgrade (same as --abort); with --operation, only the one `--check` names
--operation <OPERATION_ID>
The interrupted upgrade `--abort` / `--rollback` undoes, as `--check` names it
--cleanup
Delete the 0.1 layout a finished upgrade kept under `.kb/legacy-0.1/`
--root <ROOT>
The project root whose `.kb` to act on (default: found from the current directory)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb info Show KB statistics and storage info
Show KB statistics and storage info
Usage: git-kb info [OPTIONS]
Options:
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb limits Print the declared sync limits named by `resource over limit` errors
Print the declared sync limits named by `resource over limit` errors
Usage: git-kb limits [OPTIONS]
Options:
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionCreate and manage documents
git-kb create Create a new document in the workspace
Create a new document in the workspace
Usage: git-kb create [OPTIONS] [TYPE]
Arguments:
[TYPE]
Document type (task, spec, note, decision, skill, reference, incident)
Options:
--type <TYPE>
Document type (task, spec, note, decision, skill, reference, incident)
--title <TITLE>
Document title (opens $EDITOR if not provided)
--body <BODY>
Document body (default: a heading with the title)
--status <STATUS>
Initial status (draft/active/completed)
[default: draft]
--priority <PRIORITY>
Priority (high/medium/low)
[default: medium]
--tags <TAGS>
Comma-separated tags
--path <PATH>
Slug prefix (e.g. docs/api); the slug is <path>/<slugified title>
--slug <SLUG>
Explicit slug (overrides title-based generation)
--next <FAMILY>
Reserve the next number of this family at a remote and create <family>-<n>
--remote <REMOTE>
Remote (name or URL) the number is reserved at (default: the KB's default remote)
--ttl <TTL>
Seconds the reservation holds the number before the birth must publish
[default: 86400]
--require-remote-reservation
Require a remote reservation for the number: with no remote named or configured, refuse instead of numbering locally
--template <TEMPLATE>
Template to use
--parent <PARENT>
Parent document slug
--component <COMPONENT>
Component tag
--blocks <BLOCKS>
Link to existing document (blocks relationship)
--blocked-by <BLOCKED_BY>
Link to existing document (blocked-by relationship)
--refs <REFS>
Link to existing document (references relationship)
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
TYPE is required and can be given positionally or with --type:
git-kb create task --slug tasks/<name> --title "..." (positional)
git-kb create --type task --slug tasks/<name> --title "..." (named flag)
Give --slug a folder (tasks/, incidents/, specs/, notes/, ...) or use --next <family>;
without one the document lands at the top level of the KB. git-kb show Display a document, a historical version, or a commit
Display a document, a historical version, or a commit
Usage: git-kb show [OPTIONS] <PATHSPEC>...
Arguments:
<PATHSPEC>...
Document slugs or ids, `<slug>@<version>`, `'<slug>@{<n>}'` (the document as that reflog entry left it), or commit ids: full, or a unique prefix of 4 or more hex digits as `log` and `reflog` print it (`sha256:1f718cee28d5`)
Options:
--json
Output as JSON
--related
Also show summaries of related documents
--no-body
Show metadata only (no body)
--raw-content
Include the verbatim markdown (`rawContent`) in JSON output
--source <SOURCE>
Read one document through document.read.v1: `committed`, `workspace` (the invocation's workspace) or `workspace:<name>`
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb list List documents with filtering
List documents with filtering
Usage: git-kb list [OPTIONS] [PATHSPEC]
Arguments:
[PATHSPEC]
Filter by pathspec, the same as --path
Options:
--type <TYPE>
Filter by document type (repeat or comma-separate for multiple values)
--status <STATUS>
Filter by status (repeat or comma-separate for multiple values)
--priority <PRIORITY>
Filter by priority (repeat or comma-separate for multiple values)
--tags <TAGS>
Filter by tags (comma-separated)
--path <PATH>
Filter by pathspec: `specs` is `specs` and every document under it; `specs/*` its direct children; `**` crosses folders; or a document id
-r, --recursive
No-op, kept for compatibility: --path always includes nested documents (use `--path <dir>/*` for direct children only)
--in <CONTAINER>
List ordered children of a container (documents whose `in:` names it)
--count
Return only the matching document count (JSON: {"total": N})
-n, --limit <LIMIT>
Maximum number of results (default: no limit)
--offset <OFFSET>
Number of results to skip (for pagination)
--sort <SORT>
Sort by field (built-in: created, modified, title, priority; or any frontmatter field)
--asc
Sort ascending (default depends on field: asc for title/priority, desc for dates and custom fields)
--desc
Sort descending (default depends on field: asc for title/priority, desc for dates and custom fields)
--where <PREDICATE>
Filter by frontmatter field predicate (e.g. "score > 0.7", "stage = qualified"). Can be repeated; all predicates are ANDed
--since <SINCE>
Filter: modified after date (ISO 8601 date or relative: 7d, 2w, 1m)
--until <UNTIL>
Filter: modified before date (ISO 8601 date or relative: 7d, 2w, 1m)
--format <FORMAT>
Output format (table, json, ids)
Possible values:
- table: Formatted table (default)
- json: JSON output for scripting and agents (stable, complete fields)
- ids: Document IDs only (one per line)
[default: table]
--json
Output as JSON (shorthand for --format json). Agents and scripts should prefer this for stable, complete output
--unassigned
Show only unassigned documents
--assigned-to <ASSIGNED_TO>
Show only documents assigned to this agent
--unblocked
Show only documents with no unresolved blockers
--no-links
Hide relationship column
--save <SAVE>
Save current list flags as a view document with this slug
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
A bare argument is a pathspec, as --path takes; a type needs --type:
git-kb list context/ (the context/ folder)
git-kb list --type context (documents of type context)
AGENTS/SCRIPTS: use --json for complete, untruncated slugs/IDs and stable fields. git-kb search Search documents by content
Search documents by content
Usage: git-kb search [OPTIONS] <QUERY>
Arguments:
<QUERY>
Search query (searches title, content, and tags)
Options:
--limit <LIMIT>
Maximum number of results
[default: 20]
--type <DOC_TYPE>
Filter by document type
--status <STATUS>
Filter by status
--all-terms
Require every query term to match (strict legacy keyword behavior)
--offset <OFFSET>
Number of results to skip
--format <FORMAT>
Output format (table, json, slugs)
Possible values:
- table: Formatted table (default)
- json: JSON output for scripting and agents (stable, complete fields)
- slugs: Document slugs only (one per line)
[default: table]
--json
Output as JSON (shorthand for --format json). Agents and scripts should prefer this for stable, complete output
--rank-with <FILE>
Fuse the keyword results with a ranking computed elsewhere, read from this file (`-` for standard input).
The ranking is JSON: {"schema": "gitkb.search.ranking.v1", "documents": ["<document id>", …]}, best first. Each document must be live and pass --type and --status, as a keyword hit must; the two rankings are combined by reciprocal-rank fusion, so a document the keyword search missed can still be returned. Extensions such as `git-kb semantic search --hybrid` use this.
--remote <REMOTE>
Search a remote KB instead of the local one.
Accepts a remote name (e.g., "origin") or a gitkb:// URL. Calls the cloud FTS endpoint through the gateway.
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
AGENTS/SCRIPTS: use --json for complete, untruncated slugs/IDs and stable fields. Table output is for human display. git-kb rm Delete documents (a tombstone commit; `restore` brings them back)
Delete documents (a tombstone commit; `restore` brings them back)
Usage: git-kb rm [OPTIONS] <PATHSPEC>...
Arguments:
<PATHSPEC>...
Document IDs, slugs, folders or glob patterns to delete (a spec selecting several documents needs -r)
Options:
-r, --recursive
Recursive, as `git rm -r`: allow a pathspec that selects more than one document (a folder such as `specs/old/`, or a glob)
-f, --force
Force, as `git rm -f`: remove checkouts with local modifications (their bytes are moved to .gitkb/displaced/) and skip pathspecs that match nothing (without it they are refused: exit 17, `pathspec_no_match`)
--dry-run
Dry run - resolve pathspecs and show what would be deleted without modifying the workspace
--hard
Hard delete - destructively purge matching documents and document-only commits (history and bytes; as `git-kb filter --rm`). Takes only ids, exact slugs, folders written as `p/`, or globs: an unmatched bare name, or a folder written without its trailing `/`, is refused even with --force. With --force any other unmatched name is skipped; without it, exit 17 (a lone renamed slug: exit 10, naming the new slug)
--commit
With --hard (0.1): refused, a purge records no commit; kept so 0.1 scripts get that answer (an audit-preserving deletion is `rm -m`)
-m, --message <MESSAGE>
Commit the deletion at once with this message (default: stage it for `git-kb commit`)
-q, --quiet
Quiet mode (suppress output)
--json
Output as JSON
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Pathspecs:
<id> that document
tasks/a what is at that slug, when something is; else the folder
tasks/ the folder: tasks and every document under it, at any depth
tasks/* the direct children (*, ? and [...] stay in one folder level)
tasks/** every document under tasks, not tasks itself
**/a a at any depth
/ every document (never exit 17, even on an empty store)
A spec is read as a document id, then exact matches (they come before folder
expansion), then a folder or glob, then a bare name. An exact slug is not
always one document: pass the document id to pick one. rm, rm --hard and filter --rm need -r when one spec selects
more than one document. rm --hard and filter --rm take only an id, an exact
slug, a folder written as tasks/, or a glob: a bare name no document holds,
or a folder written without its trailing / (tasks), is refused (exit 4) even
with --force; any other unmatched name is an ordinary miss. A spec that matches nothing is refused with exit 17
(pathspec_no_match) unless a flag skips it (rm --force); some answer a lone
old slug of a renamed document with exit 10 (document_not_found) naming the
new slug. How drafts, bare names and a renamed document's old slug are read
varies by command. A pathspec
names the starting documents; commit --undo and reset <commit> act on whole
commits, so other documents in the commits they drop move too. git-kb set Quick metadata update (workspace-first, commit separately)
Quick metadata update (workspace-first, commit separately)
Usage: git-kb set [OPTIONS] <PATHSPEC> <FIELD=VALUE>...
Arguments:
<PATHSPEC>
Document pathspec (ID, slug, or glob pattern)
<FIELD=VALUE>...
Field=value pairs to set (use +field:value to add, -field:value to remove from arrays)
Options:
-n, --dry-run
Preview changes without applying (dry-run)
-q, --quiet
Quiet mode (suppress output)
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb assign Atomically assign a document to an agent (CAS)
Atomically assign a document to an agent (CAS)
Usage: git-kb assign [OPTIONS] <SLUG> <AGENT_ID>
Arguments:
<SLUG>
Document slug to assign
<AGENT_ID>
Agent or person ID to assign to
Options:
--force
Force assignment even if already assigned to someone else
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb unassign Clear the assignment on a document
Clear the assignment on a document
Usage: git-kb unassign [OPTIONS] <SLUG>
Arguments:
<SLUG>
Document slug to unassign
Options:
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb mv Move or rename documents
Move or rename documents
Usage: git-kb mv [OPTIONS] <SOURCE> [DEST]
Arguments:
<SOURCE>
Source document ID, slug, or path (one document; a spec selecting several is refused)
[DEST]
Destination slug or path
Options:
--next <FAMILY>
Reserve the next number of this family at a remote and rename onto <family>-<n>
--remote <REMOTE>
Remote (name or URL) the number is reserved at (default: the KB's default remote)
--ttl <TTL>
Seconds the reservation holds the number before the rename must publish
[default: 86400]
-f, --force
Overwrite a destination another document holds: tombstone it (or discard a draft there)
--json
Output as JSON
-q, --quiet
Suppress human output
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb templates Manage document templates
Manage document templates
Usage: git-kb templates [OPTIONS] [COMMAND]
Commands:
list List available templates
show Show a template
create Create a new template
edit Edit an existing template
delete Delete a custom template
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb slug Numbered slug families at a remote (reserve the next number)
Numbered slug families at a remote (reserve the next number)
Usage: git-kb slug [OPTIONS] <COMMAND>
Commands:
next Show the next number of a family at a remote (a preview: it holds nothing)
release Release a number this principal holds reserved at a remote
reservation Inspect, renew, or release an existing remote slug reservation
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb project Project KB documents to filesystem targets
Project KB documents to filesystem targets
Usage: git-kb project [OPTIONS] [PATHSPEC]
Arguments:
[PATHSPEC]
Documents to project: a slug (that document and every document under it), `dir/`, a glob (`specs/*` the direct children; `**` crosses folders; `/` every document) or a document id
Options:
--to <TARGET>
Target filesystem path
--rebuild
Drop the native document projection (the `proj_*` tables of the store's index) and rebuild it from the store
--adapter <ADAPTER>
Adapter to use. v1 supports markdown-document
[default: markdown-document]
--mode <MODE>
Filesystem projection mode
[default: symlink]
[possible values: symlink, copy]
--name <NAME>
Use a stable saved-style projection id for this one-shot projection
--require-match
Fail when a folder or glob selects no documents (a slug or id that names nothing always fails)
--dry-run
Preview without writing files
--json
Output stable JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb projections Manage saved document projections
Manage saved document projections
Usage: git-kb projections [OPTIONS] <COMMAND>
Commands:
list List saved and materialized projections
save Save a projection recipe in .kb/projections.toml
resolve Resolve a saved projection without writing files
apply Apply a saved projection
diff Diff a saved projection against current sources and targets
clean Remove stale outputs owned by a saved projection
remove Remove a projection and its owned outputs
doctor Diagnose a saved projection
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionOrganize with relationships and views
git-kb link Add a document to a container with ordering
Add a document to a container with ordering
Usage: git-kb link [OPTIONS] <CHILD>
Arguments:
<CHILD>
Document to link (ID or slug)
Options:
--to <CONTAINER>
Container to link to
--position <POSITION>
Position: first, last (default), after:<slug>, before:<slug>
[default: last]
--code <CODE>
Code symbol to link (e.g., src/auth.rs::login)
--repo <REPO>
Repository name for commit linking (must match [repos] in config.toml)
--commit <COMMIT>
Commit SHA for commit linking (requires --repo)
--json
Output the result as JSON
-q, --quiet
Quiet mode (suppress output)
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb unlink Remove a document from a container
Remove a document from a container
Usage: git-kb unlink [OPTIONS] --from <CONTAINER> <CHILD>
Arguments:
<CHILD>
Document to unlink (ID or slug)
Options:
--from <CONTAINER>
Container to unlink from
--json
Output the result as JSON
-q, --quiet
Quiet mode (suppress output)
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb reorder Reorder a document within a container
Reorder a document within a container
Usage: git-kb reorder [OPTIONS] --position <POSITION> <CONTAINER> <CHILD>
Arguments:
<CONTAINER>
Container document (ID or slug)
<CHILD>
Child document to reorder (ID or slug)
Options:
--position <POSITION>
New position: first, last, after:<slug>, before:<slug>
--json
Output the result as JSON
-q, --quiet
Quiet mode (suppress output)
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb graph Visualize document relationships
Visualize document relationships
Usage: git-kb graph [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
Document pathspec(s) (ID, slug, or glob pattern). Multiple pathspecs produce a merged graph
Options:
-d, --depth <DEPTH>
How many levels of relationships to traverse
[default: 1]
-D, --direction <DIRECTION>
Which direction to traverse relationships
Possible values:
- out: Outgoing relationships only
- in: Incoming relationships only
- both: Both directions
[default: both]
-t, --rel-type <REL_TYPE>
Filter by relationship type (can specify multiple)
-f, --format <FORMAT>
Output format
Possible values:
- tree: Tree view (default)
- json: JSON output
- dot: Graphviz DOT format
- mermaid-gantt: Mermaid gantt chart
- plan: Execution plan: dependency waves (JSON)
[default: tree]
--json
Output as JSON (shorthand for --format json). Agents and scripts should prefer this for stable, complete output
--critical-path
Compute and show the critical path (longest dependency chain)
--scope <STATUS>
Add every task in this status as a root (merged with any pathspecs)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
AGENTS/SCRIPTS: use --json for complete, untruncated slugs/IDs, relationship targets, and stable fields. Tree output is for human display. git-kb board Display ASCII kanban board
Display ASCII kanban board
Usage: git-kb board [OPTIONS]
Options:
--type <DOC_TYPE>
Filter to specific document type (e.g. task, note, context, incident)
--tags <TAGS>
Filter by tags
--priority <PRIORITY>
Filter by priority
--where <PREDICATE>
Filter by frontmatter field predicate (e.g. "score > 0.7"). Can be repeated; all predicates are ANDed
--group-by <GROUP_BY>
Group by a frontmatter property instead of status
Groups documents into columns by the specified property value. For example, --group-by priority creates columns for each priority level. Array properties like tags place documents in multiple columns.
--columns <COLUMNS>
Explicit column order (comma-separated, requires --group-by)
Controls which columns appear and in what order. Values not in this list appear as additional columns at the end.
--sort-by <SORT_BY>
Sort items within columns by a frontmatter property
--sort-direction <SORT_DIRECTION>
Sort direction: "asc" or "desc" (default: asc)
--unassigned
Show only unassigned documents
--assigned-to <ASSIGNED_TO>
Show only documents assigned to this agent
--unblocked
Show only documents with no unresolved blockers
--json
Output as JSON for tooling. Agents and scripts should prefer this for stable, complete output
--titles
Show document titles below each slug
[aliases: --title]
--width <WIDTH>
Column width for board display (auto-detected from terminal if not set)
--save <SAVE>
Save current board flags as a view document with this slug
--summary
Print one compact line of non-zero status counts (e.g., "22 active · 3 blocked")
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
AGENTS/SCRIPTS: use --json for complete, untruncated slugs/IDs and stable fields. ASCII board output is for human display. git-kb view Execute a saved view
Execute a saved view
Usage: git-kb view [OPTIONS] <SLUG>
Arguments:
<SLUG>
View document slug to execute
Options:
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
--document
Execute a dedicated view using an exact source and generation
--request-stdin
Read the bounded document view request as JSON on stdin
--limit <LIMIT>
Override limit for list/table/timeline layouts
--offset <OFFSET>
Override offset for pagination
--no-body
Show metadata only (no body). Only applies when falling back to show
--related
Also show summaries of related documents. Only applies when falling back to show
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionWorkspace
git-kb checkout Materialize documents to workspace
Materialize documents to workspace
Usage: git-kb checkout [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
Document ids, slugs, folders or globs (`tasks/` every document under tasks, `tasks/*` its direct children; see --help)
Options:
--status <STATUS>
Checkout documents by status
--type <TYPE>
Checkout documents by type
--tag <TAG>
Checkout documents by tag
--force
Displace dirty bytes to .kb/workspaces/<name>/.gitkb/displaced/ instead of refusing
--ours
Take the local side of the document's merge conflict whole (the edits as they were before the merge), as git's `checkout --ours`
--theirs
Take the tip's side of the document's merge conflict whole, as git's `checkout --theirs`
-q, --quiet
Suppress output
--json
Output as JSON
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Pathspecs:
<id> that document
tasks/a what is at that slug, when something is; else the folder
tasks/ the folder: tasks and every document under it, at any depth
tasks/* the direct children (*, ? and [...] stay in one folder level)
tasks/** every document under tasks, not tasks itself
**/a a at any depth
/ every document (never exit 17, even on an empty store)
A spec is read as a document id, then exact matches (they come before folder
expansion), then a folder or glob, then a bare name. An exact slug is not
always one document: pass the document id to pick one. rm, rm --hard and filter --rm need -r when one spec selects
more than one document. rm --hard and filter --rm take only an id, an exact
slug, a folder written as tasks/, or a glob: a bare name no document holds,
or a folder written without its trailing / (tasks), is refused (exit 4) even
with --force; any other unmatched name is an ordinary miss. A spec that matches nothing is refused with exit 17
(pathspec_no_match) unless a flag skips it (rm --force); some answer a lone
old slug of a renamed document with exit 10 (document_not_found) naming the
new slug. How drafts, bare names and a renamed document's old slug are read
varies by command. A pathspec
names the starting documents; commit --undo and reset <commit> act on whole
commits, so other documents in the commits they drop move too. git-kb status Show KB state (uncommitted changes, etc.)
Show KB state (uncommitted changes, etc.)
Usage: git-kb status [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
Limit to these documents (slugs, ids, globs, or workspace paths)
Options:
-s, --short
One line per file, clean files included
--json
Output as JSON
--no-graph
Skip the graph changes a commit would make (`graph_changes` is then empty): they read every changed document's committed base
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb diff Show workspace changes against the checkout baselines
Show workspace changes against the checkout baselines
Usage: git-kb diff [OPTIONS] [PATHSPEC|REVISION]...
Arguments:
[PATHSPEC|REVISION]...
Limit to these documents (slugs, ids, globs, or workspace paths); or exactly two revisions (<digest> or <slug>@<version>) to diff against each other
Options:
--commit <COMMIT>
Commit or range to diff (git `show <commit>` / `diff A..B`): each document of the commit from its state before it, or from before <A> to after <B> (e.g. abc1234, abc1234..def5678)
--remote <REMOTE>
Diff the local document tips against a remote (name or URL): the remote tips are fetched first (no reference moves, no file changes)
--three-way
With --remote: also show the base-to-local and base-to-remote diffs from the tips' common ancestor
--token-stdin
With --remote: read a bearer token for the remote from stdin (first line), presented in place of its configured credential and never stored; without it, $GITKB_REMOTE_TOKEN when set
--name-only
Show only changed paths
--stat
Show per-document insertion and deletion counts
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb commit Create a KB commit from workspace changes
Create a KB commit from workspace changes
Usage: git-kb commit [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
Limit to these documents (ids, slugs, folders, globs, or workspace paths; see --help)
Options:
-a, --all
Every changed document (without a PATHSPEC, more than one changed document needs --all)
-m, --message <MESSAGE>
Commit message (opens $EDITOR if not provided)
--close
Remove committed files from workspace after commit
--amend
Fold the changes into the commit the documents sit on (unpublished only)
--undo
Drop the commit the documents sit on, keeping its content as drafts (unpublished only)
-q, --quiet
Suppress output
--json
Output as JSON
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Pathspecs:
<id> that document
tasks/a what is at that slug, when something is; else the folder
tasks/ the folder: tasks and every document under it, at any depth
tasks/* the direct children (*, ? and [...] stay in one folder level)
tasks/** every document under tasks, not tasks itself
**/a a at any depth
/ every document (never exit 17, even on an empty store)
A spec is read as a document id, then exact matches (they come before folder
expansion), then a folder or glob, then a bare name. An exact slug is not
always one document: pass the document id to pick one. rm, rm --hard and filter --rm need -r when one spec selects
more than one document. rm --hard and filter --rm take only an id, an exact
slug, a folder written as tasks/, or a glob: a bare name no document holds,
or a folder written without its trailing / (tasks), is refused (exit 4) even
with --force; any other unmatched name is an ordinary miss. A spec that matches nothing is refused with exit 17
(pathspec_no_match) unless a flag skips it (rm --force); some answer a lone
old slug of a renamed document with exit 10 (document_not_found) naming the
new slug. How drafts, bare names and a renamed document's old slug are read
varies by command. A pathspec
names the starting documents; commit --undo and reset <commit> act on whole
commits, so other documents in the commits they drop move too. git-kb stash Stash workspace changes
Stash workspace changes
Usage: git-kb stash [OPTIONS] [PATHSPEC]... [COMMAND]
Commands:
push Set dirty files and drafts aside (the default)
list Show every stash
apply Bring a stash back and keep it
pop Bring a stash back and drop it
drop Remove a stash without applying it
show Show the entries of a stash (default: the newest)
clear Remove every stash
Arguments:
[PATHSPEC]...
Limit `stash` (push) to these documents (slugs, ids, globs, or workspace paths)
Options:
-m, --message <MESSAGE>
Stash message (shown by `stash list` and `stash show`)
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb reset Discard workspace changes
Discard workspace changes
Usage: git-kb reset [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
`[<COMMIT>] [<PATHSPEC>...]`: with a commit first (an id or unique prefix, <slug>@<version> or <slug>@{<n>}), move the documents it changes (or the named ones) to it; otherwise discard the workspace changes of the named documents (all when none is given). With `--hard --to <COMMIT>`: one document slug
Options:
--soft
Move the tips and keep every document's bytes as uncommitted edits
--mixed
Move the tips and keep the bytes as uncommitted edits (the default for a commit; GitKB has no index, so this equals --soft)
--hard
Move the tips and write the commit's bytes into the workspace (local modifications move to .gitkb/displaced/); with no commit, discard workspace changes
--to <COMMIT>
Target commit for a per-document reset (0.1): git-kb reset --hard <SLUG> --to <COMMIT>
--dry-run
Show what a reset to a commit would move without moving anything
--force
Skip confirmation prompt for destructive operation
-q, --quiet
Suppress output
--json
Output the result as JSON
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Pathspecs:
<id> that document
tasks/a what is at that slug, when something is; else the folder
tasks/ the folder: tasks and every document under it, at any depth
tasks/* the direct children (*, ? and [...] stay in one folder level)
tasks/** every document under tasks, not tasks itself
**/a a at any depth
/ every document (never exit 17, even on an empty store)
A spec is read as a document id, then exact matches (they come before folder
expansion), then a folder or glob, then a bare name. An exact slug is not
always one document: pass the document id to pick one. rm, rm --hard and filter --rm need -r when one spec selects
more than one document. rm --hard and filter --rm take only an id, an exact
slug, a folder written as tasks/, or a glob: a bare name no document holds,
or a folder written without its trailing / (tasks), is refused (exit 4) even
with --force; any other unmatched name is an ordinary miss. A spec that matches nothing is refused with exit 17
(pathspec_no_match) unless a flag skips it (rm --force); some answer a lone
old slug of a renamed document with exit 10 (document_not_found) naming the
new slug. How drafts, bare names and a renamed document's old slug are read
varies by command. A pathspec
names the starting documents; commit --undo and reset <commit> act on whole
commits, so other documents in the commits they drop move too. git-kb clear Remove documents from workspace
Remove documents from workspace
Usage: git-kb clear [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
Document pathspecs to clear (ids, slugs, folders or globs; see --help). Clears all if not specified
Options:
-f, --force
Clear even if there are uncommitted changes
--dry-run
Show what would be cleared without doing it
-q, --quiet
Suppress output
--json
Output the result as JSON
--status <STATUS>
Only documents in one of these statuses (repeatable)
--type <TYPE>
Only documents of one of these types (repeatable)
--priority <PRIORITY>
Only documents with one of these priorities (repeatable)
--tag <TAG>
Only documents carrying every one of these tags (repeatable)
--path <PREFIX>
Only documents whose slug starts with one of these prefixes (repeatable)
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Pathspecs:
<id> that document
tasks/a what is at that slug, when something is; else the folder
tasks/ the folder: tasks and every document under it, at any depth
tasks/* the direct children (*, ? and [...] stay in one folder level)
tasks/** every document under tasks, not tasks itself
**/a a at any depth
/ every document (never exit 17, even on an empty store)
A spec is read as a document id, then exact matches (they come before folder
expansion), then a folder or glob, then a bare name. An exact slug is not
always one document: pass the document id to pick one. rm, rm --hard and filter --rm need -r when one spec selects
more than one document. rm --hard and filter --rm take only an id, an exact
slug, a folder written as tasks/, or a glob: a bare name no document holds,
or a folder written without its trailing / (tasks), is refused (exit 4) even
with --force; any other unmatched name is an ordinary miss. A spec that matches nothing is refused with exit 17
(pathspec_no_match) unless a flag skips it (rm --force); some answer a lone
old slug of a renamed document with exit 10 (document_not_found) naming the
new slug. How drafts, bare names and a renamed document's old slug are read
varies by command. A pathspec
names the starting documents; commit --undo and reset <commit> act on whole
commits, so other documents in the commits they drop move too. git-kb log Show commit history
Show commit history
Usage: git-kb log [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
`[<range>] [<pathspec>...]`: limit to these documents (slugs, ids, or globs; default: every document). A first argument `<a>..<b>` or `<a>..` is a range, as git's: commits reachable from <b> (the tips) and not from <a>, a commit or a remote (`log origin..`: what origin does not hold yet)
Options:
-n, --count <COUNT>
Limit number of commits shown
--offset <OFFSET>
Skip this many commits (for pagination)
--oneline
One line per commit (shorthand for --format oneline)
--stat
Show document change counts (the default full format already does)
-p, --patch
Show patch (line-level diffs) for each change; with --json, each change's metadata_changes and hunks
--full-content
With --patch, the lines of whole-file changes too (a create's whole content, a delete's whole old content); without it they are listed with their content ids and `content_omitted`, as git's diff -D
--format <FORMAT>
Output format (full, oneline, json)
Possible values:
- full: Full commit details (default)
- oneline: One line per commit
- json: JSON output for scripting and agents (stable, complete fields)
[default: full]
--json
Output as JSON (shorthand for --format json)
--activity
Emit only activity: status changes and progress-log additions (JSON only)
--since <SINCE>
Inclusive lower bound (ISO date/datetime or relative: 7d, 2w, 1m)
--until <UNTIL>
Inclusive upper bound (ISO date/datetime or relative: 7d, 2w, 1m)
--before <BEFORE>
Exclusive upper bound (use with --since for [start, end))
--author <AUTHOR>
Exact commit author; applied before pagination
--filter <FILTER>
Structured history predicates as JSON (authors, periods, change_types)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb blame Attribute each line of a document to the commit that introduced it
Attribute each line of a document to the commit that introduced it
Usage: git-kb blame [OPTIONS] <SLUG>
Arguments:
<SLUG>
The document (slug or id)
Options:
--json
Output as JSON: {slug, tip, version, complete, boundary, lines[{line, commit_id, version, author, created_at_unix_ms, text}]}
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb reflog Show the log of every document tip movement (or expire old entries)
Show the log of every document tip movement (or expire old entries)
Usage: git-kb reflog [OPTIONS] [PATHSPEC]...
git-kb reflog <COMMAND>
Commands:
show Show the reflog (the default)
expire Drop old reflog entries
Arguments:
[PATHSPEC]...
Limit to these documents (slugs, ids or globs); a slug also matches a document that held it at a recorded movement
Options:
-n, --count <COUNT>
Show at most this many entries
--json
Output as JSON: {entries: [{selector, seq, document_id, slug, old_tip, new_tip, action, message, generation, date, at_ms, remote}], count}
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb revert Make a new commit that undoes a commit (safe on published history)
Make a new commit that undoes a commit (safe on published history)
Usage: git-kb revert [OPTIONS] <COMMIT>...
Arguments:
<COMMIT>...
Commits to revert (ids or unique prefixes), one new commit each, in order
Options:
--json
Output as JSON: {reverts: [{reverted, commit_id, message, changes}], warnings}
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace Machine-readable workspace inspection for integrations
Machine-readable workspace inspection for integrations
Usage: git-kb workspace [OPTIONS] <COMMAND>
Commands:
resolve Resolve the invocation's workspace identity and paths
list List every workspace: `.kb/workspaces/<name>` directories and git worktrees
path Show the workspace file path for a document
checkouts List checked-out documents in the invocation's workspace
status List checked-out and changed documents across every workspace
sources List Latest committed and every workspace holding a document (document.sources.v1)
write Save exact markdown to the invocation's workspace with generation checking (workspace.write.v1)
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace resolve Resolve the invocation's workspace identity and paths
Resolve the invocation's workspace identity and paths
Usage: git-kb workspace resolve [OPTIONS]
Options:
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace list List every workspace: `.kb/workspaces/<name>` directories and git worktrees
List every workspace: `.kb/workspaces/<name>` directories and git worktrees
Usage: git-kb workspace list [OPTIONS]
Options:
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace path Show the workspace file path for a document
Show the workspace file path for a document
Usage: git-kb workspace path [OPTIONS] <SLUG>
Arguments:
<SLUG>
Document slug
Options:
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace checkouts List checked-out documents in the invocation's workspace
List checked-out documents in the invocation's workspace
Usage: git-kb workspace checkouts [OPTIONS]
Options:
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace status List checked-out and changed documents across every workspace
List checked-out and changed documents across every workspace
Usage: git-kb workspace status [OPTIONS]
Options:
--slug <SLUGS>
Restrict status to one or more document slugs
--omit-empty
Omit workspaces with no matching checked-out or changed documents
--json
Output as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace sources List Latest committed and every workspace holding a document (document.sources.v1)
List Latest committed and every workspace holding a document (document.sources.v1)
Usage: git-kb workspace sources [OPTIONS] <SLUG>
Arguments:
<SLUG>
Exact document slug
Options:
--json
Output the document.sources.v1 envelope as JSON
--max-observation-bytes <MAX_OBSERVATION_BYTES>
Bound aggregate checkout read and normalization-copy bytes for the complete inventory; refuses rather than returning partial sources
--max-observation-workspaces <MAX_OBSERVATION_WORKSPACES>
Bound workspaces before reading checkout contents. Supplied with --max-observation-bytes; no workspace is silently omitted
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb workspace write Save exact markdown to the invocation's workspace with generation checking (workspace.write.v1)
Save exact markdown to the invocation's workspace with generation checking (workspace.write.v1)
Usage: git-kb workspace write [OPTIONS] --origin-id <ORIGIN_ID> <SLUG>
Arguments:
<SLUG>
Exact document slug
Options:
--stdin
Read the complete markdown document from standard input
--if-generation <IF_GENERATION>
Opaque generation returned by document.read.v1
--create-if-missing
Permit a first write when the workspace holds nothing for the slug
--origin-id <ORIGIN_ID>
Save correlation identifier echoed in the response
--json
Output the workspace.write.v1 envelope as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionCollaborate and sync
git-kb remote Manage sync remotes
Manage sync remotes
Usage: git-kb remote [OPTIONS] <COMMAND>
Commands:
add Add a new remote
remove Remove a remote
list List configured remotes
set-url Change a remote's URL (and token source); the authority must not change
rename Rename a remote, keeping its authority, selection and reservations
show Show one remote: URL, token source, authority, selection, last contact
ls List a remote's documents (slug, id, state, tip), bounded by globs
reconciliation Show the 0.1 reconciliation sets this store keeps, and bind or prune one parked when its remote was removed
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb push Push changes to a remote
Push changes to a remote
Usage: git-kb push [OPTIONS] <REMOTE> [PATHSPEC]...
Arguments:
<REMOTE>
Remote name or URL (e.g., origin, gitkb://gitkb.com/org/kb); a URL names the configured remote with that URL
[PATHSPEC]...
Documents to push: a slug (that document when it exists, else everything under it), `dir/` (everything under it), a glob (`tasks/*` the direct children; `**` crosses folders; `**` or `/` every document) or a document id
Options:
-v, --verbose
Verbose output
--progress
Show transfer progress on stderr even when it is not a terminal (with --json: as JSON lines); the global --quiet suppresses it
--token-stdin
Read a bearer token for this command's remote from stdin (first line), presented in place of the remote's configured credential and never stored; without it, $GITKB_REMOTE_TOKEN when set
--auto-rebase
Attempt a local pull/rebase/retry when the push is stale/diverged
--dry-run
Check push health without transferring payloads or mutating remote state
--force
Force push, overwriting remote conflicts: replace the remote's published history of the selected documents with this store's (needs write permission on every document whose history it changes). Prefer --force-with-lease
--force-with-lease
Require remote tips to match what this client last saw before replacing the remote's published history; otherwise refuse and print the pull to run. The normal form of a history rewrite (needs write permission on every document whose history it changes)
--json
Output the report as JSON. Agents and scripts should prefer this for stable, complete output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb pull Pull changes from a remote
Pull changes from a remote
Usage: git-kb pull [OPTIONS] <REMOTE> [PATHSPEC]...
Arguments:
<REMOTE>
Remote name or URL (e.g., origin, gitkb://gitkb.com/org/kb); a URL names the configured remote with that URL
[PATHSPEC]...
Documents to pull: a slug (that document when it exists, else everything under it), `dir/` (everything under it), a glob (`tasks/*` the direct children; `**` crosses folders; `**` or `/` every document) or a document id
Options:
-v, --verbose
Verbose output
--progress
Show transfer progress on stderr even when it is not a terminal (with --json: as JSON lines); the global --quiet suppresses it
--token-stdin
Read a bearer token for this command's remote from stdin (first line), presented in place of the remote's configured credential and never stored; without it, $GITKB_REMOTE_TOKEN when set
--dry-run
Check pull health without fetching payloads or mutating local state
--json
Output dry-run or apply report as JSON. Agents and scripts should prefer this for stable, complete output
--evidence-only
Import only missing predecessor history evidence the remote holds for the selected documents. Never moves a document tip or live body
--no-autostash
Leave a document with uncommitted edits as it is, file and reference (its hold row says so), instead of merging the pull into the file (the default, as git's `pull --rebase --autostash`; `config set sync.autostash false` makes this the default)
--autostash
Merge the pull into files with uncommitted edits, whatever `sync.autostash` says
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb fetch Fetch remote objects without moving any reference
Fetch remote objects without moving any reference
Usage: git-kb fetch [OPTIONS] <REMOTE> [PATHSPEC]...
Arguments:
<REMOTE>
Remote name or URL (e.g., origin, gitkb://gitkb.com/org/kb); a URL names the configured remote with that URL
[PATHSPEC]...
Documents to fetch: a slug (that document when it exists, else everything under it), `dir/` (everything under it), a glob (`tasks/*` the direct children; `**` crosses folders; `**` or `/` every document) or a document id
Options:
-v, --verbose
Verbose output
--progress
Show transfer progress on stderr even when it is not a terminal (with --json: as JSON lines); the global --quiet suppresses it
--json
Output as JSON. Agents and scripts should prefer this for stable output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb rebase Rewrite unpublished commits by a todo list (`rebase -i`), or show, continue or abort the rebase in progress
Rewrite unpublished commits by a todo list (`rebase -i`), or show, continue or abort the rebase in progress
Usage: git-kb rebase [OPTIONS] [UPSTREAM] [PATHSPEC]...
Arguments:
[UPSTREAM]
With -i: a commit (the commits above it) or a remote this KB has synced with (the commits not at it); anything else is the first pathspec. Otherwise: the remote of a pull's stopped rebase (default: the remote stored in its state)
[PATHSPEC]...
Limit to these documents (slugs, ids or globs; with -i)
Options:
-i, --interactive
Edit the list of commits to rewrite (`rebase -i`)
--todo-file <FILE>
Read the todo from this file (`-` for stdin) instead of an editor
--root
Every commit of the documents, down to their births (no upstream)
--continue
Continue the rebase in progress: the rest of a `rebase -i` todo an `edit` stopped, or a pull's replay once its merge files are resolved
--abort
Abort the rebase in progress: a `rebase -i` puts every document back; a pull's discards the stopped conflicts and their merge files
--max-rounds <N>
With --continue of a pull's rebase: the most replay rounds to run before stopping (at least 1)
--token-stdin
With --continue of a pull's rebase: read a bearer token for its remote from stdin (first line), presented in place of the remote's configured credential and never stored; without it, $GITKB_REMOTE_TOKEN when set
--json
Output as JSON (`rebase -i`: {status, todo, rewritten: [{old, new}], stopped_at, published_to, hint}; a pull's rebase: its status, the `--continue` report or the `--abort` outcome, as `kb_rebase` answers)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb rebase -i Rewrite unpublished commits by a todo list (`rebase -i`), or show, continue or abort the rebase in progress
Rewrite unpublished commits by a todo list (`rebase -i`), or show, continue or abort the rebase in progress
Usage: git-kb rebase [OPTIONS] [UPSTREAM] [PATHSPEC]...
Arguments:
[UPSTREAM]
With -i: a commit (the commits above it) or a remote this KB has synced with (the commits not at it); anything else is the first pathspec. Otherwise: the remote of a pull's stopped rebase (default: the remote stored in its state)
[PATHSPEC]...
Limit to these documents (slugs, ids or globs; with -i)
Options:
-i, --interactive
Edit the list of commits to rewrite (`rebase -i`)
--todo-file <FILE>
Read the todo from this file (`-` for stdin) instead of an editor
--root
Every commit of the documents, down to their births (no upstream)
--continue
Continue the rebase in progress: the rest of a `rebase -i` todo an `edit` stopped, or a pull's replay once its merge files are resolved
--abort
Abort the rebase in progress: a `rebase -i` puts every document back; a pull's discards the stopped conflicts and their merge files
--max-rounds <N>
With --continue of a pull's rebase: the most replay rounds to run before stopping (at least 1)
--token-stdin
With --continue of a pull's rebase: read a bearer token for its remote from stdin (first line), presented in place of the remote's configured credential and never stored; without it, $GITKB_REMOTE_TOKEN when set
--json
Output as JSON (`rebase -i`: {status, todo, rewritten: [{old, new}], stopped_at, published_to, hint}; a pull's rebase: its status, the `--continue` report or the `--abort` outcome, as `kb_rebase` answers)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb conflict Show and resolve sync conflicts
Show and resolve sync conflicts
Usage: git-kb conflict [OPTIONS] <COMMAND>
Commands:
show Show conflicts
accept Accept a resolution
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb merge Preview or resolve same-document remote merges with policies
Preview or resolve same-document remote merges with policies
Usage: git-kb merge [OPTIONS] [REMOTE] [PATHSPEC]...
Arguments:
[REMOTE]
Remote name or URL. Required for preview/apply; optional for saved-state actions
[PATHSPEC]...
Documents to merge: a slug (that document when it exists, else everything under it), `dir/` (everything under it), a glob (`tasks/*` the direct children; `**` crosses folders; `**` or `/` every document) or a document id
Options:
-v, --verbose
Verbose output
--preview
Preview merge decisions without mutating local state
--interactive
Walk selected documents in a terminal-guided merge picker
--continue
Continue an active conflict-resolution merge
--abort
Abort an active conflict-resolution merge
--status
Show active conflict-resolution merge status
--review <SLUG>
Review one document from the active local merge transaction
--source <BASE|LOCAL|REMOTE>
Include one complete lazy reference side in an active-merge review
--accept-unit <ORDINAL=CHOICE>
Accept one current conflict unit as ORDINAL=local|remote|both
--write-result
Replace the current editable merge result with complete UTF-8 bytes from stdin
--expect-result-digest <DIGEST>
Expected BLAKE3 digest of the current editable merge result
--local
Resolve all applicable documents by keeping the local version
--remote
Resolve all applicable documents by keeping the remote version
--auto
Resolve all applicable documents with the automatic three-way merge result
--manual
Select manual conflict resolution where available
--ours
Alias for --local
--theirs
Alias for --remote
--resolve <SLUG=POLICY>
Resolve a single document with a policy, for example tasks/foo=remote
--token-stdin
Read a bearer token for the merge's remote from stdin (first line), presented in place of its configured credential and never stored; without it, $GITKB_REMOTE_TOKEN when set
--json
Output as JSON. Agents and scripts should prefer this for stable output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb sync Converge the native store with a Protocol 1.0 remote
Converge the native store with a Protocol 1.0 remote
Usage: git-kb sync [OPTIONS] <COMMAND>
Commands:
status Print the engine's complete prioritized plan: its rows and their commands
converge Execute the auto tier to a fixed point and print the outcome
resolve Record an agent decision on an action of the plan, then converge
select Add selection patterns (directories and paths, as in git sparse-checkout cone mode) for a remote, or list them
show Inspect any row of the plan: its internals (document ids, shared commits, context, the observation); a conflict row's base/ours/theirs, both diffs and the merge
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb sync status Print the engine's complete prioritized plan: its rows and their commands
Print the engine's complete prioritized plan: its rows and their commands
Exit codes: 0 fixed point, 70 actions pending, 71 hold, 72 human. These numbers mean nothing else: a command that fails before it has a plan exits with the error's own code (2 not initialized, 4 invalid argument, ...).
Usage: git-kb sync status [OPTIONS] [REMOTE] [PATHSPEC]...
Arguments:
[REMOTE]
Remote name or URL (default: the KB's default remote, `sync.default_remote`)
[PATHSPEC]...
Pathspecs, read as push and pull read them (a slug, `dir/`, a glob such as `tasks/*`, `**` or `/`, or a document id): only the rows (and reservations) naming a matching document are shown; the exit code follows them
Options:
--offline
Do not contact the remote: print the plan saved by the last observation, marked stale (what `sync status` also falls back to when the remote is unreachable)
--fetch
Also fetch the content bodies of the remote chains, as converge does. Without it status acquires reference values and commits only, uses the bodies already held, and a diverged document whose replay needs a body not held shows a rebase row checked at converge
--json
Print the plan as JSON: `remote`, `exit`, `summary`, `rows` (prioritized; each its command), `reservations` (`null` when the remote was not observed), `widen` (when known); offline: `stale` and `fault`. A row's internals: `sync show <row-id> --remote <remote> --json`
--remote-scope <REMOTE_SCOPE>
Remote frontier scope to compare. Default inspects local-relevant remote entries only (the selection); pathspec status inspects that pathspec; use `full` for an exhaustive remote scan, which also lists every remote document outside the selection (`outside_documents`)
[default: auto]
[possible values: auto, local-relevant, full]
--rehash
Accepted as in 0.1 and ignored: workspace files are read through the workspace's status cache, which re-hashes a file whose stat data changed
--token-stdin
Read a bearer token for this command's remote from stdin (first line), presented in place of the remote's configured credential and never stored; without it, $GITKB_REMOTE_TOKEN when set
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb sync converge Execute the auto tier to a fixed point and print the outcome
Execute the auto tier to a fixed point and print the outcome
Usage: git-kb sync converge [OPTIONS] [REMOTE] [PATHSPEC]...
Arguments:
[REMOTE]
Remote name or URL (default: the KB's default remote, `sync.default_remote`)
[PATHSPEC]...
Pathspecs, read as push and pull read them (a slug, `dir/`, a glob such as `tasks/*`, `**` or `/`, or a document id): only the rows naming a matching document (and their whole commit groups) are executed, and only those rows are reported; the exit code follows them
Options:
--max-rounds <MAX_ROUNDS>
Plans computed before the engine stops
[default: 8]
--json
Print the ConvergeOutcome as JSON
--progress
Show transfer progress on stderr even when it is not a terminal (with --json: as JSON lines); the global --quiet suppresses it
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb sync resolve Record an agent decision on an action of the plan, then converge
Record an agent decision on an action of the plan, then converge
Usage: git-kb sync resolve [OPTIONS] --decision <DECISION> --remote <REMOTE> <ACTION_ID>
Arguments:
<ACTION_ID>
Action id from the plan (an agent row)
Options:
--decision <DECISION>
keep-local | keep-remote | rebase-onto-remote | retry | remove | deselect | skip | tombstone | rename=<slug> | {"live":"<content>"} | {"live_path":"<file>"} | {"rename":"<slug>"} (a relative `live_path` is read from the current directory)
--remote <REMOTE>
Remote name or URL: required, a row id is unique only within one remote's plan
--document <DOCUMENT>
The document id the row was shown for: the `--document` value of the row's printed command (`internals.documents[0]` of `sync show`; the row's `documents` name slugs). Required: the decision is refused (exit 63, `row_rebound`) when the row id now names another document
--theirs <THEIRS>
The remote content (`theirs.id` of `sync show`) the decision was made against; refused, with "re-run sync show", when the conflict's remote content has moved since. Required for every decision on a conflict whose remote side is content. The row's command and `sync show`'s resolve command carry it
--max-rounds <MAX_ROUNDS>
Plans computed before the engine stops
[default: 8]
--json
Print the ConvergeOutcome as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb sync select Add selection patterns (directories and paths, as in git sparse-checkout cone mode) for a remote, or list them
Add selection patterns (directories and paths, as in git sparse-checkout cone mode) for a remote, or list them
Usage: git-kb sync select [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
Directories (`tasks/`: every document under it, now and later), paths (one slug) or document ids (one document wherever it is renamed). Like git sparse-checkout's cone mode, no wildcards: `docs/*` is refused, name the directory `docs/`
Options:
--remote <REMOTE>
Remote name or URL (default: the KB's default remote)
--all
Select every document of the remote (the root pattern `/`)
--local
Select every document this store holds, now and later (`@local`, the default selection of the KB's default remote)
--list
Show the selection patterns and the documents they select now, changing nothing
--set
Replace the selection with these patterns (git's `sparse-checkout set`) instead of adding them (`sparse-checkout add`): what only the old patterns selected leaves the selection: this command and `sync status` remove nothing, the next `sync converge` removes it here (a checkout with local edits is held, unpublished commits are published first; its log is kept), and selecting it again brings it back
--reapply
Reapply the selection (git's `sparse-checkout reapply`): remove here the documents that left it, those the pathspecs name (every one without), changing no pattern; what a `depart` row's command runs. Exits as `sync converge` does
--json
Print the selection as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb sync show Inspect any row of the plan: its internals (document ids, shared commits, context, the observation); a conflict row's base/ours/theirs, both diffs and the merge
Inspect any row of the plan: its internals (document ids, shared commits, context, the observation); a conflict row's base/ours/theirs, both diffs and the merge
Usage: git-kb sync show [OPTIONS] --remote <REMOTE> <ACTION_ID>
Arguments:
<ACTION_ID>
Row id from the plan
Options:
--remote <REMOTE>
Remote name or URL: required, a row id is unique only within one remote's plan
-o, --output <FILE>
Where to write the conflict-marked merge file, diff3 style: each hunk is `<<<<<<< ours` / `||||||| base` / `=======` / `>>>>>>> theirs` (frontmatter openers labelled `<<<<<<< ours (<key>)`); every marker is lengthened past any marker-like line in the content (default: none; the merge is printed)
--document <DOCUMENT>
The id of the document the row was read for (`documents[0].id` of `git-kb show <slug> --json`; never a slug, which another document may take): refused (exit 63, `row_rebound`) when the row id now names another document, before anything is written
--json
Print the row as JSON: `row`, `internals`, `observation` (a conflict row: also its base/ours/theirs, diffs and merge segments)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb rewrite Rewrite unpublished local commits (`rewrite commits <remote>`, the alias of `rebase -i <remote>`)
Rewrite unpublished local commits (`rewrite commits <remote>`, the alias of `rebase -i <remote>`)
Usage: git-kb rewrite [OPTIONS] <COMMAND>
Commands:
commits Build or apply an explicit local commit rewrite (`rebase -i <remote>`). Without --apply it is a dry run; --apply --yes rewrites
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb rewrite commits Build or apply an explicit local commit rewrite (`rebase -i <remote>`). Without --apply it is a dry run; --apply --yes rewrites
Build or apply an explicit local commit rewrite (`rebase -i <remote>`). Without --apply it is a dry run; --apply --yes rewrites
Usage: git-kb rewrite commits [OPTIONS] <REMOTE> [PATHSPEC]...
Arguments:
<REMOTE>
Remote name or URL: the commits not yet published there are rewritten
[PATHSPEC]...
Document slugs or glob patterns to rewrite the commits of
Options:
--doc <DOC>
Restrict the rewrite to a document id or slug (repeatable)
--replace-slug <OLD=NEW>
Replace a slug in the unpublished commits: `OLD=NEW` (repeatable). Every commit that used OLD uses NEW instead
--write-todo <PATH>
Write the git-like rewrite todo to PATH and exit without changing anything
--todo-file <PATH>
Read the rewrite todo from PATH (`-` for stdin)
--interactive
Open the rewrite todo in $EDITOR, then plan or apply it
--apply
Apply the rewrite. Without this flag the command is a dry run
--dry-run
Explicitly request a dry run (the default without --apply)
--yes
Confirm a mutating apply after reviewing the dry-run plan
--json
Output as JSON (the `rebase -i --json` outcome)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb bundle Package or apply a `.kbbundle` (cross-KB commit replay).
Package or apply a `.kbbundle` (cross-KB commit replay).
`bundle create` packages a selected subset of commit history into a portable `.kbbundle` file. `bundle apply` replays the commits onto another KB.
Usage: git-kb bundle [OPTIONS] <COMMAND>
Commands:
create Package a subset of commit history into a `.kbbundle`
apply Apply a `.kbbundle` to this KB
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb bundle create Package a subset of commit history into a `.kbbundle`
Package a subset of commit history into a `.kbbundle`
Usage: git-kb bundle create [OPTIONS]
Options:
-o, --output <OUTPUT>
Output path. Use `-` to write the tar bytes to stdout
[default: delta.kbbundle]
--slugs <SLUG>...
Restrict to commits touching these slugs (or glob pathspecs). Composes with `--commits`, `--since`, and `--author` via AND
--commits <RANGE>
Git-style range `A..B` or comma-separated commit IDs. May be passed multiple times
--since <RFC3339>
Include commits with `committed_at >= <RFC3339>`
--author <EMAIL>
Restrict by commit author email
--json
Emit JSON to stdout, suitable for scripting and agents: with `--output <file>` the manifest summary, the file and its size; with `-o -` the manifest summary and the base64 bytes. Suppresses the human-readable next-actions block
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb bundle apply Apply a `.kbbundle` to this KB
Apply a `.kbbundle` to this KB
Usage: git-kb bundle apply [OPTIONS] <INPUT>
Arguments:
<INPUT>
Path to the `.kbbundle` (or `.kbbundle.gz`). Use `-` to read from stdin
Options:
--dry-run
Show the per-commit plan without mutating any state
--force
Override the dirty-workspace guard
--no-verify
Skip the post-apply `verify` pass
--json
Emit a JSON response (status + per-commit plan + next_actions). Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb cloud GitKB Cloud management CLI
GitKB Cloud management CLI
Usage: git-kb-cloud [OPTIONS] <COMMAND>
Commands:
doctor Run selected read-only readiness and integrity checks
auth
org
kb
rbac
help Print this message or the help of the given subcommand(s)
Options:
--api-url <API_URL>
API prefix URL. For local direct API use http://localhost:3000/api [env: GITKB_CLOUD_API_URL=]
--token <TOKEN>
Bearer token. Falls back to GITKB_TOKEN or GITKB_DEV_PAT [env: GITKB_CLOUD_TOKEN=]
--cf-access-client-id <CF_ACCESS_CLIENT_ID>
Cloudflare Access service token client id for staging [env: GITKB_CLOUD_CF_ACCESS_CLIENT_ID=]
--cf-access-client-secret <CF_ACCESS_CLIENT_SECRET>
Cloudflare Access service token client secret for staging [env: GITKB_CLOUD_CF_ACCESS_CLIENT_SECRET=]
--remote <REMOTE>
Optional gitkb://host/org/kb remote used to derive the cloud API host
--json
Emit stable JSON for scripts and agents
-h, --help
Print help git-kb login Shortcut for auth login
Shortcut for auth login
Usage: git-kb login [OPTIONS] [SERVER]
Arguments:
[SERVER]
Remote name, domain, or gitkb:// URL to authenticate against (default: GITKB_DOMAIN, active cloud domain, then gitkb.com)
Options:
--client-id <CLIENT_ID>
OIDC client ID (for self-hosted instances with custom OIDC apps)
--issuer <ISSUER>
OIDC issuer URL for remotes protected by a separate auth host
--scope <SCOPE>
OAuth scope to request. May be passed multiple times
--credential-store <CREDENTIAL_STORE>
Credential storage backend (default: existing issuer choice, otherwise file)
[aliases: --token-store]
[possible values: file, keychain]
--json
Emit NDJSON progress events on stdout (no tokens)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb logout Shortcut for auth logout
Shortcut for auth logout
Usage: git-kb logout [OPTIONS] [SERVER]
Arguments:
[SERVER]
Remote name, domain, or gitkb:// URL to log out from (default: GITKB_DOMAIN, active cloud domain, then gitkb.com)
Options:
--all
Log out from all known GitKB cloud domains and clear active cloud domain selection
--credential-store <CREDENTIAL_STORE>
Explicit credential backend to clear
[aliases: --token-store]
[possible values: file, keychain]
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb auth Authentication (login, logout, token)
Authentication (login, logout, token)
Usage: git-kb auth [OPTIONS] <COMMAND>
Commands:
login Authenticate with a GitKB remote via OIDC device flow
logout Clear stored authentication tokens
token Print current access token to stdout
status Show cloud and repository authentication status
use Switch the active cloud domain without logging in
migrate Move credentials between file and selected credential backend storage
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb whoami Show current user and org memberships
Show current user and org memberships
Usage: git-kb whoami [OPTIONS]
Options:
--remote <REMOTE>
Remote name, domain, or gitkb:// URL (default: GITKB_DOMAIN, active cloud domain, then gitkb.com)
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb org Manage organizations
Manage organizations
Usage: git-kb org [OPTIONS] <COMMAND>
Commands:
create Create a new organization
list List your organizations
show Show org details and its knowledge bases
delete Delete an organization (owner-only)
Options:
--remote <REMOTE>
Remote name, domain, or gitkb:// URL (default: GITKB_DOMAIN, active cloud domain, then gitkb.com)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb ping Check API reachability and version
Check API reachability and version
Usage: git-kb ping [OPTIONS]
Options:
--remote <REMOTE>
Remote name, domain, or gitkb:// URL (default: GITKB_DOMAIN, active cloud domain, then gitkb.com)
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionExport and recover
git-kb export Export documents in various formats
Export documents in various formats
Usage: git-kb export [OPTIONS]
Options:
-o, --output-dir <OUTPUT_DIR>
Output directory for markdown files (creates one file per document)
-f, --format <FORMAT>
Export format (default: markdown for --output-dir, jsonl for stdout)
Possible values:
- markdown: Markdown with YAML frontmatter
- json: One JSON object, `{count, format, documents}` (the `kb_export` shape)
- jsonl: One JSON object per line (for streaming)
-t, --type <DOC_TYPE>
Filter by document type
-s, --status <STATUS>
Filter by status
--tag <TAG>
Filter by tag
-q, --quiet
Suppress output
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb backup Create or restore a backup archive of the store and workspace
Create or restore a backup archive of the store and workspace
Usage: git-kb backup [OPTIONS]
Options:
-o, --output <OUTPUT>
Output file path (default: .kb/backups/<timestamp>-<unique-id>.gitkb-backup)
--stdout
Write the archive to stdout instead of a file
--restore [<ARCHIVE>]
Restore an archive into this knowledge base instead of creating one: the archive's log replaces this knowledge base's, which is kept aside as `.kb/log.pre-restore-<UTC>/` (with --resume or --abandon: no archive)
--resume
Finish a restore that stopped part-way (with --restore)
--abandon
Undo a restore that stopped before its log moved in (with --restore)
--verify <ARCHIVE>
Check an archive against this knowledge base (before or after a restore)
--no-workspace
Only archive the store; leave the workspace out
--json
Output the result as JSON
-q, --quiet
Suppress output
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb restore Bring deleted documents back
Bring deleted documents back
Usage: git-kb restore [OPTIONS] [PATHSPEC]...
Arguments:
[PATHSPEC]...
Document ids, slugs, or slug globs of deleted documents (with --source: the documents to restore from it)
Options:
-s, --source <REV>
Write the bytes the documents had at this version or commit into the workspace as uncommitted edits: <slug>@<version>, <slug>@{<n>}, or a commit id or unique prefix (default documents: the version's, or the commit's)
-m, --message <MESSAGE>
Commit message (default: "restore <slugs>")
-q, --quiet
Suppress output
--json
Output as JSON
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb filter Rewrite history to remove matching documents
Rewrite history to remove matching documents
Usage: git-kb filter [OPTIONS] --rm <PATHSPEC>...
Options:
--rm <PATHSPEC>...
Document IDs, exact slugs, folders written as `p/`, or glob patterns to destructively purge (an unmatched bare name, or a folder written without its trailing `/`, is refused, never read as a folder; any other unmatched name refuses the request: exit 17, or 10 naming the new slug for a lone renamed slug; `*` stays in one folder, `**` crosses; a spec selecting several documents needs -r)
-r, --recursive
Recursive, as `rm -r`: allow a pathspec that selects more than one document (a folder such as `specs/old/`, or a glob such as `'specs/**'`)
--force
Skip confirmation prompt for destructive operation (it skips no unmatched pathspec)
--json
Output as JSON: {documents, dropped, checkouts, published_to, prune, hint}
-q, --quiet
Print nothing on success (0.1's `filter --quiet`)
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Pathspecs:
<id> that document
tasks/a what is at that slug, when something is; else the folder
tasks/ the folder: tasks and every document under it, at any depth
tasks/* the direct children (*, ? and [...] stay in one folder level)
tasks/** every document under tasks, not tasks itself
**/a a at any depth
/ every document (never exit 17, even on an empty store)
A spec is read as a document id, then exact matches (they come before folder
expansion), then a folder or glob, then a bare name. An exact slug is not
always one document: pass the document id to pick one. rm, rm --hard and filter --rm need -r when one spec selects
more than one document. rm --hard and filter --rm take only an id, an exact
slug, a folder written as tasks/, or a glob: a bare name no document holds,
or a folder written without its trailing / (tasks), is refused (exit 4) even
with --force; any other unmatched name is an ordinary miss. A spec that matches nothing is refused with exit 17
(pathspec_no_match) unless a flag skips it (rm --force); some answer a lone
old slug of a renamed document with exit 10 (document_not_found) naming the
new slug. How drafts, bare names and a renamed document's old slug are read
varies by command. A pathspec
names the starting documents; commit --undo and reset <commit> act on whole
commits, so other documents in the commits they drop move too. git-kb schema Generate JSON Schema for document types
Generate JSON Schema for document types
Usage: git-kb schema [OPTIONS] [NAME]
Arguments:
[NAME]
Schema name to generate (frontmatter, document-type, external-ref) If not specified, lists available schemas
Options:
--format <FORMAT>
Output format (json or yaml)
Possible values:
- json: JSON output (default)
- yaml: YAML output
[default: json]
--json
Output as JSON (shorthand for --format json). Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb repack Fold loose objects into packs
Fold loose objects into packs
Usage: git-kb repack [OPTIONS]
Options:
--json
Output the summary as JSON
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb reindex Rebuild the document projection from the store
Rebuild the document projection from the store
Usage: git-kb reindex [OPTIONS]
Options:
-v, --verbose
Print progress as documents/commits are processed
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb verify Verify the native store: every stored object hashes to its id, every reference's objects are held, and every document chain is walked from its tip to its birth with each link checked. --full also checks the pack index and the authority database and compares the projected fields with the content bytes; --no-cache reads canonical bytes only and leaves the derived projection unread. Verification hashes every stored object, and walks a store of any size: one object read is bounded at the largest object a store admits (16 MiB), and decoded commits are cached up to 128 MiB, past which a commit shared by several chains is read again; at most 1,000 diagnostics are listed (the count is exact). Use --json for stable automation output; with --verbose it also carries chains_checked and integrity_hash.
Verify the native store: every stored object hashes to its id, every reference's objects are held, and every document chain is walked from its tip to its birth with each link checked. --full also checks the pack index and the authority database and compares the projected fields with the content bytes; --no-cache reads canonical bytes only and leaves the derived projection unread. Verification hashes every stored object, and walks a store of any size: one object read is bounded at the largest object a store admits (16 MiB), and decoded commits are cached up to 128 MiB, past which a commit shared by several chains is read again; at most 1,000 diagnostics are listed (the count is exact). Use --json for stable automation output; with --verbose it also carries chains_checked and integrity_hash.
Usage: git-kb verify [OPTIONS]
Options:
--full
Also check the pack index and the authority index, and compare the projected fields with the content bytes
--no-cache
Reparse current bytes without reading or writing derivative parse caches
-v, --verbose
Print detailed information about each check
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb fsck Check local KB integrity and fail on invariant issues
Check local KB integrity and fail on invariant issues
Usage: git-kb fsck [OPTIONS]
Options:
--full
Also walk every document chain to its birth, check the pack index and the authority database, and compare projected fields with the content
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
--repair
Repair the local authority log: cut it at the first damaged frame, quarantine what is cut, and record the repair (an admin command: it asks a running daemon to release the store first)
--ack-quarantine
Acknowledge every quarantine file under `log/quarantine/`, moving it to `log/quarantine/acked/`
--prune-indexes
Remove other schemas' index files and other logs' caches under `.kb/indexes/` (an admin command, like --repair)
-y, --yes
With --repair or --prune-indexes: do not ask for confirmation
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb prune Delete stored data nothing points to (dropped commits, purged content)
Delete stored data nothing points to (dropped commits, purged content)
Usage: git-kb prune [OPTIONS]
Options:
--expire <TIME>
Only delete unreachable data older than this (2.weeks.ago, now, a date); default: all unreachable data
--now
Delete all unreachable data now (--expire=now)
-n, --dry-run
Report what would be deleted, delete nothing
--json
Output as JSON: {removed, packs_dropped, unpacked, kept_young, dry_run}
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb gc Housekeeping: expire old reflog entries, prune unreachable data past a grace period, repack
Housekeeping: expire old reflog entries, prune unreachable data past a grace period, repack
Usage: git-kb gc [OPTIONS]
Options:
--prune <TIME>
Prune unreachable data older than this (default 2.weeks.ago; now; never)
--no-prune
Do not prune unreachable data
--json
Output as JSON: {reflog_expired, prune, repacked}
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb uncommit Turn a KB commit back into workspace changes
Turn a KB commit back into workspace changes
Usage: git-kb uncommit [OPTIONS] <COMMIT_ID>
Arguments:
<COMMIT_ID>
Commit ID to turn back into uncommitted workspace changes
Options:
--json
Emit the full operation result as JSON. Agents and scripts should prefer this for stable, complete output
-q, --quiet
Suppress human-readable output
-v, --verbose
Enable verbose output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionIntegrations
git-kb daemon Manage the GitKB daemon
Manage the GitKB daemon
Usage: git-kb daemon [OPTIONS] <COMMAND>
Commands:
start Start the GitKB daemon
stop Stop a running daemon
shutdown-if-idle Gracefully stop a lease-scoped daemon only if no owner is active
status Check daemon status
restart Restart the daemon in the mode it ran in (or detached with --background)
await-event Wait for a daemon event (for test synchronization)
logs View daemon log output
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb daemon logs View daemon log output
View daemon log output
Usage: git-kb daemon logs [OPTIONS]
Options:
-f, --follow
Follow log output (stream new lines as they appear)
-t, --tail <N>
Number of lines to show from the end (default: all)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb events Stream real-time events as NDJSON
Stream real-time events as NDJSON
Usage: git-kb events [OPTIONS]
Options:
--filter <FILTER>
Event pattern filter (e.g., "document:*", "commit:created", "*")
[default: *]
--path <PATH>
Filter document events by pathspec: `tasks` (or `tasks/`) is tasks and every document under it, `tasks/*` its direct children, `**` crosses folders; a rename matches by its old or new slug
Applied client-side since the daemon's EventFilter only matches event types. Non-document events (commit:created, daemon:heartbeat, etc.) pass through unfiltered.
--idle-timeout <IDLE_TIMEOUT>
Exit after N seconds of no events (0 = never)
[default: 0]
--count <COUNT>
Maximum number of events to receive before exiting (0 = unlimited)
[default: 0]
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb serve Start HTTP server for sync operations
Start HTTP server for sync operations
For individual use: local serve has no access control (no users, roles, scopes or API keys), and refuses to start when .kb/config.toml has an [auth] section asking for any.
Usage: git-kb serve [OPTIONS]
Options:
--port <PORT>
Port to listen on (0 picks a free one)
[default: 8080]
--host <HOST>
Host/IP to bind to
[default: 127.0.0.1]
--origin <ORIGIN>
Canonical URL clients reach this authority by (its `Remote` target); defaults to $GITKB_SERVE_ORIGIN; unset, the node answers as the URL it is reached at (`http://<host>:<port>`)
--require-token <TOKEN>
One shared bearer token every request must carry (a stand-in for the hosted receiver, not access control: local serve has none); without it the receiver serves everyone who can reach the bound address under an IP address, a loopback name or the `--origin` host (other `Host` names are refused, 421, against DNS rebinding); with it, every `Host`
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb mcp Run MCP server for Claude Code / Cursor integration
Run MCP server for Claude Code / Cursor integration
Usage: git-kb mcp [OPTIONS]
Options:
-f, --force
Deprecated compatibility flag; MCP clients no longer exclude each other
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb context Get bootstrap context bundle for AI agent sessions
Get bootstrap context bundle for AI agent sessions
Usage: git-kb context [OPTIONS] [SLUG]
Arguments:
[SLUG]
Document slug — graph-aware context bundle (`document.context.v1`)
Options:
--compact
Compact mode - omit document content (only slugs and metadata)
-n, --commits <COMMITS>
Number of recent commits to include (session bootstrap only)
[default: 5]
--code-refs
Include code references (`[[code:...]]` links of the document)
--neighbor-bodies <NEIGHBOR_BODIES>
Include excerpted bodies for graph neighbors (document context mode)
[default: true]
[possible values: true, false]
--token-budget <TOKEN_BUDGET>
Token budget for document context (default: 8000)
[default: 8000]
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb ready Show highest-scored ready task
Show highest-scored ready task
Usage: git-kb ready [OPTIONS]
Options:
--limit <LIMIT>
Maximum number of candidates to return
[default: 1]
--json
Output as JSON (includes score and breakdown). Agents and scripts should prefer this for stable, complete output
--context
Include full context bundle (task body, graph neighbors, code refs)
--budget <BUDGET>
Token budget for context bundle (default: 8000, requires --context)
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb resolve Resolve which task the current agent should work on
Resolve which task the current agent should work on
Usage: git-kb resolve [OPTIONS]
Options:
--env
Resolve from GITKB_TASK environment variable
--branch <BRANCH>
Fuzzy-match a branch name to a task slug
--auto
Auto-resolve: env var → agent binding → worktree binding → branch → empty
--fallback-recent
When --auto finds no binding or branch match, fall back to the most recently modified active task. Off by default. Only valid with --auto
--agent-id <AGENT_ID>
Agent/session id whose binding --auto looks up (default: $CLAUDE_SESSION_ID), as `kb_resolve` `agent_id`
--current-branch <CURRENT_BRANCH>
Current git branch for --auto (default: the branch of the working directory), as `kb_resolve` `current_branch`
--json
Output as JSON for tooling. Agents and scripts should prefer this for stable, complete output
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb config Read, set and list configuration values of .kb/config.toml
Read, set and list configuration values of .kb/config.toml
Usage: git-kb config [OPTIONS] <COMMAND>
Commands:
get Get a config value by dot-separated key path
set Set an allow-listed key (user.*, daemon.*, hooks.*, sync.remotes.<name>.url|token.*)
list List every key of .kb/config.toml as key=value (tokens redacted)
unset Remove a key (sync.default_remote), as `git config --unset` does
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb config get Get a config value by dot-separated key path
Get a config value by dot-separated key path
Usage: git-kb config get [OPTIONS] <KEY>
Arguments:
<KEY>
Dot-separated key path (e.g., "hooks.auto_commit_link")
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb config set Set an allow-listed key (user.*, daemon.*, hooks.*, sync.remotes.<name>.url|token.*)
Set an allow-listed key (user.*, daemon.*, hooks.*, sync.remotes.<name>.url|token.*)
Usage: git-kb config set [OPTIONS] <KEY> <VALUE>
Arguments:
<KEY>
Dot-separated key (see SETTABLE KEYS)
<VALUE>
Value, typed by the key
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
SETTABLE KEYS:
user.name, user.email text (the commit author, in your per-user
~/.config/gitkb/config.toml, never in .kb)
daemon.sync_interval_secs positive integer (seconds)
hooks.context_injection, hooks.auto_commit_link,
hooks.auto_worktree_bind, hooks.auto_progress,
hooks.prompt_context true|false
sync.autostash true|false (`pull` merges uncommitted edits; default true)
sync.default_remote a configured remote's name (`config unset` clears it)
sync.remotes.<name>.url http://, https:// or gitkb:// URL
sync.remotes.<name>.token.env|file|command the one token source (replaces the others) git-kb feedback Send feedback or a bug report without a KB or sign-in
Send feedback or a bug report without a KB or sign-in
Usage: git-kb feedback [OPTIONS]
Options:
--message <MESSAGE>
Report text (Markdown is supported)
--file <FILE>
Read report text from a file, or '-' for stdin; piped stdin is the default
--category <CATEGORY>
Report type; bug also attaches this binary's doctor --json output
[default: general]
[possible values: bug, general, feature]
--contact-email <CONTACT_EMAIL>
Optional address for a reply; never looked up from account or git config
--include-diagnostics
Collect bounded system details and git-kb/ATC/git/gh versions
--dry-run
Preview request JSON without sending (bug reports still run doctor)
--json
Print the receipt as JSON; errors are JSON on stderr
--api-url <API_URL>
API base URL; deliberately independent of KB/auth configuration
[default: https://gitkb.com/api]
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
EXAMPLES:
git-kb feedback --category bug --message 'Steps to reproduce...' --json
git-kb feedback --file report.md --include-diagnostics --dry-run
cat report.md | git-kb feedback --category bug --json
System/tool diagnostics require --include-diagnostics. Bug reports also attach
doctor --json. --dry-run previews without submitting. Maximum: 4000 characters. git-kb hook Agent harness hook adapters (stdin event JSON -> hook JSON)
Agent harness hook adapters (stdin event JSON -> hook JSON)
Usage: git-kb hook [OPTIONS] <COMMAND>
Commands:
codex Codex hook adapter for destructive-command safety
antigravity Google Antigravity hook adapter for destructive-command safety
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb app Inspect local GitKB apps
Inspect local GitKB apps
Usage: git-kb app [OPTIONS] <COMMAND>
Commands:
list List locally installed apps
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb app list List locally installed apps
List locally installed apps
Usage: git-kb app list [OPTIONS]
Options:
--json
Output as JSON
--apps-dir <APPS_DIRS>
Additional local app install directory to scan
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb external-refs Query descriptor-derived external reference projections
Query descriptor-derived external reference projections
Usage: git-kb external-refs [OPTIONS]
Options:
--slug <SLUG>
Document slug to list external refs for
--system <SYSTEM>
External system id for reverse lookup, e.g. github, linear, atc
--id <ID>
External id for reverse lookup
--json
Output stable JSON for agents and scripts
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb repo Manage repository discovery and aliases
Manage repository discovery and aliases
Usage: git-kb repo [OPTIONS] <COMMAND>
Commands:
list List discovered repos with aliases and remotes
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version git-kb resource Resolve canonical resource locations from this KB/worktree
Resolve canonical resource locations from this KB/worktree
Usage: git-kb resource [OPTIONS] <COMMAND>
Commands:
locate Locate a resource from the current KB/worktree
Options:
-v, --verbose
Enable verbose output
-q, --quiet
Suppress non-essential output
--color <COLOR>
Color output mode
Possible values:
- auto: Auto-detect TTY
- always: Always use colors
- never: Never use colors
[default: auto]
--log-format <LOG_FORMAT>
Log output format (pretty, compact, json)
Possible values:
- pretty: Human-readable with colors (default)
- compact: Compact single-line format
- json: JSON format for machine parsing and agent workflows
[default: pretty]
--no-pager
Disable pager for commands that support it
--no-daemon
Do not start the daemon for store writes (a running one is still used); also `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`
-h, --help
Print help (see a summary with '-h')
-V, --version
Print versionCode intelligence
git-kb code Code intelligence for GitKB
Code intelligence for GitKB
Usage: git-kb code [OPTIONS] [COMMAND]
Commands:
index Index source code symbols from files
symbols Query indexed code symbols
callers Find callers of a function/method
callees Find functions/methods called by a symbol
impact Analyze change impact for a file via call graph
dead Find potentially dead code (symbols with no callers)
refs Where a name is referred to in code: grep's whole-word hits, read now, less comments, strings and definitions (main answer and check list)
docs Find documents that cite a code symbol (through `git-kb symbol-refs`)
stats Show code index statistics
doctor Diagnose code-intelligence index health
entrypoints Inspect inferred code entrypoints
annotations Wikilinks written in source comments, with the symbol each is attached to and, with --reach, the entrypoints and tests that reach it
flows List traced execution flows
flow Inspect one traced execution flow
query Run typed code graph query templates
map Emit the whole code-map payload (files, symbols, health) in one call
graph Emit a symbol's caller/callee subgraph as nodes + edges
show Show one symbol's metadata and source lines
shape Show one function's control structure and complexity
smart-context Assemble the code a task is about (its code links, the files it names, their callers and callees) within a token budget
quality Run fixture-driven resolver quality checks
dump-ast Print the tree-sitter parse tree for a file
prune Remove stale branch symbols from the code index
mcp Run the MCP server with the code tools (stdio)
hook Agent hook adapters: read a hook event on stdin, print hook output
init Connect an agent to code intelligence: skills, rules, the search hook and the MCP server
help Print this message or the help of the given subcommand(s)
Options:
--kb-root Print the resolved root path and exit
--absolute-paths Use root-relative paths in text output (override the CWD-relative default)
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help
-V, --version Print version git-kb code index Index source code symbols from files
Index source code symbols from files
Usage: git-kb code index [OPTIONS] [PATHS]...
Arguments:
[PATHS]... Paths to index (files or directories). Defaults to current directory
Options:
--force
Force reindexing even if content hasn't changed
--dry-run
Show what would be indexed without actually storing
--no-refresh
Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--prune
Remove symbols for files that no longer exist
--language <LANGUAGE>
Only index files of this language
-v, --verbose
Log at debug level to stderr
--include-deps
Include dependency directories (target/, node_modules/, etc.)
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--branch <BRANCH>
Branch to tag symbols with (overrides auto-detection). Auto-detected via `git branch --show-current` when not specified
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--default-branch <DEFAULT_BRANCH>
Default branch used as the overlay baseline (overrides the configured and inferred default branch), as `kb_index` `default_branch`
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--worktree <WORKTREE>
Worktree path: sets root_override to the given directory's git repo root and auto-detects the branch from that worktree. Use when indexing files from a git worktree outside GITKB_ROOT
--json
Output the final index receipt as JSON. Agents and scripts should prefer this for stable, complete output
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
-h, --help
Print help
IGNORE PATTERNS:
Indexing respects both .gitignore and .gitkbignore files.
.gitignore Standard Git ignore patterns — files ignored by Git are also
skipped during indexing (e.g. target/, node_modules/).
.gitkbignore GitKB-specific ignore patterns — use this to exclude files from
code indexing that you still want tracked by Git. Supports the
same glob syntax as .gitignore.
Place .gitkbignore in your project root or any subdirectory.
Patterns are relative to the directory containing the file.
Example .gitkbignore:
fixtures/ # test fixture data
*.generated.rs # generated code
vendor/ # vendored dependencies git-kb code symbols Query indexed code symbols
Query indexed code symbols
Usage: git-kb code symbols [OPTIONS] [QUERY]
Arguments:
[QUERY] Search query (matches symbol names)
Options:
--file <FILE> Filter by file path
--kind <KIND> Filter by symbol kind (function, method, struct, class, etc.)
--language <LANGUAGE> Filter by language (rust, python, typescript, etc.)
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--path <PATH> Filter by file path glob pattern (e.g., "**/sync/**", "crates/**/*.rs"). Case-sensitive. Uses `*` for any chars and `?` for single char
-v, --verbose Log at debug level to stderr
--parent <PARENT> Filter by parent type name (e.g., "Store", "ListArgs")
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--limit <LIMIT> Maximum number of results (-1 for no limit) [default: 50]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--offset <OFFSET> Number of results to skip
--body Show full symbol bodies (incompatible with --group-by and --compact)
--no-pager Accepted for compatibility with `git-kb`; has no effect
--count Show symbol count only
--no-daemon Accepted for compatibility with `git-kb`; has no effect
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
--compact Compact JSON output (omits indexing internals). Only affects --json
--group-by <GROUP_BY> Group output by a field. Supported values: "file"
--branch <BRANCH> Filter to a specific branch. When omitted, queries the configured default branch only. Pass an explicit branch to apply overlay semantics (feature branch symbols for re-indexed files, default branch symbols for all other files)
-h, --help Print help git-kb code callers Find callers of a function/method
Find callers of a function/method
Usage: git-kb code callers [OPTIONS] <SYMBOL>
Arguments:
<SYMBOL> Symbol name or symbol_id to query. When the name matches multiple symbols, results for all matches are shown (use --strict to error instead)
Options:
--depth <DEPTH> Maximum traversal depth (0 = direct only) [default: 0]
--limit <LIMIT> Maximum number of results (-1 for no limit) [default: 50]
--branch <BRANCH> Filter to a specific branch. When omitted, queries the configured default branch only. Pass an explicit branch to apply overlay semantics (feature branch call edges for re-indexed files, default branch edges for all other files)
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--strict Error on ambiguous symbol (exit 38) instead of showing all matches
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code callees Find functions/methods called by a symbol
Find functions/methods called by a symbol
Usage: git-kb code callees [OPTIONS] <SYMBOL>
Arguments:
<SYMBOL> Symbol name or symbol_id to query. When the name matches multiple symbols, results for all matches are shown (use --strict to error instead)
Options:
--depth <DEPTH> Maximum traversal depth (0 = direct only) [default: 0]
--limit <LIMIT> Maximum number of results (-1 for no limit) [default: 50]
--branch <BRANCH> Filter to a specific branch. When omitted, queries the configured default branch only. Pass an explicit branch to apply overlay semantics (feature branch call edges for re-indexed files, default branch edges for all other files)
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--strict Error on ambiguous symbol (exit 38) instead of showing all matches
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code impact Analyze change impact for a file via call graph
Analyze change impact for a file via call graph
Usage: git-kb code impact [OPTIONS] <FILE_PATH>
Arguments:
<FILE_PATH>
File path to analyze impact for
Options:
--depth <DEPTH>
Maximum traversal depth (0 = direct only)
[default: 0]
--limit <LIMIT>
Maximum number of results (-1 for no limit)
[default: 50]
--format <FORMAT>
Output format: text (default) or json
Possible values:
- text: Human-readable text output (default)
- json: JSON output for scripting, automation, and agents (stable, complete fields)
[default: text]
--no-refresh
Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--json
Output as JSON (shorthand for --format json). Agents and scripts should prefer this for stable, complete output
-v, --verbose
Log at debug level to stderr
--compact
Compact JSON output (omits indexing internals). Only affects JSON output
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--branch <BRANCH>
Query a specific branch using overlay semantics
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect
[default: auto]
[possible values: auto, always, never]
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect
[default: pretty]
[possible values: pretty, compact, json]
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
-h, --help
Print help (see a summary with '-h') git-kb code dead Find potentially dead code (symbols with no callers)
Find potentially dead code (symbols with no callers)
Usage: git-kb code dead [OPTIONS]
Options:
--file <FILE>
Filter by file path (optional)
--kind <KIND>
Filter by symbol kind (e.g., "function", "method")
--include-tests
Include test functions in results
--no-refresh
Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--limit <LIMIT>
Maximum results to return (-1 for no limit)
[default: 100]
-v, --verbose
Log at debug level to stderr
--offset <OFFSET>
Number of results to skip
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect
[default: auto]
[possible values: auto, always, never]
--format <FORMAT>
Output format: text (default) or json
Possible values:
- text: Human-readable text output (default)
- json: JSON output for scripting, automation, and agents (stable, complete fields)
[default: text]
--json
Output as JSON (shorthand for --format json). Agents and scripts should prefer this for stable, complete output
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect
[default: pretty]
[possible values: pretty, compact, json]
--compact
Compact JSON output (omits indexing internals). Only affects JSON output
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--group-by <GROUP_BY>
Group output by a field. Supported values: "file"
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
--exclude-tests
Exclude test symbols from output
--branch <BRANCH>
Filter to a specific branch. When omitted, defaults to the configured default branch (code.default_branch)
--include-entrypoints
Include inferred entrypoints in results
--include-public
Include public/exported symbols in results
--explain
Include classification evidence in JSON and query-template output
-h, --help
Print help (see a summary with '-h') git-kb code refs Where a name is referred to in code: grep's whole-word hits, read now, less comments, strings and definitions (main answer and check list)
Where a name is referred to in code: grep's whole-word hits, read now, less comments, strings and definitions (main answer and check list)
Usage: git-kb code refs [OPTIONS] <TARGET>
Arguments:
<TARGET> The name to find: its definition as path:line:col (column in characters, 1-based), or a bare name for every language
Options:
--all List every left-out hit with the rule that left it out
--json Output as JSON (items, check, left_out). Agents and scripts should prefer this for stable, complete output
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code docs Find documents that cite a code symbol (through `git-kb symbol-refs`)
Find documents that cite a code symbol (through `git-kb symbol-refs`)
Usage: git-kb code docs [OPTIONS] <SYMBOL>
Arguments:
<SYMBOL> Symbol ID to find references for (e.g. `src/auth.rs::login`)
Options:
--json Output as JSON with per-match confidence. Agents and scripts should prefer this for stable, complete output
--textual Only textual matches, no wikilinks
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--wikilinks-only Only wikilink matches
--include-maybe Include low-confidence `[maybe]` hits
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--strict Require a file-path anchor for every textual match
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code stats Show code index statistics
Show code index statistics
Usage: git-kb code stats [OPTIONS]
Options:
--branch <BRANCH>
Filter statistics to a specific branch. When omitted, aggregates across all branches
--format <FORMAT>
Output format: text (default) or json
Possible values:
- text: Human-readable text output (default)
- json: JSON output for scripting, automation, and agents (stable, complete fields)
[default: text]
--json
Output as JSON (shorthand for --format json). Agents and scripts should prefer this for stable, complete output
--no-refresh
Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose
Log at debug level to stderr
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect
[default: auto]
[possible values: auto, always, never]
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect
[default: pretty]
[possible values: pretty, compact, json]
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
-h, --help
Print help (see a summary with '-h') git-kb code doctor Diagnose code-intelligence index health
Diagnose code-intelligence index health
Usage: git-kb code doctor [OPTIONS]
Options:
--branch <BRANCH> Filter diagnostics to a specific branch
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code entrypoints Inspect inferred code entrypoints
Inspect inferred code entrypoints
Usage: git-kb code entrypoints [OPTIONS]
Options:
--refresh Refresh inferred entrypoints before listing
--branch <BRANCH> Filter to a specific branch
--limit <LIMIT> Maximum number of results [default: 100]
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code annotations Wikilinks written in source comments, with the symbol each is attached to and, with --reach, the entrypoints and tests that reach it
Wikilinks written in source comments, with the symbol each is attached to and, with --reach, the entrypoints and tests that reach it
Usage: git-kb code annotations [OPTIONS]
Options:
--link-type <LINK_TYPE> Link type before the first `:`, e.g. `claim` for `[[claim:...]]`. Pass an empty string for untyped links such as `[[specs/a]]`
--target <TARGET> Whole link target, or its key (the part after `#`): `K-1` matches `[[claim:K-1]]` and `[[claim:specs/a#K-1]]`
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--symbol <SYMBOL> Exact symbol id the annotation is attached to (from `code symbols --json`)
--path <PATH> Only files under this repository-relative path
-v, --verbose Log at debug level to stderr
--branch <BRANCH> Branch to read (default: the configured default branch)
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--limit <LIMIT> Maximum number of annotations (at most 100000) [default: 1000]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--offset <OFFSET> Annotations to skip: the previous report's `next_offset`
--no-pager Accepted for compatibility with `git-kb`; has no effect
--reach Also show, per annotated symbol, the entrypoints and test symbols that reach it through callers
--no-daemon Accepted for compatibility with `git-kb`; has no effect
--reach-depth <REACH_DEPTH> Caller hops for --reach (at most 16) [default: 5]
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
-h, --help Print help git-kb code flows List traced execution flows
List traced execution flows
Usage: git-kb code flows [OPTIONS]
Options:
--refresh Refresh flows before listing
--branch <BRANCH> Filter to a specific branch
--depth <DEPTH> Maximum traversal depth when refreshing [default: 8]
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--limit <LIMIT> Maximum number of flows to list [default: 50]
-v, --verbose Log at debug level to stderr
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code flow Inspect one traced execution flow
Inspect one traced execution flow
Usage: git-kb code flow [OPTIONS] <FLOW_ID>
Arguments:
<FLOW_ID> Flow id to inspect
Options:
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code query Run typed code graph query templates
Run typed code graph query templates
Usage: git-kb code query [OPTIONS] <TEMPLATE>
Arguments:
<TEMPLATE> Query template to run [possible values: hotspots, public-api, entrypoints, unresolved-by-reason, cross-file-coverage, cross-service-impact, dead-code-explain, routes, route-clients, handler-routes]
Options:
--target <TARGET> Optional target string for templates that need one
--branch <BRANCH> Filter to a specific branch
--limit <LIMIT> Maximum result count [default: 50]
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--depth <DEPTH> Maximum traversal depth for templates that traverse
-v, --verbose Log at debug level to stderr
--include-docs Include related KB document information where supported
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--refresh Refresh derived tables before running templates that support it
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code map Emit the whole code-map payload (files, symbols, health) in one call
Emit the whole code-map payload (files, symbols, health) in one call
Usage: git-kb code map [OPTIONS]
Options:
--branch <BRANCH>
Filter to a specific branch. When omitted, the configured default branches are merged (overlay semantics apply per branch)
--detail <DETAIL>
Payload detail level
Possible values:
- files: Files only (default) — one row per indexed file
- symbols: Files plus a slim row per symbol. Combine with --path-prefix on large indexes; whole-index symbol payloads run to tens of MB
[default: files]
--no-refresh
Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--path-prefix <PATH_PREFIX>
Only include files under this path prefix
--defer-health
Defer the index-health block (counts and the stale-file scan) for an initial map; the payload marks health as deferred. The query still refreshes the index first unless `--no-refresh` is given
-v, --verbose
Log at debug level to stderr
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect
[default: auto]
[possible values: auto, always, never]
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect
[default: pretty]
[possible values: pretty, compact, json]
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
-h, --help
Print help (see a summary with '-h')
Cyclomatic complexity = 1 + decision points in the symbol's own body: if / else-if, loops (for, while, loop), each non-default match/switch arm, && || ?? and/or, ternaries, catch/except clauses, and Rust `?` early exits. Nested named functions are scored on their own; closures count toward the enclosing function. Only functions and methods carry a value. git-kb code graph Emit a symbol's caller/callee subgraph as nodes + edges
Emit a symbol's caller/callee subgraph as nodes + edges
Usage: git-kb code graph [OPTIONS] [SYMBOL]
Arguments:
[SYMBOL]
Symbol name or symbol_id to root the subgraph at
Options:
--file <FILE>
Whole-file graph instead of a symbol neighborhood: every symbol in this KB-root-relative file plus every call edge among them
--depth <DEPTH>
Hops per direction (1 = direct callers and callees; 0 is read as 1)
[default: 1]
--limit <LIMIT>
Maximum symbols collected per direction (-1 for no limit); a --file graph has every symbol of the file
[default: 200]
--no-refresh
Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--direction <DIRECTION>
Traversal direction
Possible values:
- in: Callers only (who reaches this symbol)
- out: Callees only (what this symbol reaches)
- both: Callers and callees (default)
[default: both]
-v, --verbose
Log at debug level to stderr
--include-docs
Include the documents that link the root symbol (`[[code:…]]`), read through `git-kb symbol-refs`
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--branch <BRANCH>
Filter to a specific branch (overlay semantics)
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect
[default: auto]
[possible values: auto, always, never]
--json
Output as JSON. Agents and scripts should prefer this for stable, complete output
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect
[default: pretty]
[possible values: pretty, compact, json]
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--strict
Error on ambiguous symbol (exit 38) instead of listing candidates
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
-h, --help
Print help (see a summary with '-h') git-kb code show Show one symbol's metadata and source lines
Show one symbol's metadata and source lines
Usage: git-kb code show [OPTIONS] <SYMBOL_ID>
Arguments:
<SYMBOL_ID> Exact symbol_id (as returned by `code map --detail symbols`, `code symbols --json`)
Options:
--max-lines <MAX_LINES> Lines of source returned at most; longer symbols are truncated [default: 400]
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help
Cyclomatic complexity = 1 + decision points in the symbol's own body: if / else-if, loops (for, while, loop), each non-default match/switch arm, && || ?? and/or, ternaries, catch/except clauses, and Rust `?` early exits. Nested named functions are scored on their own; closures count toward the enclosing function. Only functions and methods carry a value. git-kb code shape Show one function's control structure and complexity
Show one function's control structure and complexity
Usage: git-kb code shape [OPTIONS] <SYMBOL_ID>
Arguments:
<SYMBOL_ID> Exact symbol_id (as returned by `code map --detail symbols`, `code symbols --json`)
Options:
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help
Cyclomatic complexity = 1 + decision points in the symbol's own body: if / else-if, loops (for, while, loop), each non-default match/switch arm, && || ?? and/or, ternaries, catch/except clauses, and Rust `?` early exits. Nested named functions are scored on their own; closures count toward the enclosing function. Only functions and methods carry a value. git-kb code smart-context Assemble the code a task is about (its code links, the files it names, their callers and callees) within a token budget
Assemble the code a task is about (its code links, the files it names, their callers and callees) within a token budget
Usage: git-kb code smart-context [OPTIONS] <TASK>
Arguments:
<TASK> Slug of the task (or any document) to assemble context for
Options:
--token-budget <TOKEN_BUDGET> Tokens of context returned at most [default: 8000]
--no-callers Leave out the callers of the symbols the task names
--no-callees Leave out the callees of the symbols the task names
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--call-depth <CALL_DEPTH> Hops of the call graph followed from each symbol [default: 2]
-v, --verbose Log at debug level to stderr
--min-score <MIN_SCORE> Least relevance score an item needs to be included (0.0 to 1.0) [default: 0.3]
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--json Output as JSON. Agents and scripts should prefer this for stable, complete output
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code quality Run fixture-driven resolver quality checks
Run fixture-driven resolver quality checks
Usage: git-kb code quality [OPTIONS] <FIXTURE>
Arguments:
<FIXTURE> JSON fixture file, or a directory containing *.json fixtures
Options:
--json Output as JSON. Agents and scripts should prefer this for stable output
--markdown <MARKDOWN> Write a Markdown report to this path
--keep-temp Preserve temporary fixture directories for debugging
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code dump-ast Print the tree-sitter parse tree for a file
Print the tree-sitter parse tree for a file
Usage: git-kb code dump-ast [OPTIONS] <PATH>
Arguments:
<PATH> Path to the file to parse
Options:
--language <LANGUAGE> Override language detection (e.g., "rust", "python")
--lines <LINES> Only show nodes overlapping this line range (e.g., "10-25"). Lines are 1-indexed
--json Output as JSON instead of indented text. Agents and scripts should prefer this for stable, complete output
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code prune Remove stale branch symbols from the code index
Remove stale branch symbols from the code index
Usage: git-kb code prune [OPTIONS]
Options:
--worktree <WORKTREE> Prune symbols for the branch associated with the given worktree path. Derives branch from `git -C <path> rev-parse --abbrev-ref HEAD`. The worktree directory must still exist
--branch <BRANCH> Prune symbols for the named branch
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--repo <REPO> Scope `--branch` pruning to a single repo (matched by file_path prefix). Use when the same branch name exists across multiple repos in a meta workspace
--stale Scan all branches in the DB and prune those with no live git ref or active worktree
-v, --verbose Log at debug level to stderr
--dry-run Show what would be pruned without actually deleting
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--json Output the prune receipt as JSON. Agents and scripts should prefer this for stable, complete output
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code mcp Run the MCP server with the code tools (stdio)
Run the MCP server with the code tools (stdio)
Usage: git-kb code mcp [OPTIONS]
Options:
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code hook Agent hook adapters: read a hook event on stdin, print hook output
Agent hook adapters: read a hook event on stdin, print hook output
Usage: git-kb code hook [OPTIONS] <COMMAND>
Commands:
codeintel-enrich PostToolUse code-intelligence enrichment (Bash|Grep matcher)
help Print this message or the help of the given subcommand(s)
Options:
--no-refresh Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb code init Connect an agent to code intelligence: skills, rules, the search hook and the MCP server
Connect an agent to code intelligence: skills, rules, the search hook and the MCP server
Usage: git-kb code init [OPTIONS] <AGENT>
Arguments:
<AGENT>
The agent to set up
Possible values:
- claude: Claude Code (`.claude/`, `.mcp.json`, the search hook)
- cursor: Cursor (`.cursor/`, `.cursor/mcp.json`)
- windsurf: Windsurf (`.windsurf/`; its MCP config is global)
- codex: Codex (`.codex/skills`; with --install-hooks the plugin bundle)
- opencode: OpenCode (`.opencode/`, `opencode.json`)
- oh-my-pi: oh-my-pi (`.omp/`, `.omp/mcp.json`)
- grok: Grok Build (`.grok/`, `.grok/config.toml`)
- openclaw: OpenClaw (`.agents/`; its MCP config is global)
- antigravity: Google Antigravity (`.agents/`, `.agents/mcp_config.json`)
- pi: pi (`.pi/`; no built-in MCP)
Options:
--force
Replace skill and rule files that differ from the ones installed, and rebind a stale Antigravity MCP `cwd`
--dry-run
Show what would change without writing anything
--install-hooks
Codex only: install the plugin bundle (code hooks, a skill and the MCP server), add it to the project's marketplace and enable it in `$CODEX_HOME/config.toml`
--no-refresh
Answer from the index as it is: do not bring edited, deleted, or new files up to date before querying
--json
Output the list of changes as JSON
-v, --verbose
Log at debug level to stderr
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect
[default: auto]
[possible values: auto, always, never]
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect
[default: pretty]
[possible values: pretty, compact, json]
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
-h, --help
Print help (see a summary with '-h')Semantic search
git-kb semantic Semantic search for GitKB documents
Semantic search for GitKB documents
Usage: git-kb semantic [OPTIONS] <COMMAND>
Commands:
init Fetch the embedding model and create the empty index
index Embed the committed documents that are new or changed, and drop the ones that are gone
search Find the documents nearest in meaning to a query
status Show what the index holds against the documents as they are now
mcp Run the MCP server with the semantic tools (stdio)
connect Register the MCP server with a coding agent
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help
-V, --version Print version git-kb semantic init Fetch the embedding model and create the empty index
Fetch the embedding model and create the empty index
Usage: git-kb semantic init [OPTIONS]
Options:
--model <MODEL> Hugging Face model id (default: `[embeddings] model` in .kb/config.toml, else BAAI/bge-small-en-v1.5)
-v, --verbose Log at debug level to stderr
--force Replace an existing index with an empty one
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--json Output as JSON
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb semantic index Embed the committed documents that are new or changed, and drop the ones that are gone
Embed the committed documents that are new or changed, and drop the ones that are gone
Usage: git-kb semantic index [OPTIONS]
Options:
--force Embed every document again, changed or not
-v, --verbose Log at debug level to stderr
--json Output as JSON
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb semantic search Find the documents nearest in meaning to a query
Find the documents nearest in meaning to a query
Usage: git-kb semantic search [OPTIONS] <QUERY>
Arguments:
<QUERY> What to look for, in plain language
Options:
-n, --limit <LIMIT> Documents returned at most [default: 10]
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--threshold <THRESHOLD> Least similarity a document needs (0.0 to 1.0) [default: 0.5]
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--type <DOC_TYPE> Only documents of this type
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--status <STATUS> Only documents with this status
--hybrid Combine with keyword search: hand the semantic ranking to `git-kb search --rank-with`, which checks it against the current documents, fuses it with its keyword results and applies the filters. The output is `git-kb search`'s
--no-pager Accepted for compatibility with `git-kb`; has no effect
--json Output as JSON
--no-daemon Accepted for compatibility with `git-kb`; has no effect
--no-refresh Answer from the index as it is without embedding newly committed documents first
-h, --help Print help git-kb semantic status Show what the index holds against the documents as they are now
Show what the index holds against the documents as they are now
Usage: git-kb semantic status [OPTIONS]
Options:
--json Output as JSON
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb semantic mcp Run the MCP server with the semantic tools (stdio)
Run the MCP server with the semantic tools (stdio)
Usage: git-kb semantic mcp [OPTIONS]
Options:
-v, --verbose Log at debug level to stderr
-q, --quiet Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN> Accepted for compatibility with `git-kb`; has no effect [default: auto] [possible values: auto, always, never]
--log-format <FORMAT> Accepted for compatibility with `git-kb`; has no effect [default: pretty] [possible values: pretty, compact, json]
--no-pager Accepted for compatibility with `git-kb`; has no effect
--no-daemon Accepted for compatibility with `git-kb`; has no effect
-h, --help Print help git-kb semantic connect Register the MCP server with a coding agent
Register the MCP server with a coding agent
Usage: git-kb semantic connect [OPTIONS] <AGENT>
Arguments:
<AGENT>
The agent to connect
Possible values:
- claude: Claude Code (`.mcp.json`)
- cursor: Cursor (`.cursor/mcp.json`)
- opencode: OpenCode (`opencode.json`)
- oh-my-pi: oh-my-pi (`.omp/mcp.json`)
- grok: Grok Build (`.grok/config.toml`)
- codex: Codex (its MCP servers are configured per user)
- windsurf: Windsurf (its MCP config is global)
- openclaw: OpenClaw (its MCP config is global)
- antigravity: Google Antigravity (`.agents/mcp_config.json`)
- pi: pi (no built-in MCP)
Options:
--force
Antigravity only: replace an existing server entry to rebind a stale `cwd`
-v, --verbose
Log at debug level to stderr
--dry-run
Show what would change without writing anything
-q, --quiet
Suppress non-essential output (`index` prints no summary on stdout; `--json` output is unaffected)
--color <WHEN>
Accepted for compatibility with `git-kb`; has no effect
[default: auto]
[possible values: auto, always, never]
--json
Output as JSON
--log-format <FORMAT>
Accepted for compatibility with `git-kb`; has no effect
[default: pretty]
[possible values: pretty, compact, json]
--no-pager
Accepted for compatibility with `git-kb`; has no effect
--no-daemon
Accepted for compatibility with `git-kb`; has no effect
-h, --help
Print help (see a summary with '-h')Environment variables
GITKB_ROOT Override KB root discovery. Uses this path instead of searching upward for .kb/.GITKB_NO_DAEMON Set to 1 to avoid starting the daemon for store writes (equivalent to --no-daemon).