# GitKB — Full Documentation Source: https://gitkb.com/llms.txt Full content: https://gitkb.com/llms-full.txt GitKB is a knowledge base CLI and MCP tool for software engineering teams and AI agents. This file contains all documentation pages concatenated in navigation order, including agent harness setup, skills, MCP tools, and the CLI reference generated from src/lib/docs/cli-commands.ts. ──────────────────────────────────────────────────────────────────────── ## Introduction URL: https://gitkb.com/docs/ Section: Getting Started --- title: Introduction description: Learn how to use GitKB — a git-like distributed knowledge base with sparse sync and checkout semantics. --- # GitKB Documentation GitKB is a local-first knowledge graph for Markdown documents and source code. Create a document, check it out, edit it, commit the change, and sync the documents you need with a remote. Document history is tracked per document. A commit can change several documents, and each change points to the prior commit for that document. You can hold a small subset of a knowledge base without cloning every document or its unrelated history. ## How it fits together ```mermaid flowchart LR People["You and your agents"] --> Tools["CLI, Desktop and MCP"] Tools --> Daemon["Local GitKB daemon"] Daemon --> KB["Your knowledge base"] Daemon --> Intel["Code intelligence"] Code["Your code"] --> Intel KB <--> Remote["Your team's remote"] ``` - **Documents:** specs, tasks, decisions and the rest are Markdown files with a little frontmatter, linked to each other and to your code. - **History:** every change is a commit, so you can see who changed what, when and why, and return to any version. - **Agents:** any agent that can use a CLI or MCP reads and writes the same knowledge you do. - **Daemon:** a local GitKB daemon keeps your knowledge base and code index current, and serves both to the CLI, Desktop and MCP. See [Daemon](/docs/core-concepts/daemon/). - **Code intelligence:** GitKB indexes your code, so you and your agents can see callers, call paths and the reach of a change. - **Sharing:** push to a remote when your team needs it, pull the slices you select, and check out only the documents you need. ## Local work and collaboration Everything works locally and offline, with no account or server. When your team needs it, push to a remote, on GitKB.com or your own infrastructure, pull the slices you select, and check out only what you need. Knowledge keeps its own history, separate from your code's Git history, so document edits never clutter code diffs. Optional local embeddings add semantic search across documents and code. ## Quick overview ### Documents Everything in GitKB is a **document** with YAML frontmatter and Markdown content: ```yaml --- slug: tasks/my-feature title: "Add user authentication" type: task status: active tags: [feature, auth] --- ## Overview What this task accomplishes and why it exists. ## Acceptance Criteria - [ ] JWT-based auth flow - [ ] Session management - [ ] Tests passing ``` Documents have types (`task`, `spec`, `incident`, `note`, `context`), statuses, tags, and relationships to other documents via `[[wikilinks]]`. ### The knowledge graph Documents link to each other through wikilinks, frontmatter references, and code symbols — forming a **knowledge graph** you can query: ```bash git-kb graph tasks/my-feature --direction both ``` ### MCP integration Connect GitKB to your editor and AI assistants gain full access: ```json { "mcpServers": { "gitkb": { "command": "git-kb", "args": ["mcp"] } } } ``` The first store-backed tool call connects to the daemon and starts it if needed. MCP initialization and tool discovery can complete before the daemon starts. ## Next steps
Installation

Install GitKB and set up your first knowledge base.

Quick Start

Create your first documents and explore the CLI.

MCP Setup

Connect GitKB to Claude Code, Cursor, and other editors.

Agent Harnesses & Skills

Compare Claude Code, Codex, Cursor, Windsurf, and MCP clients.

Core Concepts

Understand documents, the knowledge graph, and code intelligence.

Migration & Adoption

Add GitKB to an existing project and roll it out to your team.

Configuration

Customize remotes, embeddings, code indexing, and more.

──────────────────────────────────────────────────────────────────────── ## Installation URL: https://gitkb.com/docs/getting-started/installation/ Section: Getting Started --- title: Installation description: Install GitKB and initialize your first knowledge base. --- # Installation ## Install the GitKB CLI GitKB is distributed as a single binary. Install it with your preferred method: ### Homebrew (macOS) ```bash brew install gitkb/tap/gitkb ``` ### Install script (macOS / Linux) ```bash curl -fsSL https://get.gitkb.com/install.sh | bash ``` ### mise Install release builds from GitHub via [mise](https://mise.jdx.dev/): ```bash mise use github:gitkb/gitkb-releases ``` Run in your project to record the tool in mise config, or configure globally per [mise docs](https://mise.jdx.dev/). ### Verify installation ```bash git-kb --version ``` If you use GitKB Desktop with mise, ensure your shell `PATH` includes mise shims, or choose the `git-kb` binary in Desktop Settings when the app is launched from Finder. ## Initialize a knowledge base Navigate to your project root and initialize: ```bash cd your-project git-kb init ``` This creates a `.kb/` directory in your project root with the knowledge base and its configuration. ## What's in `.kb/`? ``` .kb/ ├── .gitignore # Commits only the shared files below ├── config.toml # KB configuration ├── AGENTS.md # Agent guide for this KB ├── rules/ # Shared agent rules (when installed) ├── skills/ # Shared agent skills (when installed) └── workspaces/ # Pending edits, isolated by Git worktree └── main/ # Default checkout workspace ``` GitKB keeps your committed documents and history in its own local store under `.kb/`, along with indexes it can rebuild. Edit documents through the checkout workspace, then use `git-kb commit` to record the changes; leave every other file under `.kb/` to GitKB. The generated `.kb/.gitignore` commits only `.gitignore`, `config.toml`, `AGENTS.md`, `rules/` and `skills/` to your Git repository. The store, indexes, locks and workspaces stay local: teammates fetch documents from a remote or rebuild them. Add your own lines at the end of `.kb/.gitignore`; a later line wins. Ask GitKB for the current workspace rather than assuming a path, especially in a linked Git worktree: ```bash git-kb workspace resolve --json ``` ## Optional: colorized Markdown output GitKB can pipe `git-kb show` output through [glow](https://github.com/charmbracelet/glow) for syntax-highlighted, styled Markdown in your terminal. Install glow via Homebrew or [see glow's install docs](https://github.com/charmbracelet/glow#installation) for other methods: ```bash brew install glow ``` Then add to `.kb/config.toml`: ```toml [pager] markdown = "glow -p -w 0" ``` See [Configuration](/docs/reference/configuration/) for details. ## Start using code intelligence immediately Code intelligence works on any Git repo right after installation — no `git-kb init` required: ```bash cd your-project git-kb code index git-kb code symbols authenticate --json git-kb code callers authenticate --json ``` See [Code Intelligence](/docs/core-concepts/code-intelligence/) for the full command reference, or continue to the [Quick Start](/docs/getting-started/quick-start/) for the full setup. ## Next steps - [Quick Start](/docs/getting-started/quick-start/) — Create and sync project documents - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Start with code intelligence alone ──────────────────────────────────────────────────────────────────────── ## Quick Start URL: https://gitkb.com/docs/getting-started/quick-start/ Section: Getting Started --- title: Quick Start description: Index a Git repository, connect an agent, and create your first committed document. --- # Quick Start ## Explore a codebase After [installing GitKB](/docs/getting-started/installation/), index a Git repository. Local use is free and needs no account or server. Code commands can use a local index in Git's private metadata without a full knowledge base: ```bash cd your-project git-kb code index --json git-kb code symbols authenticate --json git-kb code callers authenticate --json git-kb code impact src/auth.ts --json ``` Replace the symbol and file names with ones from your repository. Callers, impact analysis, and dead-code reports describe the indexed graph. Review their evidence before changing code; a symbol with no indexed callers can still be used at runtime. ## Initialize a knowledge base Create a KB for tasks, specs, notes, and project context: ```bash git-kb init git-kb init claude # or: git-kb init codex ``` The harness integration installs GitKB workflows and project instructions. Claude's integration also registers the MCP server. For Codex and other clients, follow [MCP Setup](/docs/getting-started/mcp-setup/) to connect the tools. Ask your agent to read the project instructions and help capture the project's purpose, architecture, decisions, and current work. The scaffold supplies guidance; the agent and your review determine what goes into those documents. ## Create and commit a task GitKB documents are Markdown with YAML frontmatter. Creating a document writes a pending workspace file: ```bash git-kb create task --slug tasks/auth-refactor --title "Refactor auth module" --json git-kb workspace path tasks/auth-refactor --json git-kb status --json ``` Edit the path returned by `workspace path` to add the task's scope and acceptance criteria. Check the diff, then commit only that document: ```bash git-kb diff git-kb commit -m "Add auth refactor task" tasks/auth-refactor --json git-kb show tasks/auth-refactor --json ``` Checkout workspaces live under `.kb/workspaces//`. The main workspace is usually `.kb/workspaces/main/`; linked Git worktrees have their own identities. To edit an existing document: ```bash git-kb checkout tasks/auth-refactor git-kb workspace path tasks/auth-refactor --json # Edit the returned file, then inspect and commit it. git-kb diff git-kb commit -m "Update acceptance criteria" tasks/auth-refactor --json ``` `create`, `set`, and assignment commands leave pending edits. A KB commit records them in the canonical file store and updates the derived indexes. ## Find work and context ```bash git-kb list --type task --status active --json git-kb board --json git-kb search "authentication" --json git-kb graph tasks/auth-refactor --json git-kb context tasks/auth-refactor --code-refs --token-budget 4000 ``` Use `--json` for agents and scripts whenever the command supports it. Human-readable tables can shorten slugs and IDs. ## Share selected documents Configure a remote using the URL supplied by your hosted or self-hosted KB, then authenticate if it requires sign-in: ```bash git-kb remote add origin https://gitkb.com/api/v1/sync/your-org/your-kb git-kb login origin git-kb push origin tasks/auth-refactor git-kb pull origin context/ --json ``` Push and pull take an explicit remote. Pulling adds selected documents to your local store; checkout makes local documents editable. See [Team Collaboration](/docs/guides/team-collaboration/) for sparse sync and conflict recovery. ## Next steps - [Documents](/docs/core-concepts/documents/) — Types, frontmatter, and workspace edits - [MCP Setup](/docs/getting-started/mcp-setup/) — Connect your agent's tools - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Inspect the code graph - [Agent Workflows](/docs/guides/agent-workflows/) — Keep context and evidence between sessions ──────────────────────────────────────────────────────────────────────── ## MCP Setup URL: https://gitkb.com/docs/getting-started/mcp-setup/ Section: Getting Started --- title: MCP Setup description: Connect GitKB's local MCP server to your agent client and verify the intended knowledge base. --- # MCP Setup GitKB exposes **134 MCP tools** (`110` core via `git-kb mcp`, `21` code intelligence via `git-kb code mcp`, and `3` semantic search via `git-kb semantic mcp`) for documents, workspaces, sync, code intelligence, and project context. The [MCP Tools Reference](/docs/reference/mcp-tools/) lists them by category. ## How it works Your client launches `git-kb mcp` as a local stdio server. MCP initialization and tool discovery can complete before the daemon is running. A tool operation connects to the per-KB daemon and starts it when needed. Run the client in your project directory so GitKB discovers its `.kb/`. If the client launches servers elsewhere, configure `GITKB_ROOT` with the absolute project path. ## Claude Code The [Claude scaffold](/docs/getting-started/claude-code/) writes the root `.mcp.json` for you: ```bash git-kb init claude ``` For manual setup, add the server to `.mcp.json`: ```json { "mcpServers": { "gitkb": { "command": "git-kb", "args": ["mcp"] } } } ``` ## Codex Register the local server: ```bash codex mcp add gitkb -- git-kb mcp codex mcp list ``` You can also configure it in Codex's `config.toml`: ```toml [mcp_servers.gitkb] command = "git-kb" args = ["mcp"] [mcp_servers.gitkb.env] GITKB_ROOT = "/absolute/path/to/your-project" ``` The explicit root is useful when the server's working directory differs from the project. Codex supports user and trusted project configuration; see the [official OpenAI MCP documentation](https://developers.openai.com/codex/mcp). For GitKB workflow skills and project instructions, also run `git-kb init codex`. The optional hook bundle has its own MCP entry; see [Codex](/docs/getting-started/codex/) before combining installation methods. ## Other clients The same stdio command works with MCP clients that can launch local processes: | Client | GitKB scaffold | MCP configuration | | ----------------------- | ---------------------- | -------------------------------------------------------------------------- | | Cursor | `git-kb init cursor` | `.cursor/mcp.json` | | Windsurf | `git-kb init windsurf` | Use the global MCP settings described by the scaffold | | OpenCode | `git-kb init opencode` | `opencode.json` | | oh-my-pi | `git-kb init oh-my-pi` | `.omp/mcp.json` | | Grok Build | `git-kb init grok` | `.grok/config.toml` | | Cline and other clients | Manual | Add command `git-kb` with arguments `["mcp"]` in the client's MCP settings | Use `git-kb init --help` for its options, and `--dry-run` to preview generated files. Harnesses differ in whether they use project or global MCP configuration; the [harness reference](/docs/reference/agent-harnesses/) covers the supported integrations. For JSON clients that accept the `mcpServers` format, the server entry can include an explicit root: ```json { "mcpServers": { "gitkb": { "command": "git-kb", "args": ["mcp"], "env": { "GITKB_ROOT": "/absolute/path/to/your-project" } } } } ``` ## Verify an operation Restart or reconnect the client after changing configuration. Ask: > "Use GitKB to list the documents in this project's knowledge base." The assistant should call `kb_list`. Confirm that the returned documents belong to the intended project. Tool discovery alone verifies the stdio connection; a successful KB operation also exercises the daemon path. MCP writes follow the workspace-first model. Creating or updating a document normally leaves pending edits; use `kb_status`, `kb_diff`, and a scoped `kb_commit` to record them. Some tools offer an explicit `commit` option; inspect their schemas for that behavior. ## Troubleshooting | Problem | Check | | --------------------------------------- | ------------------------------------------------------------------------------- | | Server command not found | Make `git-kb` available to the client's process, or configure its absolute path | | Tools do not appear | Check the client's MCP status and reconnect after editing configuration | | Tools list works but an operation fails | Run `git-kb daemon status` and `git-kb doctor --json` in the project | | Wrong KB loaded | Set `GITKB_ROOT` in the server environment and reconnect | | Remote sync operation fails | Check authentication and run `git-kb sync status origin --json` | ## Next steps - [MCP Tools Reference](/docs/reference/mcp-tools/) — Tool inventory and parameters - [Claude Code](/docs/getting-started/claude-code/) — Rules, skills, and hooks - [Codex](/docs/getting-started/codex/) — Project instructions and optional hooks - [Agent Workflows](/docs/guides/agent-workflows/) — Turn tool operations into committed task evidence ──────────────────────────────────────────────────────────────────────── ## Agent Harnesses & Skills URL: https://gitkb.com/docs/reference/agent-harnesses/ Section: Getting Started --- title: Agent Harnesses & Skills description: GitKB harness installers, shared skills, MCP configuration, and hook support. --- # Agent Harnesses & Skills GitKB provides harness-specific installers and a stdio MCP server. Inspect `git-kb init --help` for the installers included in your binary. ## Integration paths | Harness | Setup command | Installed integration | | ------------------ | ----------------------------------- | ------------------------------------------------------------------------------- | | Claude Code | `git-kb init claude` | Claude rules, skills, project instructions, and MCP configuration. | | Codex | `git-kb init codex` | Codex skills and instructions; optional home installation or hook plugin. | | Cursor | `git-kb init cursor` | Cursor skills, rules, and `.cursor/mcp.json`. | | Windsurf | `git-kb init windsurf` | Windsurf skills, rules, and MCP configuration. | | OpenCode | `git-kb init opencode` | `.opencode/` skills and rules, plus `opencode.json` MCP configuration. | | oh-my-pi | `git-kb init oh-my-pi` | `.omp/` skills and rules, plus `.omp/mcp.json`. | | Grok Build | `git-kb init grok` | `.grok/` skills and rules, plus `.grok/config.toml`. | | OpenClaw | `git-kb init openclaw` | `.agents/` skills and rules; prints instructions for global MCP registration. | | Google Antigravity | `git-kb init antigravity` | `.agents/` skill and rule symlinks, `.agents/mcp_config.json`, and `AGENTS.md`. | | pi | `git-kb init pi` | `.pi/` skills and rules; MCP access requires a pi MCP extension. | | Generic MCP client | Run `git-kb mcp` through the client | Tool access through MCP; configure the client separately. | Preview an install before changing project files: ```bash git-kb init claude --dry-run git-kb init codex --dry-run git-kb init opencode --dry-run ``` The extra harness installers share GitKB's skills and rules. They do not all implement the same lifecycle hooks. Check each command's help and generated assets for the integration you use. ## Shared skill content The installers keep canonical project workflows under `.kb/skills/` and common rules under `.kb/rules/`. Harness directories expose those assets in their native layout, usually through symlinks. ```text .kb/skills/ # Shared GitKB workflows .kb/rules/ # Shared code-intelligence and KB rules .claude/skills/ # Claude Code skill adapters .codex/skills/ # Codex skill adapters .cursor/skills/ # Cursor skill adapters .windsurf/skills/ # Windsurf skill adapters ``` ## Included skills | Area | Skills | | ---------------------- | ------------------------------------------------------------------------------ | | KB operations and sync | `gitkb`, `remote-sync` | | Task workflow | `kb-board`, `kb-tasks`, `kb-start`, `kb-progress`, `kb-review`, `kb-close` | | Knowledge management | `kb-create`, `kb-search`, `kb-context`, `kb-status`, `kb-commit`, `kb-handoff` | | Code intelligence | `code-intelligence`, `explore`, `understand`, `refactor-safety` | Skills provide workflow instructions. MCP tools provide structured operations. An agent follows the operator's task and project rules when deciding which operations to run. ## Codex options ```bash # Preview a home-level asset installation git-kb init codex --install-home --dry-run # Preview the GitKB plugin bundle, including hooks and MCP configuration git-kb init codex --install-hooks --dry-run ``` `--install-home` installs skills and instructions under `CODEX_HOME`; `--copy` copies assets instead of symlinking them. `--install-hooks` installs the GitKB Codex plugin bundle. Review the preview, then run the same command without `--dry-run` to install. ## Generic MCP clients Configure a stdio server with command `git-kb` and argument `mcp`. Set the project working directory or `GITKB_ROOT` so the server selects the intended KB. Use [MCP Setup](/docs/getting-started/mcp-setup/) for configuration examples. ## Related docs - [Claude Code](/docs/getting-started/claude-code/) — Claude setup. - [Codex](/docs/getting-started/codex/) — Codex setup. - [Agent Workflows](/docs/guides/agent-workflows/) — Tasks, checkouts, and verification. - [MCP Tools](/docs/reference/mcp-tools/) — Tool reference. - [CLI Reference](/docs/cli-reference/) — Installed command help. ──────────────────────────────────────────────────────────────────────── ## Claude Code URL: https://gitkb.com/docs/getting-started/claude-code/ Section: Getting Started --- title: Claude Code description: Install GitKB workflows, project rules, hooks, and MCP configuration for Claude Code. --- # GitKB with Claude Code GitKB's Claude Code integration installs project guidance, reusable skills, session hooks, and a local MCP server entry. ## Scaffold the integration After [initializing your KB](/docs/getting-started/quick-start/), preview the generated files: ```bash git-kb init claude --dry-run git-kb init claude ``` The scaffold installs these files at the KB root: ```text .kb/ ├── skills/ # Canonical GitKB workflow skills └── rules/ # Canonical project rules .claude/ ├── skills/ # Links to .kb/skills/ ├── rules/ # Links to .kb/rules/.md └── settings.json # SessionStart and PreToolUse hooks .mcp.json # gitkb server: git-kb mcp CLAUDE.md # GitKB section pointing to .kb/AGENTS.md ``` The MCP server lives in the root `.mcp.json`. `.claude/settings.json` contains hooks: a session hook starts the daemon if needed, and a tool hook supplies code-intelligence guidance for supported tool calls. The installer merges the MCP configuration and `CLAUDE.md` section with existing content. Existing workflow templates are kept unless you request an update with `--force`. Review the dry run before replacing customized templates: ```bash git-kb init claude --force --dry-run ``` ## Workflows and rules The generated rules cover code intelligence, refactoring safety, and knowledge management. Skills include `gitkb`, `code-intelligence`, `explore`, `understand`, `refactor-safety`, `remote-sync`, and task workflows such as `kb-start`, `kb-review`, and `kb-close`. The canonical skills are under `.kb/skills/`; the Claude entries point to them. See [Agent Harnesses & Skills](/docs/reference/agent-harnesses/) for the full inventory. ## Use the integration Start Claude Code in the project and enable the GitKB MCP server when prompted. Ask for a concrete read to check the connection: > "Use GitKB to show the task board and read the project context." For code work: > "Find the callers of authenticate, then show the impact of changing src/auth.ts." For a task: > "Read tasks/auth-refactor, implement its acceptance criteria, and record the verification results in the task." The instructions guide the workflow. Check the resulting source, command output, and task evidence before treating the work as complete. ## Next steps - [MCP Setup](/docs/getting-started/mcp-setup/) — Manual server configuration and connection checks - [Codex](/docs/getting-started/codex/) — Codex integration - [Agent Workflows](/docs/guides/agent-workflows/) — Context, assignment, and committed evidence - [CLI Reference](/docs/cli-reference/) — `init` options ──────────────────────────────────────────────────────────────────────── ## Codex URL: https://gitkb.com/docs/getting-started/codex/ Section: Getting Started --- title: Codex description: Install GitKB skills and project instructions for Codex, with optional home and hook integration. --- # GitKB with Codex GitKB's Codex integration installs reusable workflows and a project instruction entry point. Connect the MCP server separately to give Codex access to the KB tools. ## Scaffold project guidance After [initializing your KB](/docs/getting-started/quick-start/), preview and install the integration: ```bash git-kb init codex --dry-run git-kb init codex ``` The scaffold creates: ```text .kb/skills/ # Canonical GitKB workflow skills .codex/ ├── skills/ # Links to .kb/skills/ └── instructions/ ├── codex-rules.md └── gitkb-process.md AGENTS.md # GitKB workflow section and .kb/AGENTS.md pointer ``` The root `AGENTS.md` supplies the project entry point. The installer preserves existing content while adding its GitKB section. Skills include `remote-sync` alongside code-intelligence and task workflows; see [Agent Harnesses & Skills](/docs/reference/agent-harnesses/) for the inventory. ## Connect MCP Register the stdio server: ```bash codex mcp add gitkb -- git-kb mcp codex mcp list ``` Codex stores MCP settings in its `config.toml`. Run sessions in the project so GitKB finds the intended `.kb/`, or set `GITKB_ROOT` explicitly in the server configuration. See [MCP Setup](/docs/getting-started/mcp-setup/) and the [official OpenAI MCP documentation](https://developers.openai.com/codex/mcp). ## Optional home installation To expose the integration through your Codex home, run: ```bash git-kb init codex --install-home ``` This uses `$CODEX_HOME` when set, otherwise `~/.codex`. Use `--copy` when you want copied assets instead of symlinks. Preview either operation with `--dry-run`. ## Optional hooks Install GitKB's Codex plugin bundle explicitly when you want its code-intelligence hooks: ```bash git-kb init codex --install-hooks --dry-run git-kb init codex --install-hooks ``` This writes the plugin bundle under `.codex/plugins/gitkb/` and registers it with Codex. Restart Codex, then review the installed hooks with `/hooks`, as the installer instructs. The bundle includes MCP configuration; inspect existing server entries when combining it with a manual MCP setup. ## Example workflow The same commands are available through the CLI or corresponding MCP tools: ```bash git-kb context --compact --code-refs git-kb board --json git-kb checkout tasks/auth-refactor git-kb workspace path tasks/auth-refactor --json git-kb code callers authenticate --json # Edit the task's workspace file to record findings and verification. git-kb commit -m "Record auth refactor verification" tasks/auth-refactor --json ``` Keep the task's scope, acceptance criteria, and actual verification results together so another session can continue from the evidence. ## Next steps - [Claude Code](/docs/getting-started/claude-code/) — Claude integration - [Agent Workflows](/docs/guides/agent-workflows/) — Session and task workflow - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Symbols, calls, and impact - [CLI Reference](/docs/cli-reference/) — `init codex` options ──────────────────────────────────────────────────────────────────────── ## Knowledge Engineering URL: https://gitkb.com/docs/core-concepts/knowledge-engineering/ Section: Core Concepts --- title: Knowledge Engineering description: What GitKB means by knowledge engineering, and how a knowledge base becomes the source that working software is built from. --- # Knowledge Engineering **Everything is context. Software engineering becomes knowledge engineering.** Knowledge engineering is the discipline of building systems where knowledge is structured, versioned, connected to code and queryable by both people and agents, so that what a team knows compounds over time. For agents to build working software, a team engineers the knowledge system they work from: the specifications, invariants, decisions, research and tasks that define what correct means. Code and working software emerge from that knowledge base. GitKB is the set of tools for engineering it. ## Knowledge first, software follows Each layer narrows the one below it. Research informs decisions, decisions shape specifications and their invariants, specifications define tasks, and agents turn tasks into code. Tests, reviews and incidents return as evidence that changes the next decision. ```mermaid flowchart TD R[Research] --> D[Decisions] D --> S[Specifications and invariants] S --> T[Tasks] T --> A[Agents write the code] A --> E[Tests, reviews and incidents] E -->|evidence| D ``` The document is the plan. A task says what to do and links to the specification it implements; the specification says what must hold; the decision says why. An agent that reads the task through those links has the intent behind the code, not only the code. ## What a knowledge base holds | Knowledge | What it captures | How GitKB stores it | | -------------- | ------------------------------------------------------- | -------------------------------------------- | | Specifications | Behavior the system provides and the contracts it keeps | `spec` documents | | Invariants | Properties every implementation and migration preserves | Sections of the specification they belong to | | Decisions | What was chosen, the alternatives and why | `decision` documents | | Research | Findings, measurements and sources behind a decision | `note` documents | | Tasks | Executable work, acceptance criteria and progress | `task` documents | | Incidents | What failed, why and what changed | `incident` documents | Every document is Markdown with YAML frontmatter, stored in `.kb/` beside your code. See [Documents](/docs/core-concepts/documents/) for types, statuses and fields. ## The practices GitKB supports | Practice | Mechanism | | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Structure | Typed documents with status, priority, tags and custom fields | | Connection | Graph edges such as `implements`, `depends_on` and `blocked_by`, plus wikilinks to documents, code symbols and commits ([Knowledge Graph](/docs/core-concepts/knowledge-graph/)) | | Grounding in code | A code intelligence index of symbols, callers and callees, linked from documents with `[[code:path::symbol]]` ([Code Intelligence](/docs/core-concepts/code-intelligence/)) | | Versioning | A per-document commit history with SHA-256 hashes, separate from your repository's Git history | | Sharing | Push and pull commits, and check out only the documents you need | | Agent access | An MCP server and the `git-kb` CLI; `kb_smart_context` assembles a task's linked documents and code within a token budget | ## A working loop A specification states what must hold, a task implements it, and the agent starts from both: ```markdown --- title: Make the login handler async type: task implements: [specs/session-auth] --- Keep the refresh behind the lock: [[decisions/jwt-rotation]]. The entrypoint is [[code:src/auth.rs::login_handler]]. ``` ```bash # Inspect what the task connects to git-kb graph tasks/login-async --direction both --depth 2 --json # See what an edit to the entrypoint reaches git-kb code callers 'src/auth.rs::login_handler' --json # Record progress and share it git-kb commit -m "Login handler async; refresh stays behind the lock" tasks/login-async git-kb push origin ``` The next session, in any agent, reads the same task, its specification and its decisions, and continues from the recorded progress. ## Next steps - [From Context Engineering to Knowledge Engineering](/blog/knowledge-engineering/): the argument behind the practice. - [Documents](/docs/core-concepts/documents/): types, frontmatter and lifecycle. - [Knowledge Graph](/docs/core-concepts/knowledge-graph/): relationships and queries. - [Agent workflows](/docs/guides/agent-workflows/): how agents read and update the knowledge base. ──────────────────────────────────────────────────────────────────────── ## Documents URL: https://gitkb.com/docs/core-concepts/documents/ Section: Core Concepts --- title: Documents description: Document types, frontmatter, workspaces, commits, and history. --- # Documents A GitKB document has a stable identity, a slug, YAML frontmatter, and a Markdown body. The slug is its readable address, such as `tasks/auth-flow`. Renaming a slug preserves document identity and records a change in history. ## Types and frontmatter Use types to distinguish intent: tasks describe work, specs describe behavior, incidents describe failures, and notes hold general knowledge. The built-in types are `task`, `spec`, `note`, `decision`, `skill`, `reference` and `incident`, and custom types work too. Context documents, which hold project state, are any documents under the `context/` slug folder by convention; view documents hold saved queries. ```yaml --- slug: tasks/auth-flow title: Implement authentication type: task status: active priority: high tags: [auth, api] parent: tasks/auth-epic blocked_by: [tasks/session-store] implements: [specs/auth] --- ## Acceptance criteria - [ ] Sign-in creates a session. - [ ] Expired sessions are rejected. ``` `git-kb create` supplies identity and version metadata. Give it a type and title, and either choose a slug or let GitKB derive one. Status is a string, so your project can choose values such as `draft`, `backlog`, `active`, `blocked`, and `completed`; these are conventions rather than an enforced transition sequence. Common fields include `priority`, `tags`, `assignee`, `agent_id`, `worktree`, `parent`, `blocked_by`, `depends_on`, `implements`, `references`, and `external_refs`. `assignee` identifies the assigned person or agent; `agent_id` is a separate agent/session binding. Graph-derived fields such as `blocks` should be understood through the [knowledge graph](/docs/core-concepts/knowledge-graph/). ## The editing lifecycle ```mermaid flowchart TD Create["create: pending document"] --> Edit["Edit workspace Markdown"] Checkout["checkout: editable copy"] --> Edit Edit --> Review["status and diff"] Review --> Commit["commit: record history"] Commit --> Push["push: publish selected work"] Pull["pull: acquire documents"] --> Checkout Commit --> Checkout ``` Create a document in the current workspace: ```bash git-kb create task --slug tasks/auth-flow --title "Implement authentication" --json git-kb workspace path tasks/auth-flow --json ``` Edit the returned file, then commit it: ```bash git-kb status --json git-kb diff git-kb commit -m "Define authentication work" tasks/auth-flow ``` For an existing document, start with `git-kb checkout tasks/auth-flow`. Workspace paths are `.kb/workspaces//...`; use `git-kb workspace path` rather than assuming the name, especially in linked Git worktrees. Metadata updates use the same workflow: ```bash git-kb set tasks/auth-flow status=completed priority=high git-kb diff git-kb commit -m "Complete authentication work" tasks/auth-flow ``` `set` leaves a pending workspace edit. With several agents or several changed documents, always pass the slugs you changed to `commit`. ## Canonical storage and history Committed documents, commits, document tips and stashes live in GitKB's local store under `.kb/`. Workspace files are pending edits. Query indexes are derived from the store and can be rebuilt. Each document change records its version and previous document commit. SHA-256 hashes connect the new document bytes to the prior version's hash. Commit IDs are SHA-256 content hashes. The ancestry belongs to each document, so a commit touching several documents can link to a different predecessor for each one. Inspect a document and its history with: ```bash git-kb show tasks/auth-flow --json git-kb log tasks/auth-flow --json ``` ## Querying ```bash git-kb list --type task --status active --tags auth --json git-kb list --assigned-to agent-1 --json git-kb list --unassigned --unblocked --json git-kb search "authentication session" --json git-kb search "authentication session" --all-terms --json ``` Keyword search ranks matches in titles, content, and tags. `--all-terms` requires every query term. Use JSON in scripts to retain complete slugs, IDs, and stable fields. With semantic search initialized and indexed, semantic search can find related documents by meaning: ```bash git-kb semantic search "session expiration" --json ``` Embeddings are generated and searched locally; they are not synced. See [configuration](/docs/reference/configuration/) for model settings. ## Assignment ```bash git-kb assign tasks/auth-flow agent-1 --json git-kb commit -m "Assign authentication work" tasks/auth-flow ``` Assignment updates `assignee` and rejects a conflicting owner unless `--force` is supplied. It is local to the KB's current state; sync carries committed changes to other peers. Use `git-kb unassign tasks/auth-flow` to clear the binding, then commit that edit. ## Saved views A `view` document stores a query. Save board flags, then run the view against current data: ```bash git-kb board --group-by priority --type task --save views/task-priorities git-kb view views/task-priorities --json ``` ## Next steps - [Knowledge Graph](/docs/core-concepts/knowledge-graph/) — Relationships, containment, and code references - [Team Collaboration](/docs/guides/team-collaboration/) — Sparse sync and remote recovery - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Connect documents to source code ──────────────────────────────────────────────────────────────────────── ## Knowledge Graph URL: https://gitkb.com/docs/core-concepts/knowledge-graph/ Section: Core Concepts --- title: Knowledge Graph description: Link documents, inspect dependencies, and connect knowledge to code. --- # Knowledge Graph GitKB extracts relationships from Markdown and frontmatter into a queryable graph. Committing a document updates its canonical content and derived relationships. The daemon can also preview relationships from valid workspace edits before commit. ## Relationships | Relationship | How to write it | Direction | |---|---|---| | `references` | `[[specs/auth]]` in the body, or `references: [specs/auth]` | This document → target | | `parent_of` | `parent: tasks/auth-epic` | Parent → this document | | `implements` | `implements: [specs/auth]` | This document → spec | | `blocks` | `blocked_by: [tasks/session-store]` | Blocker → this document | | `depends_on` | `depends_on: [tasks/session-store]` | This document → dependency | | `references_code` | `[[code:src/auth.rs::login]]` | Document → code reference | | `references_commit` | `[[commit:core@abc1234]]` | Document → source Git commit reference | `blocks` is derived from the graph. Write `blocked_by` on the blocked document to create a blocking edge. A sentence saying that a task “resolves” an incident creates a `references` edge when it contains a wikilink; the wording does not create a separate `resolves` relationship. For example: ```markdown This task implements [[specs/auth]]. See [[code:src/auth.rs::login]] for the entrypoint. The source change is recorded in [[commit:core@abc1234]]. ``` The repository name in a commit reference corresponds to the configured repository registry. Code references support file and symbol targets; use complete IDs from code-intelligence JSON when resolving an ambiguous symbol. ## Querying ```bash # Both directions, two levels deep git-kb graph tasks/auth-flow --direction both --depth 2 --json # Who points to this document? git-kb graph specs/auth --direction in --json # What does this document point to? git-kb graph tasks/auth-flow --direction out --json # Restrict edge types or combine roots git-kb graph tasks/auth-flow --rel-type depends_on --json git-kb graph tasks/auth-flow specs/auth --json ``` Supported graph formats are `tree`, `json`, `dot`, `mermaid-gantt`, and `plan`. Use JSON for scripts and agents. `--critical-path` identifies the longest dependency chain; `--format plan` returns a dependency-ordered execution plan. ## Containers and ordering Container membership is separate from semantic relationships. Use `link`, `unlink`, and `reorder` for ordered collections of documents: ```bash git-kb link tasks/auth-flow --to specs/auth ``` Review pending changes and commit the affected document. See [CLI Reference](/docs/cli-reference/) for code links, commit links, and ordering options. ## Previewing changes ```bash git-kb status --json git-kb diff ``` `status` reports pending workspace state and graph changes; `diff` shows the content and metadata edits behind them. Invalid workspace documents can produce validation events instead of a graph projection. Correct the frontmatter or Markdown and review again before committing. ## External references and apps The `external_refs` frontmatter field records references to external systems. Enabled local apps can add descriptors that derive external references from document data. These are query projections; app installation and configuration are local to the machine. ```bash git-kb app list --json git-kb external-refs --help ``` ## Next steps - [Documents](/docs/core-concepts/documents/) — Workspace editing and canonical history - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Call graphs, impact, and document references - [Agent Workflows](/docs/guides/agent-workflows/) — Load and traverse task context ──────────────────────────────────────────────────────────────────────── ## Code Intelligence URL: https://gitkb.com/docs/core-concepts/code-intelligence/ Section: Core Concepts --- title: Code Intelligence description: Explore indexed symbols, calls, imports, execution flows, and change impact in a Git repository. --- # Code Intelligence GitKB parses source files with tree-sitter and builds an index of symbols, calls, imports, and implementation relationships. Use it to locate definitions, trace callers and callees, and inspect the likely impact of a change. ## Start with a Git repository Code intelligence works in a Git repository without `git-kb init`: ```bash cd your-project git-kb code index --json git-kb code symbols validateToken --json git-kb code callers validateToken --json ``` Without a knowledge base, the index lives in Git's private metadata. In an initialized KB, it lives in the KB's local indexes and can connect code symbols to documents. Ordinary CLI code queries read the index directly; they do not require a daemon or an embedding model. See [Supported Languages](/docs/reference/supported-languages/) for file extensions and differences in extraction coverage. ## Indexing ```bash # Index the current directory git-kb code index --json # Index a directory or a file git-kb code index src/ --json git-kb code index src/auth.ts --json # Preview the files without storing an index git-kb code index --dry-run --json # Rebuild changed files and remove entries for files that no longer exist git-kb code index --prune src/ --json ``` Indexing respects `.gitignore` and `.gitkbignore`. Use `.gitkbignore` to exclude generated code or fixtures that you still track in Git. Content hashes let subsequent runs skip unchanged files. In a full KB, the [daemon](/docs/core-concepts/daemon/) watches registered source roots and schedules incremental indexing after changes. Without it, re-run `git-kb code index` to refresh the index. ## Definitions and call relationships ```bash # List definitions in a file git-kb code symbols --file src/auth.ts --json # Find direct callers and callees git-kb code callers validateToken --json git-kb code callees login --json # Follow additional levels of callers git-kb code callers validateToken --depth 2 --json ``` A name can match several symbols. Copy the complete `symbol_id` from JSON output when you need one exact definition. Add `--strict` to callers or callees to reject an ambiguous name. Call resolution uses names, imports, implementation relationships, and language-specific hints. Dynamic dispatch, macros, generated code, and unsupported syntax can leave calls unresolved. The graph describes indexed relationships; inspect the source and index health when a missing edge matters. ## Change impact and unused-code candidates ```bash # Direct callers of symbols in this file git-kb code impact src/auth.ts --json # Expand the traversal git-kb code impact src/auth.ts --depth 2 --json # Find unused-code candidates in a file, with classification evidence git-kb code dead --file src/auth.ts --explain --json ``` Impact analysis follows recorded call edges up to the requested depth and result limit. Dead-code analysis finds symbols without recorded callers and filters inferred entrypoints, public symbols, and tests by default. Use `--include-entrypoints`, `--include-public`, or `--include-tests` to inspect those groups. Treat candidates as a review list before deleting code. ## Entrypoints, flows, and graph queries ```bash # Refresh inferred entrypoints and execution flows git-kb code entrypoints --refresh --json git-kb code flows --refresh --json git-kb code flow --json # Run typed query templates git-kb code query hotspots --json git-kb code query unresolved-by-reason --json git-kb code query dead-code-explain --json ``` Entrypoints and flows are derived from the indexed graph. Query templates also cover public APIs, routes, cross-file coverage, and cross-service impact. Run `git-kb code query --help` for the available templates and options. ## Inspect source and structure ```bash # Return files, symbols, and health as one payload git-kb code map --path-prefix src/ --detail symbols --json # Use an exact symbol ID from the symbols or map output git-kb code show --json git-kb code shape --json # Return a caller/callee subgraph git-kb code graph validateToken --depth 2 --json # Inspect the parser's syntax tree git-kb code dump-ast src/auth.ts --lines 10-25 --json ``` `show` returns metadata and source lines. `shape` returns a function's control structure and cyclomatic complexity. `graph` returns nodes and edges for a symbol neighborhood or a whole file. ## Branches and linked worktrees Indexing detects the Git branch; `--branch` overrides it. Queries normally use the configured default branch. An explicit `--branch` applies overlay semantics: indexed feature-branch files override their default-branch counterparts, while other files use the default index. ```bash git-kb code index --worktree /path/to/worktree --json git-kb code callers validateToken --branch feature/auth --json # Preview removal of indexes for branches that are no longer live git-kb code prune --stale --dry-run --json ``` Configure per-repository default branches under `[code.repo_default_branch_map]` in `.kb/config.toml` when repositories do not use `main`. `code prune` removes branch indexes; `code index --prune` removes entries for deleted files. ## Link documents to code In a full KB, use a code wikilink in a document: ```markdown The auth refactor changes [[code:src/auth.ts::validateToken]]. ``` GitKB extracts `references_code` relationships. Find the documents that reference a symbol with: ```bash git-kb code docs src/auth.ts::validateToken --json ``` `git-kb code refs ` finds where a name is used in code instead. ## Check index health ```bash git-kb code stats --json git-kb code doctor --json ``` Use these when a file is missing, calls remain unresolved, or results look stale. If `edges_pending_files` is nonzero, some files still need their call edges rebuilt; zero callers for those files is incomplete evidence. Re-run indexing for the affected paths. `git-kb code index --force` rebuilds even files whose content hashes are unchanged. ## Next steps - [Daemon](/docs/core-concepts/daemon/) — Source watching and background services - [Supported Languages](/docs/reference/supported-languages/) — Extraction coverage - [CLI Reference](/docs/cli-reference/) — Commands and flags ──────────────────────────────────────────────────────────────────────── ## Daemon URL: https://gitkb.com/docs/core-concepts/daemon/ Section: Core Concepts --- title: Daemon description: The per-KB service for MCP requests, sync, file watching, incremental indexing, events, and embeddings. --- # Daemon The GitKB daemon provides a shared service for one knowledge base. It handles MCP requests, keeps the knowledge base in sync with its default remote, watches document workspaces and source files, schedules indexing, and manages embeddings and event subscriptions. CLI commands that write to the knowledge base go through the daemon and start one if none is running; a running daemon is always used. To write without starting one, pass `--no-daemon` (or set `GITKB_NO_DAEMON=1` or `daemon.auto_start = false`). Read-only code queries such as `git-kb code callers` read the local index directly. ## Architecture On macOS and Linux, clients normally connect through `.kb/.cache/gitkb.sock`. Deeply nested KB paths use a hashed socket path under `/tmp` when the normal path exceeds the platform limit. Windows uses a named pipe derived from the KB root. ```mermaid flowchart TD Files[Source file changes] --> Watcher[Source watcher] Watcher -->|Debounced file events| Events[Event bus] Events --> Pipeline[Incremental index pipeline] Pipeline --> Index[Persisted code index] CLI[CLI code queries] --> Index Agent[Agent MCP client] --> MCP[git-kb mcp] MCP --> Socket[Per-KB socket] Socket --> Daemon[Daemon handlers] Daemon --> Index ``` The watcher reports changes; the index pipeline extracts symbols and resolves relationships. Queries read the resulting index. Separate KBs have separate daemon endpoints. ## Start and inspect MCP and commands that write to the knowledge base start the daemon automatically. ```bash # Run in the foreground git-kb daemon start # Or start a background process git-kb daemon start --background # Inspect status and registered workspaces git-kb daemon status --json git-kb workspace list --json # Stop or restart git-kb daemon stop git-kb daemon restart ``` Use `git-kb workspace status --json` and `git-kb code doctor --json` to check workspace checkouts and repository indexing state. Commands that need the daemon start a lease-scoped one automatically; it can stop once no command is using it. Start a daemon yourself (`git-kb daemon start --background`) when you want it to keep running, for example to keep the knowledge base in sync. ## Sync A running daemon keeps the knowledge base converged with its **default remote**: on an interval (`daemon.sync_interval_secs`) it runs the automatic sync steps — pull, replay your unpublished commits, publish — so a healthy knowledge base stays in sync without commands. - It stops at anything that needs a decision, such as a conflict. `git-kb sync status --json` lists those rows and the command each one needs. - It never writes into a document you are editing. That document waits until you commit or pull it yourself. - Other remotes sync only when you run `git-kb sync converge `. ## File watching The source watcher respects `.gitignore` and `.gitkbignore` and batches rapid saves with a default 500 ms debounce. It publishes file-change events, and the daemon schedules incremental indexing for registered source roots and linked worktrees. ```bash git-kb code index src/ --json git-kb daemon status --json ``` Indexing is asynchronous. A saved file can still be waiting in a batch or indexing queue when a query runs. Check `git-kb code doctor --json` and daemon logs if results are missing or stale. The workspace watcher monitors `.kb/workspaces/` for document edits. Those files remain pending edits until an explicit `git-kb commit`; watching does not commit your work. ## Embeddings Initialize local semantic search and index committed documents on demand: ```bash git-kb semantic init git-kb semantic index --json git-kb semantic status --json ``` See [Configuration](/docs/reference/configuration/) for `[embeddings]` settings (`backend`, `model`, `batch_size`, `batch_delay_ms`). Model loading initializes lazily on demand; document and code services remain available while embeddings initialize, and memory use depends on the selected model, backend, and vector indexes. ## Events Subscribe to the daemon's event stream from the CLI: ```bash git-kb events --filter 'code:*' --count 10 --idle-timeout 30 ``` Events let integrations observe KB and code-index changes without repeatedly querying for updates. The CLI exposes filters and NDJSON output; see [CLI Reference](/docs/cli-reference/) for the current options. ## Logs and diagnostics ```bash # Inspect recent background-process logs git-kb daemon logs --tail 100 # Follow new log entries git-kb daemon logs --follow # Run a foreground daemon with verbose logging git-kb --verbose daemon start # Inspect configuration and code-index health git-kb doctor --json git-kb code doctor --json ``` Foreground logs go to the terminal. A background daemon writes `.kb/.cache/daemon.log`. ## Next steps - [MCP Setup](/docs/getting-started/mcp-setup/) — Connect an agent to the service - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Query indexed code - [Configuration](/docs/reference/configuration/) — Configure the KB - [Troubleshooting](/docs/reference/troubleshooting/) — Diagnose service problems ──────────────────────────────────────────────────────────────────────── ## Agent Workflows URL: https://gitkb.com/docs/guides/agent-workflows/ Section: Guides --- title: Agent Workflows description: Use project context, scoped tasks, code intelligence, and committed evidence across agent sessions. --- # Agent Workflows GitKB keeps project knowledge outside an agent's conversation. A session can read committed context, work within a task, and leave evidence for the next session. ## Start with context and scope A practical session loop is: 1. Read the project's agent instructions and context. 2. Inspect active tasks and blockers. 3. Read the selected task's scope and acceptance criteria. 4. Implement the scoped change and run its checks. 5. Update the task with the changed files and actual check results, then commit it. ```bash git-kb context --compact --code-refs git-kb board --json git-kb context tasks/auth-refactor --code-refs --token-budget 4000 ``` The positional document slug selects a graph-aware context bundle. Without a slug, `context` produces session bootstrap context. `--compact` omits document bodies from bootstrap output; use the document form when you need task content within a token budget. ## Project instructions and skills The harness scaffold installs an entry point to GitKB's project workflow. Claude uses a root `CLAUDE.md` section and `.claude/` assets; Codex gets a root `AGENTS.md` section and `.codex/` assets. Generic MCP clients need project instructions supplied through their own configuration. MCP exposes tools and server guidance; it does not make every client load arbitrary local instruction files. The canonical skills live under `.kb/skills/`, with harness adapters pointing to them: | Phase | Skills | | ----------------------- | --------------------------------------------------------------- | | Orient | `gitkb`, `kb-context`, `kb-board`, `kb-tasks` | | Start | `kb-start`, `kb-create`, `kb-search` | | Understand code | `code-intelligence`, `explore`, `understand`, `refactor-safety` | | Inspect progress | `kb-status`, `kb-progress`, `kb-review` | | Finish | `kb-close`, `kb-commit`, `kb-handoff` | | Resolve sync divergence | `remote-sync` | See [Agent Harnesses & Skills](/docs/reference/agent-harnesses/) for installation details. ## Keep context focused A common scaffold convention groups context by stability: | Path | Content | | ---------------------- | ------------------------------------- | | `context/immutable/` | Project brief, architecture, patterns | | `context/extensible/` | Product and technology context | | `context/overridable/` | Active work and progress | These are workflow conventions, not storage restrictions. Update them when the project changes. Keep task scope, decisions, and verification in the task document so later sessions can trace the work. ## Select ready work `git-kb ready` ranks eligible tasks using priority, blocking fanout, recency, and document type. It filters out work that is already assigned, blocked, or completed: ```bash git-kb ready --json git-kb ready --limit 3 --json git-kb ready --context --budget 12000 ``` The JSON result has a `tasks` array. For a script using `jq`, extract a candidate with: ```bash task_slug=$(git-kb ready --json | jq -r '.tasks[0].slug // empty') ``` Selection is a read of the current local KB. Another worker can select the same candidate before an assignment is committed and shared. ## Record assignment and status `assign` checks the document's current committed assignee and rejects a different existing assignee unless forced. Like `set`, it stages a workspace edit. Commit the assignment before relying on it in subsequent committed-state queries: ```bash git-kb assign tasks/auth-refactor agent-alex --json git-kb set tasks/auth-refactor status=active git-kb diff git-kb commit -m "Assign auth refactor" tasks/auth-refactor --json ``` For a remote team, publish the assignment with `git-kb push origin tasks/auth-refactor`. Assignment helps coordinate work, but separate replicas can race; it is not a distributed lease. See [Team Collaboration](/docs/guides/team-collaboration/). At completion, record evidence in the task's workspace file before committing status and releasing the assignment: ```bash git-kb set tasks/auth-refactor status=completed git-kb unassign tasks/auth-refactor --json git-kb diff git-kb commit -m "Complete auth refactor with verification" tasks/auth-refactor --json ``` Use your project's status conventions. A status label records a claim; source changes and command results establish whether the acceptance criteria pass. ## Follow live changes The daemon publishes local KB events as NDJSON. Start it if needed, then subscribe: ```bash git-kb daemon start --background git-kb events --filter 'document:*' --path 'tasks/' --idle-timeout 60 ``` `--filter` selects event types. `--path` filters document events by slug prefix; non-document events pass through it. Use `--count 10` to stop after ten matching events. Events describe daemon activity; use committed document reads and history for durable state. ## Next steps - [Team Collaboration](/docs/guides/team-collaboration/) — Sparse sync and assignment limits - [Documents](/docs/core-concepts/documents/) — Checkout, pending edits, and commit - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Ground code changes in indexed relationships ──────────────────────────────────────────────────────────────────────── ## Team Collaboration URL: https://gitkb.com/docs/guides/team-collaboration/ Section: Guides --- title: Team Collaboration description: Share selected documents, understand per-document history, and coordinate edits across local replicas. --- # Team Collaboration GitKB separates the knowledge you hold locally from the documents you are editing. Pull the documents needed for a task, checkout the ones you will change, then commit and publish those changes. ## Two levels of selection - **Selection** chooses the documents your local store holds and keeps in sync with a remote. A pull of a path adds it to the selection. - **Checkout** materializes local documents in `.kb/workspaces//` for editing. You can query committed local documents without checking them out. Each Git worktree has its own checkout workspace. ```mermaid flowchart TD WA["Workspace A: pending edits"] -->|"commit"| LA["Local store A"] LA -->|"push whole commits"| R["Remote KB"] R -->|"pull selected history"| LB["Local store B"] LB -->|"checkout"| WB["Workspace B: editable Markdown"] WB -->|"commit"| LB LB -->|"push"| R ``` ## Per-document history A GitKB commit can contain changes to several documents. Each document keeps its own history, so ancestry follows the earlier changes to that document rather than one global branch. ```text tasks/auth: v1 -> v2 -> v3 specs/api: v1 -> v2 ``` Changes to unrelated documents can advance independently. Changes to the same document can diverge and require reconciliation. The receiver also validates history and commit integrity, so version mismatch is not the only reason a push can be rejected. A new physical commit is published completely and atomically. Scoped push selects the work to publish; a multi-document commit still travels as a complete immutable object. Keep unrelated changes in separate commits when you want to share them independently. A pull fetches the selected documents and their history. A retained shared commit may also mention other documents. Those incidental siblings are not automatically acquired as live documents or checked out. Shared commit bytes can still contain their change text, so a pathspec is not a redaction mechanism. ## Configure a remote Use the sync URL supplied by the KB you want to share. A GitKB.com KB has the form `https://gitkb.com/api/v1/sync//`: ```bash git-kb remote add origin https://gitkb.com/api/v1/sync/your-org/your-kb git-kb remote list --json git-kb login origin ``` The remote is recorded in `.kb/config.toml`. GitKB may record a GitKB.com URL in its short form, `gitkb://gitkb.com/your-org/your-kb`; both name the same KB. The first remote you add becomes the default remote (`sync.default_remote`), which bare `sync status` and `sync converge` act on. For a token instead of sign-in, give a token source rather than the token itself: `--token-env `, `--token-file ` or `--token-command `. HTTP and HTTPS sync endpoints are also supported for self-hosted servers. Add other remotes with distinct names and remove one with `git-kb remote remove `. ## Choose what you sync A client syncs only its selection, a set of patterns per remote, read like Git's sparse-checkout cone mode. The default remote starts with `@local`: every document this store holds stays in sync with no decision. Widen or narrow it with `git-kb sync select`: ```bash # Add patterns: a folder selects every document under it, now and later. git-kb sync select tasks/ context/ --remote origin # Select every document the remote has. git-kb sync select --all --remote origin # Replace the patterns instead of adding to them. git-kb sync select --set context/ --remote origin # Show the patterns and the documents they select. git-kb sync select --list --remote origin ``` A document that leaves the selection is removed locally on the next `sync converge`, once its local commits are published; a checkout with uncommitted edits is held until you commit or clear it, and its log is kept. The daemon converges the default remote in the background every `daemon.sync_interval_secs`, so a healthy KB stays in sync without commands. Any other remote is converged only when you run `git-kb sync converge `. Change the default with `git-kb config set sync.default_remote `. ## Pull the documents you need Push and pull require an explicit remote: ```bash # Acquire documents, including ones not held locally. git-kb pull origin tasks/auth-refactor --json git-kb pull origin context/ --json ``` Quote globs so your shell does not expand them into local filenames. Pathspecs read the same way in push, pull, fetch, `sync status` and `sync converge` as in local commands; [Troubleshooting](/docs/reference/troubleshooting/#a-pathspec-matches-nothing-or-too-much) covers how they match and what a miss returns. A pull without pathspecs refreshes locally held documents. To request every remote document explicitly, use `/` or the quoted `**`, which match every path (`*` matches top-level slugs only): ```bash git-kb pull origin --json git-kb pull origin '**' --json ``` There is no `pull --all` flag. To keep every remote document in sync, select them with `git-kb sync select --all`. Pulling all documents is a choice to expand your local replica; most task workflows can stay scoped. ## Edit and publish ```bash git-kb checkout tasks/auth-refactor git-kb workspace path tasks/auth-refactor --json # Edit the returned workspace file. git-kb diff git-kb commit -m "Record auth refactor plan" tasks/auth-refactor --json git-kb push origin tasks/auth-refactor ``` Use explicit document pathspecs for commits so other pending edits stay separate. Inspect what is held locally with `git-kb list --json`, and inspect checkout state with `git-kb workspace checkouts --json`. ## Coordinate task ownership Assignment is a local check against the document's committed `assignee`. It stages the change for a separate commit: ```bash git-kb assign tasks/auth-refactor agent-alex --json git-kb set tasks/auth-refactor status=active git-kb commit -m "Assign auth refactor" tasks/auth-refactor --json git-kb push origin tasks/auth-refactor ``` Inspect ownership through the board: ```bash git-kb board --unassigned --json git-kb board --assigned-to agent-alex --json ``` After recording completion evidence, release the assignment and commit it: ```bash git-kb unassign tasks/auth-refactor --json git-kb commit -m "Release auth refactor assignment" tasks/auth-refactor --json git-kb push origin tasks/auth-refactor ``` Assignment helps workers on a shared local KB or synchronized replicas see ownership. It is not a distributed lock: two disconnected replicas can both stage an assignment. Refresh before selecting work, publish claims promptly, and handle a rejected push before assuming ownership is shared. ## Read the plan, run the rows `git-kb sync status` prints the engine's plan for a remote: one row per action, each with the command that runs it. ```bash git-kb sync status origin --json git-kb sync status origin --json -- tasks/auth-refactor ``` Each row has a tier that says who acts: | Tier | Meaning | What you do | | ------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------- | | `auto` | Pull, push, rebase and other steps that need no decision | Run the row's command, or `git-kb sync converge origin` to run them all | | `agent` | A decision: a conflict, a slug claim, a delete/edit, a selection | Run the command the row prints, choosing one of its decisions | | `hold` | The remote changed a document you have uncommitted edits to | Run its command (a pull that merges into your file), then converge | | `info` | Nothing to run | Nothing; the exit code ignores it | | `human` | Sign-in, an unreachable remote, an upgrade or an integrity problem | Stop and report the row; do not work around it | `sync status` exits `0` at a fixed point (nothing to do), `70` when auto or agent rows are pending, `71` for a hold and `72` for a human row. `git-kb sync converge` runs the auto tier to a fixed point and stops at the first row that needs you. `git-kb sync show --remote origin` prints a row's details; for a conflict, the base, both sides and the merge. `git-kb sync resolve --remote origin --document --decision ` records an agent decision, exactly as the row's command carries it, then converges. A row still present after you ran its command is a result to report, not to retry. ### Resolve a conflict A conflict means your unpublished commit and the remote tip changed the same or adjacent lines of a document. When a pull stops at one, the merge is left in the checked-out file with `<<<<<<< ours`, `||||||| base`, `=======` and `>>>>>>> theirs` blocks: ```bash git-kb pull origin tasks/auth-refactor git-kb rebase --json # Edit each conflict block in the workspace file down to the content you want. git-kb rebase --continue git-kb push origin tasks/auth-refactor ``` To take one side whole, run `git-kb checkout --ours tasks/auth-refactor` or `git-kb checkout --theirs tasks/auth-refactor`, then continue. `git-kb rebase --abort` discards the stopped rebase. A `conflict-N` row also prints a command that decides the whole document, such as `git-kb conflict accept tasks/auth-refactor --theirs --local`. `--local` keeps your version, `--remote` takes the remote's and `--auto` takes the one modified more recently. Run it as printed, with one strategy; the `--theirs` value ties the decision to the remote content you saw. ## Share project guidance Keep `.kb/AGENTS.md` and the harness entry points in your source repository so teammates use the same context and task conventions. KB document sync and Git source sync are separate: pulling KB documents does not update local scaffold files. ## Next steps - [Agent Workflows](/docs/guides/agent-workflows/) — Context, ready tasks, and verification evidence - [Documents](/docs/core-concepts/documents/) — Workspace-first edits and commits - [Configuration](/docs/reference/configuration/) — Remote and daemon settings - [Migration & Adoption](/docs/guides/migration/) — Roll out gradually ──────────────────────────────────────────────────────────────────────── ## Migration & Adoption URL: https://gitkb.com/docs/guides/migration/ Section: Guides --- title: Migration & Adoption description: Add GitKB gradually, starting with code intelligence and a small set of useful project documents. --- # Migration & Adoption ## Start with one useful workflow You can use code intelligence in a Git repository before creating a knowledge base: ```bash git-kb code index --json git-kb code symbols authenticate --json ``` To add project documents and task context, initialize a KB and your agent integration: ```bash git-kb init git-kb init claude # or: git-kb init codex ``` Follow [MCP Setup](/docs/getting-started/mcp-setup/) for clients that need a separate server configuration. Then ask the agent to read the project instructions and help document a real task. Start with the project's purpose, the architecture needed for that task, and acceptance criteria you can verify. Review the documents before committing them. The scaffold supplies workflows; it does not automatically understand or document the project. ## Bring in existing knowledge Keep your existing issue tracker and wiki where they serve the team. Add the material you want agents to query and connect to code: architecture decisions, task criteria, incident findings, and current project context. For a small migration, create a document, copy the relevant Markdown into its workspace file, and commit it: ```bash git-kb create note --slug notes/auth-overview --title "Authentication overview" --json git-kb workspace path notes/auth-overview --json # Copy and review the material in the returned workspace file. git-kb diff git-kb commit -m "Add reviewed authentication overview" notes/auth-overview --json ``` Preserve source links where they help explain ownership or freshness. Check for secrets and obsolete claims as you copy material. Creating a document leaves a pending edit; the commit makes it available as committed KB knowledge. ## Build a small context set The scaffold suggests three groups: | Group | Examples | | ---------------------- | ------------------------------------- | | `context/immutable/` | Project brief, architecture, patterns | | `context/extensible/` | Product context, technology choices | | `context/overridable/` | Current focus, progress, blockers | Use the groups that help your project. Keep the active context short and link to deeper documents instead of repeating them in every task. ## Roll out to the team Use the sync URL supplied by your hosted or self-hosted KB. A GitKB.com KB has the form `https://gitkb.com/api/v1/sync//`: ```bash git-kb remote add origin https://gitkb.com/api/v1/sync/your-org/your-kb git-kb login origin git-kb push origin context/ ``` Commit `.kb/config.toml` to your source repository so teammates get the same remote. A teammate who clones the repository installs GitKB, creates the local store (`init` keeps the committed configuration), selects documents and converges: ```bash git-kb init git-kb login origin git-kb sync select --all --remote origin # or a narrower pattern, such as context/ git-kb sync converge origin ``` For a KB whose configuration is not in the repository, add the remote yourself and pull what you need: ```bash git-kb init git-kb remote add origin https://gitkb.com/api/v1/sync/your-org/your-kb git-kb login origin git-kb pull origin context/ --json git-kb init claude # or another supported harness ``` Converging or pulling brings documents into the local store. Checkout creates editable Markdown files under that worktree's `.kb/workspaces//`. Query committed documents without checking them all out, and checkout only what you need to edit. Share repository agent guidance through your source repository. KB pull syncs KB documents; it does not distribute the scaffold's local rules, skills, or other repository files. ## Upgrading from 0.1 GitKB 1.0 migrates a 0.1 knowledge base to the Protocol 1.0 store once. Preview what the upgrade would convert without changing anything, then run it: ```bash git-kb upgrade --report git-kb upgrade ``` The 0.1 layout and its configuration are kept under `.kb/legacy-0.1/` with a migration report. Each `gitkb:////` remote is carried to its sync URL, `https:///api/v1/sync//`, and the 0.1 default remote becomes `sync.default_remote`. Other commands run on a 0.1 store also migrate it first, once. `git-kb upgrade --check` reports the store's upgrade state, and `git-kb upgrade --cleanup` deletes the kept 0.1 layout once you no longer need it. ## Next steps - [Quick Start](/docs/getting-started/quick-start/) — A complete create-and-commit example - [Team Collaboration](/docs/guides/team-collaboration/) — Sparse sync and conflict recovery - [Agent Workflows](/docs/guides/agent-workflows/) — Focused context and task evidence ──────────────────────────────────────────────────────────────────────── ## CLI Reference URL: https://gitkb.com/docs/cli-reference/ Section: Reference # CLI Reference ## Start a knowledge base ### git-kb init 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 to configure: a URL, or an org slug for gitkb:////. Nothing is created on the remote --cloud-remote Host of the gitkb:// remote when --remote is an org slug --org Organization/namespace for federation --instance Instance name within organization --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 output mode Possible values: - auto: Auto-detect TTY - always: Always use colors - never: Never use colors [default: auto] --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 Usage: git-kb doctor [OPTIONS] Options: --check Only run specific checks (comma-separated). Available: repos, kb --fix [] Apply safe local repairs, then rerun checks. Bare `--fix` applies every safe repair; `--fix ` 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 output mode Possible values: - auto: Auto-detect TTY - always: Always use colors - never: Never use colors [default: auto] --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 Usage: git-kb repair [OPTIONS] git-kb repair Commands: projection Rebuild the document projection from the store Options: --from 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 output mode Possible values: - auto: Auto-detect TTY - always: Always use colors - never: Never use colors [default: auto] --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) 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 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 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 output mode Possible values: - auto: Auto-detect TTY - always: Always use colors - never: Never use colors [default: auto] --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 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 output mode Possible values: - auto: Auto-detect TTY - always: Always use colors - never: Never use colors [default: auto] --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 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 output mode Possible values: - auto: Auto-detect TTY - always: Always use colors - never: Never use colors [default: auto] --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 ## Create and manage documents ### git-kb create 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 Document type (task, spec, note, decision, skill, reference, incident) --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 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 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 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) 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) 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) 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 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 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 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) 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 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 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 version ## Organize with relationships and views ### git-kb link 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 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 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 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 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 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 version ## Workspace ### git-kb checkout 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.) 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 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 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 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 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 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 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 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) 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) 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 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 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 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 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 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 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) 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) 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 version ## Collaborate and sync ### git-kb remote 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 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 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 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 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 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 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 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 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 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 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 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 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 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>`) 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 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). `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` 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 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 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 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 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) 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 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 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 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 version ## Export and recover ### git-kb export 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 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 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 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 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 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 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. 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 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) 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 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 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 version ## Integrations ### git-kb 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 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 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 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 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 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 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 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 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 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.*) 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 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) 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 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 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 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 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 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 version ## Code intelligence ### git-kb code 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 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 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 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 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 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) 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) 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`) 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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) 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 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 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 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 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 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 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 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) 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 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') ──────────────────────────────────────────────────────────────────────── ## MCP Tools URL: https://gitkb.com/docs/reference/mcp-tools/ Section: Reference --- title: MCP Tools description: The GitKB MCP tool catalog, input names, and editing workflow. --- # MCP Tools GitKB exposes **134 MCP tools** (`110` core via `git-kb mcp`, `21` code intelligence via `git-kb code mcp`, and `3` semantic search via `git-kb semantic mcp`) for MCP clients such as Claude Code, Codex, Cursor and all major harnesses. The tables below were generated from the live `tools/list` responses of `git-kb 1.0.0` on 2026-11-30. A client's own `tools/list` response is authoritative for its installed version, including input schemas and defaults. Each client runs its own stdio server; they share one per-KB daemon, started on demand. ## Editing workflow Use the checkout-edit-commit workflow for changes you want to review together: ```json {"name":"kb_checkout","arguments":{"slugs":["tasks/auth-flow"]}} {"name":"kb_update","arguments":{"slug":"tasks/auth-flow","content":"## Acceptance criteria\n\n- [ ] Sign-in creates a session."}} {"name":"kb_set","arguments":{"slug":"tasks/auth-flow","status":"active"}} {"name":"kb_diff","arguments":{}} {"name":"kb_commit","arguments":{"message":"Define authentication work","pathspecs":["tasks/auth-flow"]}} ``` `kb_create` stages a new document; provide `slug` for an explicit address or `next` for a numbered family. `kb_update` stages by default, with optional `commit: true`. `kb_set` leaves a pending workspace edit. Pass your changed slugs to `kb_commit`; multiple changed documents require a scope or explicit `all`. `kb_mv` renames in the workspace and rewrites links to the old slug in other checkouts; commit the renamed document and the listed references with `kb_commit`. `kb_delete` with `slug` records a tombstone commit at once; with `pathspecs` it stages deletions for the next commit unless you pass `message`. Use `kb_reset` to discard edits and `kb_clear` to remove checked-out files; empty pathspecs can apply to the whole workspace. ## Catalog The tables list every tool and its input names. **Bold inputs are schema-required**; other inputs are optional. Additional semantic requirements are noted below the tables. The server supplies types, defaults, and constraints in `tools/list`. ## Documents | Tool | Purpose | Inputs | | --------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `kb_list` | List documents, filtered by type, status, tag, priority, path or container, with sorting and pagination. | `assigned_to`, `container`, `count`, `full`, `limit`, `offset`, `path`, `priority`, `recursive`, `save`, `since`, `sort`, `sort_direction`, `status`, `tag`, `tags`, `type`, `unassigned`, `unblocked`, `until`, `where` | | `kb_show` | Show documents, versions (`<slug>@<version>`) or commits. | `no_body`, `raw_content`, `related`, `slug`, `slugs`, `source` | | `kb_create` | Start a new document in the workspace; with `next`, reserve a numbered family's next slug at the remote. | `author`, `blocked_by`, `blocks`, `component`, `content`, `next`, `parent`, `path`, `priority`, `refs`, `remote`, `require_remote_reservation`, `slug`, `status`, `tags`, `template`, **`title`**, `ttl`, **`type`** | | `kb_update` | Update a document's content or metadata. | `commit`, `content`, `message`, `priority`, **`slug`**, `status`, `tags`, `title` | | `kb_set` | Quick metadata update (status, priority, tags, assignee) without editing content. | `add_tags`, `assignee`, `dry_run`, `fields`, `priority`, **`slug`**, `status`, `tags` | | `kb_mv` | Rename a document in the workspace and rewrite links to it; `kb_commit` records it. | `dest`, `force`, `next`, `remote`, **`source`**, `ttl` | | `kb_delete` | Delete documents; `hard` purges them from history and disk. | `commit`, `dry_run`, `force`, `hard`, `message`, `pathspecs`, `recursive`, `slug` | | `kb_assign` | Assign a document to an agent with compare-and-swap. | **`agent_id`**, `force`, **`slug`** | | `kb_unassign` | Clear a document's assignment. | **`slug`** | | `kb_external_refs` | External references declared in frontmatter, by document or by external id. | `id`, `slug`, `system` | | `kb_templates_list` | List built-in and custom document templates. | None | | `kb_templates_show` | Show a template's content. | **`name`** | | `kb_templates_create` | Create a custom template in `.kb/templates/`. | **`content`**, **`name`** | | `kb_templates_edit` | Replace a custom template, or override a built-in one. | **`content`**, **`name`** | | `kb_templates_delete` | Delete a custom template. | **`name`** | | `kb_schema` | List or generate the JSON schemas for documents. | `format`, `name` | ## Workspaces and history | Tool | Purpose | Inputs | | ------------------------ | -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | | `kb_checkout` | Checkout documents to the workspace for editing, by slug or filter; `side` takes one side of a conflict. | `force`, `side`, `slugs`, `status`, `tag`, `type` | | `kb_status` | Show the state of every workspace file (clean, dirty, draft, stale). | `pathspecs` | | `kb_diff` | Show unified diffs of workspace changes against their checkout baselines. | `commit`, `pathspecs` | | `kb_commit` | Commit workspace changes; pass the changed documents as `pathspecs`. | `all`, `author`, `close`, **`message`**, `pathspecs` | | `kb_log` | Commit history, optionally for one document, with patches. | `activity`, `author`, `before`, `filter`, `full_content`, `limit`, `offset`, `patch`, `pathspecs`, `since`, `slug`, `until` | | `kb_blame` | Attribute each line of a document to the commit that introduced it. | **`slug`** | | `kb_reflog` | Every document tip movement, newest first; finds replaced commits. | `count`, `pathspecs` | | `kb_reflog_expire` | Drop old reflog entries. | `dry_run`, `expire`, `expire_unreachable`, `pathspecs` | | `kb_revert` | Make a new commit that undoes a commit; safe on published history. | **`commits`** | | `kb_stash` | Stash workspace changes: push, pop, apply, list, drop, show, clear. | **`action`**, `force`, `id`, `message`, `pathspecs` | | `kb_reset` | Discard workspace edits, or move document tips to a commit. | `dry_run`, `force`, `hard`, `mixed`, `pathspecs`, `soft`, `to` | | `kb_clear` | Remove documents from the workspace. | `dry_run`, `force`, `path`, `pathspecs`, `priority`, `status`, `tag`, `tags`, `type` | | `kb_workspace_resolve` | Resolve the current workspace identity and paths. | None | | `kb_workspace_list` | List the GitKB workspaces. | None | | `kb_workspace_path` | Show the workspace file path for a document. | **`slug`** | | `kb_workspace_checkouts` | List checked-out documents in the current workspace. | None | | `kb_workspace_status` | List checked-out and changed documents in the workspace. | `omit_empty`, `slugs` | | `kb_workspace_sources` | List a document's sources: the committed tip and every workspace that holds it. | **`slug`** | | `kb_workspace_write` | Save exact Markdown to the workspace after a generation check. | **`content`**, `create_if_missing`, `if_generation`, **`origin_id`**, **`slug`** | ## Sync and conflicts | Tool | Purpose | Inputs | | ----------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `kb_sync_status` | The sync plan for a remote: its exit, summary and rows, each with a tier and command. | `fetch`, `offline`, `pathspecs`, `rehash`, `remote`, `remote_scope`, `token` | | `kb_sync_converge` | Run the plan's auto rows to a fixed point; returns what ran and what remains. | `max_rounds`, `pathspecs`, `remote` | | `kb_sync_show` | Inspect one plan row; a conflict row adds base, ours, theirs, both diffs and the merge. | **`action_id`**, `document`, `output`, **`remote`** | | `kb_sync_resolve` | Record one agent decision on a plan row, then converge. | **`action_id`**, **`decision`**, `document`, `max_rounds`, **`remote`**, `theirs` | | `kb_sync_select` | Add, replace or list a remote's selection patterns. | `all`, `list`, `local`, `pathspecs`, `reapply`, `remote`, `set` | | `kb_push` | Publish whole commit groups for the documents the pathspecs name. | `auto_rebase`, `dry_run`, `force`, `force_with_lease`, `pathspecs`, **`remote`**, `token` | | `kb_pull` | Fast-forward, replay unpublished commits onto the remote tip and merge workspace edits. | `autostash`, `dry_run`, `evidence_only`, `pathspecs`, **`remote`**, `token` | | `kb_fetch` | Download remote tips without moving a reference or changing a file. | `pathspecs`, **`remote`** | | `kb_remote_diff` | Compare local and remote tips; optional three-way view. | `pathspecs`, **`remote`**, `three_way`, `token` | | `kb_merge` | Merge remote documents with a policy: preview, review, continue or abort. | `abort`, `accept_unit`, `action`, `continue`, `expect_result_digest`, `pathspecs`, `policy`, `preview`, `remote`, `resolve`, `result`, `review`, `source`, `status`, `token` | | `kb_rebase` | Show, continue or abort a stopped pull rebase, or rewrite unpublished commits by a todo. | `action`, `interactive`, `max_retries`, `pathspecs`, `replace_slug`, `root`, `todo`, `token`, `upstream` | | `kb_conflict_show` | List the default remote's conflicts, or one in detail. | `slug` | | `kb_conflict_accept` | Decide whole conflicted documents: `strategy` local, remote or auto, with `theirs` from the plan row. | `all`, `slug`, `strategy`, `theirs` | | `kb_slug_next` | Preview a numbered family's next number at a remote; holds nothing. | **`family`**, `remote` | | `kb_slug_release` | Release a number this principal holds reserved. | `remote`, **`slug`** | | `kb_slug_reservation_status` | What the remote and this store record for a reserved slug. | **`remote`**, **`slug`** | | `kb_slug_reservation_renew` | Extend a reservation this principal holds. | **`remote`**, **`slug`** | | `kb_slug_reservation_release` | Abandon a reservation this principal holds. | **`remote`**, **`slug`** | | `kb_limits` | The declared sync limits. | None | | `kb_bundle_create` | Write commits to a portable bundle file for offline transfer. | `author`, `commits`, `output`, `since`, `slugs` | | `kb_bundle_apply` | Apply a bundle file; `dry_run` returns the plan only. | `dry_run`, `force`, **`input`**, `no_verify` | ## Accounts and organizations | Tool | Purpose | Inputs | | ----------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `kb_login` | Sign in to a GitKB server with the OIDC device flow. | `client_id`, `credential_store`, `issuer`, `scope`, `server` | | `kb_logout` | Clear stored credentials for a server, or all of them. | `all`, `credential_store`, `server` | | `kb_auth_login` | Sign in to a remote with the OIDC device flow. | `client_id`, `credential_store`, `issuer`, `remote`, `scope` | | `kb_auth_logout` | Clear stored credentials for a remote, or all of them. | `all`, `credential_store`, `remote` | | `kb_auth_status` | Show the cloud domain, issuer and stored-credential state; never includes a token. | `remote` | | `kb_auth_use` | Make a remote's domain the active cloud domain. | **`remote`** | | `kb_auth_migrate` | Move stored credentials between the file and keychain backends. | `force`, **`from`**, **`remote`**, **`to`** | | `kb_whoami` | Show the signed-in user and their organization memberships. | `remote` | | `kb_ping` | Check that the GitKB API answers; reports version and latency. | `remote` | | `kb_org_list` | List your organizations. | `remote` | | `kb_org_show` | Show an organization's members, invitations and knowledge bases. | `all`, `org`, `remote` | | `kb_org_create` | Create an organization. | `name`, `remote`, **`slug`** | | `kb_org_delete` | Delete an organization and its knowledge bases; needs `force`. | `force`, `remote`, **`slug`** | ## Graph and views | Tool | Purpose | Inputs | | ------------ | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `kb_graph` | Document relationships for one or more documents, with critical path and scope. | `critical_path`, `depth`, `direction`, `plan`, `rel_type`, `scope`, `slug`, `slugs` | | `kb_link` | Add container, code or source-commit links; edits the checkout. | **`child`**, `code`, `commit`, `container`, `position`, `repo` | | `kb_unlink` | Remove a document from a container; edits the checkout. | **`child`**, **`container`** | | `kb_reorder` | Reorder a document within a container; edits the checkout. | **`child`**, **`container`**, **`position`** | | `kb_board` | Kanban board, grouped by status or any frontmatter property. | `all`, `assigned_to`, `columns`, `group_by`, `priority`, `save`, `sort_by`, `sort_direction`, `summary`, `tags`, `type`, `unassigned`, `unblocked`, `where` | | `kb_view` | Run a saved view definition. | `document`, `limit`, `no_body`, `offset`, `related`, `request`, **`slug`** | ## Context and task selection | Tool | Purpose | Inputs | | --------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `kb_context` | Bootstrap context bundle for an agent session. | `commit_limit`, `include_code_refs`, `include_content`, `task` | | `kb_context_document` | Graph-aware context for one document, with neighbors and code refs. | `include_body`, `include_code_refs`, `include_neighbor_bodies`, **`slug`**, `token_budget` | | `kb_smart_context` | Task-aware code and document context within a token budget. | `call_depth`, `include_callees`, `include_callers`, `min_score`, **`task`**, `token_budget` | | `kb_ready` | The highest-scored unblocked, unassigned tasks or incidents. | `include_context`, `limit`, `token_budget` | | `kb_resolve` | Resolve which task an agent should work on (env, branch or auto). | `agent_id`, `branch`, `current_branch`, `fallback_recent`, **`mode`** | | `kb_config_get` | Read one `.kb/config.toml` value by dot-separated key. | **`key`** | | `kb_config_list` | List every `.kb/config.toml` key; literal tokens are redacted. | None | | `kb_resource_locate` | Locate a KB resource: desktop URI, hosted URL and web link. | `resource`, `view` | ## Code intelligence | Tool | Purpose | Inputs | | --------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | `kb_index` | Index source code symbols, with branch and worktree context. | `branch`, `default_branch`, `dry_run`, `force`, `include_deps`, `language`, `paths`, `prune`, `worktree` | | `kb_symbols` | Find where a function, type or method is defined. | `body`, `branch`, `count`, `file_path`, `file_pattern`, `group_by`, `kind`, `language`, `limit`, `offset`, `parent`, `search` | | `kb_callers` | Callers of a symbol from the call graph. | `branch`, `depth`, `limit`, `strict`, **`symbol`** | | `kb_callees` | Functions a symbol calls. | `branch`, `depth`, `limit`, `strict`, **`symbol`** | | `kb_impact` | Transitive blast radius of changing a file. | `branch`, `depth`, **`file_path`**, `limit` | | `kb_dead_code` | Symbols with no production callers. | `branch`, `exclude_tests`, `explain`, `file_path`, `group_by`, `include_entrypoints`, `include_public`, `include_tests`, `kind`, `limit`, `offset` | | `kb_code_refs` | Where a name is used: whole-word hits without comments, strings and definitions. | `all`, **`target`** | | `kb_symbol_refs` | KB documents that reference a code symbol. | `include_maybe`, `strict`, **`symbol`**, `textual`, `wikilinks_only` | | `kb_code_graph` | A symbol's or file's caller/callee subgraph. | `branch`, `depth`, `direction`, `file`, `include_docs`, `limit`, `strict`, `symbol` | | `kb_code_show` | One symbol's record and source lines. | `max_lines`, **`symbol_id`** | | `kb_code_shape` | One function's control structure and complexity. | **`symbol_id`** | | `kb_code_map` | Every indexed file, optionally with symbols, plus index health. | `branch`, `defer_health`, `detail`, `path_prefix` | | `kb_code_stats` | Code index statistics. | `branch` | | `kb_code_doctor` | Code index and call-resolution health. | `branch` | | `kb_code_entrypoints` | Inferred code entrypoints. | `branch`, `limit`, `refresh` | | `kb_code_flows` | Entrypoint-derived code flows. | `branch`, `depth`, `limit`, `refresh` | | `kb_code_flow` | Members of one code flow. | **`flow_id`** | | `kb_code_query` | Typed code graph query templates (hotspots, public-api, routes and more). | `branch`, `depth`, `include_docs`, `limit`, `refresh`, `target`, **`template`** | | `kb_code_annotations` | Wikilinks written in source comments, with the symbols they attach to. | `branch`, `limit`, `link_type`, `offset`, `path`, `reach`, `reach_depth`, `symbol`, `target` | | `kb_code_dump_ast` | A file's tree-sitter parse tree, for writing query files. | `language`, `lines`, **`path`** | | `kb_code_quality` | Run fixture-driven code-intelligence resolver checks. | **`fixture`**, `keep_temp`, `markdown` | | `kb_repo_list` | Repositories this KB discovers, with aliases and default branches. | `refresh` | ## Search, embeddings and events | Tool | Purpose | Inputs | | -------------------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | `kb_search` | Ranked keyword search over documents. | `all_terms`, `doc_type`, `limit`, `offset`, **`query`**, `status` | | `kb_semantic` | Natural-language search across documents using local embeddings (optional hybrid). | `doc_type`, `hybrid`, `limit`, **`query`**, `status`, `threshold` | | `kb_embed` | Embed new and changed committed documents into the semantic index. | `force` | | `kb_semantic_status` | Show semantic index counts against committed documents without loading a model. | None | | `kb_events` | Long-poll for a batch of matching KB events. | `filter`, `max_events`, `path`, `timeout_secs` | ## Projections | Tool | Purpose | Inputs | | ------------------------ | -------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `kb_project` | Project committed documents into repository files. | `adapter`, `dry_run`, `mode`, `name`, `pathspec`, `rebuild`, `require_match`, `to` | | `kb_projections_list` | List saved and materialized projections. | None | | `kb_projections_save` | Save a projection recipe in `.kb/projections.toml`. | `adapter`, `mode`, **`name`**, **`pathspec`**, **`to`** | | `kb_projections_apply` | Apply a saved projection. | `dry_run`, **`name`** | | `kb_projections_resolve` | Resolve a saved projection without writing files. | **`name`** | | `kb_projections_diff` | Diff a saved projection against its sources and targets. | **`name`** | | `kb_projections_doctor` | Diagnose a saved projection. | **`name`** | | `kb_projections_clean` | Remove a projection's stale outputs. | `dry_run`, **`name`** | | `kb_projections_remove` | Remove a projection and its outputs. | `dry_run`, **`name`** | ## Backup, export and maintenance | Tool | Purpose | Inputs | | ------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------------- | | `kb_export` | Export documents as Markdown, JSON or JSONL. | `format`, `output_dir`, `status`, `tag`, `type` | | `kb_backup` | Write a backup archive of the store and every workspace. | `no_workspace`, `path`, `verify` | | `kb_restore` | Restore a backup archive into this KB, or resume or abandon a restore. | `abandon`, `message`, `path`, `pathspecs`, `resume`, `source` | | `kb_filter` | Purge documents from history and disk; `force: true` confirms. | `force`, `recursive`, **`rm`** | | `kb_info` | Store size and document, commit, link and embedding counts. | None | | `kb_doctor` | Diagnose the KB and plan its repair; `fix` applies safe local repairs. | `check`, `fix`, `progress` | | `kb_fsck` | Check local KB integrity. | `ack_quarantine`, `full`, `prune_indexes`, `repair` | | `kb_verify` | Verify every object hash and document chain. | `full`, `no_cache`, `verbose` | | `kb_repair` | Rebuild the projection, or re-fetch damaged objects from a remote or backup. | `command`, `from`, `verbose` | | `kb_reindex` | Rebuild the document projection from the store. | `verbose` | | `kb_repack` | Fold loose objects into packs. | None | | `kb_prune` | Delete stored data nothing points to. | `dry_run`, `expire`, `now` | | `kb_gc` | Expire old reflog entries, prune and repack. | `no_prune`, `prune` | ## Apps and feedback | Tool | Purpose | Inputs | | ------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------------------------- | | `kb_app_list` | List locally installed GitKB apps. | `apps_dir` | | `kb_feedback` | Send an anonymous report to the GitKB team; `dry_run` previews it. | `api_url`, `category`, `contact_email`, `dry_run`, `include_diagnostics`, **`message`** | ## Input details - **Document lookup:** use `slug` or `slugs` with `kb_show` and `kb_graph`. `kb_checkout` accepts `slugs` or type/status/tag filters. Workspace files live under `.kb/workspaces/<name>/`; `kb_workspace_path` resolves the file for a slug. - **Pathspecs:** `pathspecs`, `slugs` (`kb_checkout`), `rm` (`kb_filter`) and `path` (`kb_list`, `kb_events`) read one grammar. A document id is that document; `tasks/` is `tasks` and every document under it at any depth; `tasks/*` is the direct children (`*`, `?` and `[…]` stay within one folder level); `tasks/**` is every document under `tasks`; `/` and a bare `**` are every document. Tools that act on documents read a bare `tasks` as the document at that slug when there is one, else the folder; `kb_list.path` and `kb_events.path` read it as the folder (`kb_events.path` takes slugs, not ids), and the `kb_list` `recursive` input is a no-op kept for compatibility. A pathspec that selects several documents needs `recursive: true` on `kb_delete` and `kb_filter`. - **Unmatched pathspecs:** `kb_commit`, `kb_checkout`, `kb_delete`, `kb_reset`, `kb_clear` and `kb_filter` refuse a pathspec that matches nothing with `invalid_params` (`pathspec_no_match`) and change nothing; `kb_delete` with `force` skips it instead. `kb_push`, `kb_pull` and `kb_fetch` refuse one the same way (`kb_push` judges only committed documents held here; `kb_pull` and `kb_fetch` refuse a document id found on neither side as an invalid argument). An online `kb_sync_status` refuses a pathspec that matches nothing in the remote's selection as an invalid argument; `kb_sync_converge` runs what its other pathspecs match, then lists the misses under `unmatched` with `exit: "unmatched"`. `kb_list` answers an unmatched `path` with an empty result and `unmatched`. - **Purge:** `kb_delete` with `hard` (which needs `force`) and `kb_filter` take only ids, exact slugs, folders written as `tasks/`, or globs. An unmatched bare name, or a folder written without its trailing `/`, is refused as an invalid pathspec even with `force`. `kb_delete` `hard` with `force` skips any other unmatched name; `kb_filter`, whose `force` only confirms, refuses the request. - **Listing:** `kb_list` uses `type` and singular `tag`; `kb_search` uses `doc_type`. Type, status, and priority list filters support a string or array with OR within the field. Different fields combine with AND. - **Relationships:** `kb_graph.direction` is `out`, `in`, or `both`. Container linking uses `child` and `container`; code linking uses `child` and `code`; source-commit linking uses `child`, `repo`, and `commit`. Positions are strings such as `first`, `last`, `after:<slug>`, or `before:<slug>`. - **Task context:** `kb_ready` uses `include_context` and `token_budget`. `kb_smart_context` takes a task slug and can traverse callers and callees within its budget. - **Code queries:** symbols use canonical paths and complete symbol IDs. `kb_index` takes `paths` as an array. `kb_dead_code` filters with `file_path`; zero callers is a candidate for review, not proof of unused code. `kb_code_flow` takes an ID returned by `kb_code_flows`. - **Events:** `kb_events` returns a batch, rather than an open NDJSON stream. It uses `max_events` and `timeout_secs` (maximum 60 seconds); call again to keep listening. `path` filters document events, while non-document events can still pass through. - **Sync:** start with `kb_sync_status`, which returns the plan's rows in priority order, each with a tier (`auto`, `agent`, `hold`, `info`, `human`) and the command that runs it. `kb_sync_converge` runs the auto rows to a fixed point. Inspect a row with `kb_sync_show` and record an agent decision with `kb_sync_resolve`, passing `document` (and `theirs` on a conflict) exactly as the row's command carries them. Report human rows instead of working around them. - **Conflicts:** when `kb_pull` stops at a conflict, edit the conflict blocks in the checked-out file and call `kb_rebase` with `action: "continue"` (`kb_checkout` with `side: "ours"` or `"theirs"` takes one side whole; `action: "abort"` discards the rebase). `kb_conflict_accept` decides a whole document with `strategy: "local"`, `"remote"` or `"auto"`, plus the `theirs` value from the plan row. Automatic resolution is latest-wins and can discard concurrent edits. - **Backup:** `kb_backup` writes an archive to `path`; `kb_restore` restores one from `path`. `kb_export` produces an interchange format, separate from a full backup. ## Next steps - [MCP Setup](/docs/getting-started/mcp-setup/) — Register the server with your client - [Agent Workflows](/docs/guides/agent-workflows/) — Load context and make scoped changes - [CLI Reference](/docs/cli-reference/) — Commands for direct use and recovery ──────────────────────────────────────────────────────────────────────── ## Configuration URL: https://gitkb.com/docs/reference/configuration/ Section: Reference --- title: Configuration description: Configure authors, remotes, numbered slugs, repository discovery, indexing, embeddings, apps, and hooks. --- # Configuration GitKB reads project settings from `.kb/config.toml`. Run `git-kb init` to initialize a KB, then change the settings your project needs. ```bash # Read a setting, or every setting git-kb config get hooks.context_injection git-kb config list --json # Set the author of KB commits git-kb config set user.name "Alice" git-kb config set user.email "alice@example.com" # Set the default remote, or clear it git-kb config set sync.default_remote origin git-kb config unset sync.default_remote ``` `config get` reads a stored key; an omitted key can still have a default in GitKB. `config set` accepts these keys; edit the TOML file for other settings: | Key | Value | | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | `user.name`, `user.email` | The commit author. Stored per user in `~/.config/gitkb/config.toml`, never in `.kb`. | | `daemon.sync_interval_secs` | Seconds between the daemon's background converges of the default remote. | | `hooks.context_injection`, `hooks.auto_commit_link`, `hooks.auto_worktree_bind`, `hooks.auto_progress`, `hooks.prompt_context` | `true` or `false`; see [Harness hook features](#harness-hook-features). | | `sync.autostash` | `true` (default) lets `pull` merge into files with uncommitted edits; `false` leaves them as they are. | | `sync.default_remote` | A configured remote's name. `git-kb config unset sync.default_remote` clears it. | | `sync.remotes.<name>.url` | An `https://`, `http://` or `gitkb://` URL. | | `sync.remotes.<name>.token.env`, `.token.file`, `.token.command` | The remote's one token source. | ## KB identity `[identity]` describes the KB for federation; its `name` is the KB display name. ```toml [identity] org = "acme" instance = "engineering" name = "Engineering knowledge" ``` ## Remotes Named remotes live under `[sync.remotes.<name>]`. A GitKB.com KB has the sync URL `https://gitkb.com/api/v1/sync/<org>/<kb>`; self-hosted servers use their own `https://` or `http://` URL. GitKB may record a GitKB.com URL in its short `gitkb://gitkb.com/<org>/<kb>` form, which names the same KB. ```bash git-kb remote add origin https://gitkb.com/api/v1/sync/acme/engineering git-kb remote list --json git-kb sync status origin --json ``` Sign in with `git-kb login origin`, or give the remote a token source. A token source tells GitKB where to read the token at each exchange; never write the token itself into `.kb/config.toml`: ```bash git-kb remote add ci https://gitkb.com/api/v1/sync/acme/engineering --token-env GITKB_TOKEN # or: --token-file <path>, --token-command <cmd> ``` ```toml [sync] default_remote = "origin" [sync.remotes.ci] url = "https://gitkb.com/api/v1/sync/acme/engineering" [sync.remotes.ci.token] env = "GITKB_TOKEN" ``` The first remote added is the default remote (`sync.default_remote`). Bare `sync status` and `sync converge` act on it, and the daemon keeps it converged. `sync.autostash = false` makes `pull` leave files with uncommitted edits alone instead of merging into them. ## Numbered slugs With a remote configured, numbered slugs such as `tasks/project-12` are reserved at the remote, so two people never take the same number: ```bash git-kb create task --next tasks/project --remote origin --title "Add sign-in" --json git-kb slug next tasks/project --remote origin --json ``` `create --next` reserves the family's next number and creates the document as a draft; commit and converge it to make the number permanent. `slug next` only previews the number and holds nothing. A KB with no remote numbers families locally. Offline, create with an explicit `--slug`. ## Repository discovery `[repos]` controls which repositories supply code to the index. | Strategy | Source of repositories | | ---------------- | -------------------------------------------------------------- | | `custom` | Explicit entries under `[repos.<name>]`; the default strategy. | | `meta` | A workspace managed by `meta`. | | `git_submodules` | Git submodules. | | `monorepo` | One repository rooted at the KB project. | For a single repository: ```toml [repos] strategy = "monorepo" ``` For explicit repository entries: ```toml [repos] strategy = "custom" [repos.api] path = "api/" remote = "git@github.com:acme/api.git" aliases = ["backend"] default_branch = "main" ``` Inspect discovery with `git-kb repo list --json` and `git-kb doctor --check repos --json`. ## Code indexing ```toml [code] default_branch = "main" [code.repo_default_branch_map] "api/" = "main" "frontend/" = "develop" ``` `default_branch` selects the default branch for single-repository code queries. The per-repository map uses paths relative to the KB root. ## Daemon `[daemon]` sets `sync_interval_secs` (default `15`) and `auto_start` (default `true`). With `auto_start = false`, commands do not start a daemon for store writes; a running one is still used. Pass `--no-daemon` or set `GITKB_NO_DAEMON=1` for the same behaviour on one command. ```toml [daemon] sync_interval_secs = 15 auto_start = true ``` ## Embeddings Initialize local semantic search with `git-kb semantic init` and embed committed documents with `git-kb semantic index`. ```toml [embeddings] backend = "candle" batch_size = 16 batch_delay_ms = 0 ``` | Setting | Default | Meaning | | ---------------- | --------------- | ------------------------------------------------- | | `backend` | `"candle"` | Inference backend (`"candle"`). | | `model` | Backend default | Optional model override. | | `batch_size` | `16` | Maximum texts per forward pass; must be positive. | | `batch_delay_ms` | `0` | Optional delay between backend batches. | ## Local apps Apps are discovered from `$XDG_CONFIG_HOME/gitkb/apps`, or `~/.config/gitkb/apps` when `XDG_CONFIG_HOME` is unset, plus configured installation directories. ```toml [apps] enabled = [] install_dirs = [] ``` `enabled` contains app IDs to enable. `install_dirs` adds directories to scan. Inspect installed manifests, state, and validation errors with `git-kb app list --json`. ## Local sync server `git-kb serve` runs a sync server for individual use. It has no access control (no users, roles, scopes or API keys) and refuses to start when `.kb/config.toml` has an `[auth]` section. `--require-token <token>` makes every request carry one shared bearer token; it is a stand-in for a hosted server, not access control. ## Pagers ```toml [pager] markdown = "glow -t -w 0" plain = "less -FRX" ``` `markdown` handles document output such as `show`; `plain` handles terminal output such as `log`, `list`, `board`, and `diff`. Both are unset by default. Use `--no-pager` to bypass configured pagers. ## Harness hook features ```toml [hooks] context_injection = true auto_commit_link = true auto_worktree_bind = true auto_progress = false prompt_context = false ``` These are the default feature settings. They control context injection, commit linking, branch-to-task binding, progress recording, and per-prompt context in adapters that implement those events. Install the relevant harness integration to use them; the settings alone do not register hooks. ## Related docs - [CLI Reference](/docs/cli-reference/) — Command help captured from the installed CLI. - [Daemon](/docs/core-concepts/daemon/) — Watching and indexing behavior. - [Team Collaboration](/docs/guides/team-collaboration/) — Sparse sync and shared work. ──────────────────────────────────────────────────────────────────────── ## Supported Languages URL: https://gitkb.com/docs/reference/supported-languages/ Section: Reference --- title: Supported Languages description: Language packs, file extensions, and extraction coverage for GitKB code intelligence. --- # Supported Languages GitKB supports **19 languages** for code intelligence: **18** tree-sitter language packs (including `TLA+`) plus `Svelte` `<script>` extraction through the TypeScript pack. Packs extract symbols, call sites, and imports. Call resolution and additional language features vary by language and syntax. ## Language packs | Language | File extensions | | ---------- | -------------------------------------------- | | Rust | `.rs` | | Python | `.py`, `.pyi`, `.pyw` | | JavaScript | `.js`, `.jsx`, `.mjs`, `.cjs` | | TypeScript | `.ts`, `.tsx`, `.mts`, `.cts` | | Go | `.go` | | C | `.c`, `.h` | | C++ | `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hh`, `.hxx` | | C# | `.cs` | | Java | `.java` | | Ruby | `.rb`, `.rake`, `.gemspec` | | Elixir | `.ex`, `.exs` | | Kotlin | `.kt`, `.kts` | | Swift | `.swift` | | Scala | `.scala`, `.sc` | | PHP | `.php` | | Haskell | `.hs`, `.lhs` | | Lua | `.lua` | | TLA+ | `.tla` | Rust, Python, TypeScript, JavaScript, and Go have the broadest end-to-end coverage. The remaining packs also extract symbols, calls, and imports; this does not imply identical resolution coverage for every language construct. Symbol forwarding follows public re-exports in Rust, Python package initializers, and JavaScript/TypeScript barrel modules. Other packs do not all model equivalent forwarding forms. ## Svelte components For `.svelte` files, GitKB creates a component-level module symbol and extracts symbols, calls, imports, and re-exports from `<script>` blocks using the TypeScript pack. Source locations retain their original component-file offsets. Template and markup expressions are outside this extraction path. ## Recognized formats without a language pack Bash and related shell files (`.sh`, `.bash`, `.zsh`) are recognized by the language registry, but the default build has no registered Bash extraction pack. Recognition alone does not provide the same code graph as the packs above. These non-code formats are also recognized for file statistics and have no code extraction queries: | Format | File extensions | | ------ | ------------------------ | | HTML | `.html`, `.htm` | | CSS | `.css`, `.scss`, `.less` | | JSON | `.json`, `.jsonl` | | YAML | `.yaml`, `.yml` | | Nix | `.nix` | ## Index and inspect ```bash # Preview or index source files git-kb code index --dry-run --json git-kb code index src/ --json # Filter indexing by language git-kb code index src/ --language rust --json # Inspect coverage and unresolved calls git-kb code stats --json git-kb code doctor --json ``` GitKB detects language from file extensions and respects `.gitignore` and `.gitkbignore`. A custom build can enable a smaller set of packs. After edits, re-run indexing or use a full KB's [daemon](/docs/core-concepts/daemon/) for incremental updates. To remove entries for deleted files while indexing: ```bash git-kb code index --prune src/ --json ``` Call graphs describe the syntax and relationships the index can resolve. Use index-health output and source inspection when a missing caller or uncertain resolution affects a decision. ## Next steps - [Code Intelligence](/docs/core-concepts/code-intelligence/) — Query definitions and relationships - [CLI Reference](/docs/cli-reference/) — Code commands and flags - [MCP Tools](/docs/reference/mcp-tools/) — Code tools for AI assistants ──────────────────────────────────────────────────────────────────────── ## Troubleshooting URL: https://gitkb.com/docs/reference/troubleshooting/ Section: Reference --- title: Troubleshooting description: Diagnose daemon, workspace, indexing, MCP, and sync problems with current GitKB commands. --- # Troubleshooting Start with the diagnostic for the subsystem that failed. Use `--json` where supported so identifiers and recovery instructions remain complete. ## Daemon connection or compatibility errors ```bash git-kb daemon status --json git-kb daemon logs --tail 100 ``` The daemon can start automatically when a command needs it. To start a persistent background daemon yourself: ```bash git-kb daemon start --background ``` `git-kb daemon start` without `--background` runs in the foreground. Use `git-kb daemon restart` after changing daemon configuration or updating GitKB. A compatibility refusal means the client and daemon need compatible protocol versions; follow the diagnostic before retrying the operation. For a verbose foreground session: ```bash git-kb --verbose daemon start ``` ## Wrong KB or no documents ```bash git-kb info git-kb list --json ``` GitKB searches upward for a `.kb/` directory. Set `GITKB_ROOT=/path/to/project` to select a specific KB. An empty workspace and an empty KB are different: `status` describes checkouts, while `list` describes stored documents. ## MCP tools do not appear Check the generated client configuration and the path to `git-kb`: ```bash command -v git-kb git-kb --version git-kb daemon status --json ``` Run `git-kb init <harness> --dry-run` to inspect the integration assets your version would install. For a generic MCP client, configure a stdio server that runs `git-kb mcp`, with the project as its working directory or `GITKB_ROOT` set explicitly. Reload the client after changing its MCP configuration. A raw `tools/list` line is not a complete MCP connection test: clients first initialize the protocol session, then list tools. Use your client's MCP status or logs to inspect that handshake. ## Old or unexpected workspace checkouts Inspect the current worktree's workspace and changes: ```bash git-kb workspace resolve --json git-kb workspace checkouts --json git-kb status --json git-kb diff ``` Locate a document without assuming its workspace directory name: ```bash git-kb workspace path tasks/my-task --json ``` Save changes with an explicit document scope: ```bash git-kb commit -m "Save task changes" tasks/my-task ``` To discard edits to one document, run `git-kb reset tasks/my-task`. To remove its checkout, run `git-kb clear tasks/my-task`. Review the diff first. Metadata changes made by `git-kb set` also stay in the workspace until committed. ## A pathspec matches nothing or too much `checkout`, `commit`, `rm`, `reset`, `clear` and `filter --rm` refuse a pathspec that matches nothing with exit 17 (`pathspec_no_match`). `details.pathspecs` names every miss, and nothing changes. `rm --force` skips such a pathspec instead. A lone old slug of a renamed document can be answered with exit 10 (`document_not_found`) naming the new slug. `/` and `**` mean every document and never miss. Check how a pathspec reads. A document id is that document. `tasks/` is `tasks` and every document under it. `tasks/*` is the direct children, because `*`, `?` and `[…]` stay within one folder level; use `tasks/**` to cross folders. A bare `tasks` is the document at that slug when there is one, else the folder; `list --path`, `status` and `diff` read it as the folder. Push, pull, fetch, `sync status` and `sync converge` read pathspecs the same way; for them, a bare `context` is the document at that slug when one exists here or at the remote, else the folder. A pathspec that selects several documents needs `-r` for `rm`, `rm --hard` and `filter --rm`: ```bash git-kb list --path tasks/ --json git-kb rm -r tasks/old/ ``` A purge (`rm --hard`, `filter --rm`) takes only ids, exact slugs, folders written with a trailing `/`, or globs. A bare name that no document holds, or a folder written without its trailing `/`, is refused with exit 4, even with `--force`. `rm --hard --force` skips any other unmatched name; `filter --rm --force` only confirms and still refuses it (exit 17). ## Semantic search has no results Check the daemon, semantic index status, and embeddings: ```bash git-kb daemon status --json git-kb semantic status --json ``` Initialize the local semantic model and embed committed documents if the index is missing or stale: ```bash git-kb semantic init git-kb semantic index --json ``` If initialization fails, inspect `git-kb daemon logs --tail 100`. Model availability, backend support, and unembedded content can all affect results. See [Configuration](/docs/reference/configuration/) for embedding settings. ## Sync divergence or conflicts Start with the plan for the remote. Replace `origin` with your configured remote name: ```bash git-kb sync status origin --json git-kb sync status origin --json -- 'tasks/*' ``` Run the rows in order. `auto` rows run with `git-kb sync converge origin`; an `agent` row prints the command for its decision; a `hold` row names the pull that merges into a file with uncommitted edits; a `human` row (sign-in, an unreachable remote, an upgrade, an integrity repair) is reported, not worked around. `sync status` exits `0` at a fixed point, `70` with auto or agent rows pending, `71` for a hold and `72` for a human row. A row still present after you ran its command is a result to report, not to retry. [Team Collaboration](/docs/guides/team-collaboration/#read-the-plan-run-the-rows) describes the tiers. Inspect a row before deciding it: ```bash git-kb sync show conflict-1 --remote origin git-kb diff --three-way --remote origin --json -- 'tasks/*' git-kb merge --preview origin --json -- 'tasks/*' ``` A scoped command that matches nothing is refused rather than answered for an empty scope. `push`, `pull` and `fetch` exit 17 (`pathspec_no_match`) and transfer nothing; `push` judges only the committed documents held here, and `pull` and `fetch` exit 4 for a document id found neither here nor at the remote. An online `sync status` exits 4 when nothing in the remote's selection matches, and names the `pull` or `sync select` that brings it in. `sync converge` runs what its other pathspecs match, lists the misses under `unmatched`, and exits 73 where it would have exited 0. An offline `sync status` never judges a pathspec. Stored selection patterns (`git-kb sync select`) keep their own grammar. When a pull stops at a conflict, the merge is in the checked-out file. Inspect the stopped rebase, edit the conflict blocks, then continue: ```bash git-kb rebase --json git-kb status # Edit the <<<<<<< ours / ||||||| base / ======= / >>>>>>> theirs blocks. git-kb rebase --continue ``` `git-kb checkout --ours <document>` or `--theirs` takes one side whole; `git-kb rebase --abort` discards the stopped rebase. To decide a whole document instead, run the command its `conflict-N` row prints: `git-kb conflict accept <slug> --theirs <content-id>` with one of `--local` (keep yours), `--remote` (take the remote's) or `--auto` (the one modified more recently). `git-kb conflict show --json` lists the conflicts. A merge started with `git-kb merge` continues with `git-kb merge --continue` or stops with `git-kb merge --abort`. Never edit files under `.kb/` other than workspace checkouts; GitKB manages the rest. ## Code intelligence returns empty or stale results ```bash git-kb code stats --json git-kb code doctor --json git-kb doctor --check repos --json git-kb workspace list --json git-kb repo list --json ``` Check repository discovery, the query branch, and linked-worktree registration. Index the intended source directory, then query a known file: ```bash git-kb code index src/ git-kb code symbols --file src/main.rs --json ``` With the daemon running, file watching maintains the index after saves. Missing worktree registration, excluded paths, unsupported languages, or a different default branch can explain missing results. [Code Intelligence](/docs/core-concepts/code-intelligence/) describes branch queries and index scope. ## Socket permissions On Unix, daemon state normally lives under `.kb/.cache/`, including `gitkb.sock`. Check the actual path and owner reported by `git-kb daemon status --json`. Use `git-kb daemon stop` and `git-kb daemon start --background` to restart the service. Do not remove a socket while its daemon is running; inspect the ownership error and correct access to the KB directory first. ## Integrity checks | Command | Scope | | ---------------------------------- | ---------------------------------------------------------------------- | | `git-kb doctor --json` | Repository discovery, code, and KB diagnostics with suggested actions. | | `git-kb fsck --json` | Local KB integrity checks. | | `git-kb verify --json` | Canonical file store integrity. | | `git-kb info` | KB statistics and storage information. | | `git-kb sync status origin --json` | The sync plan for a remote: its rows and their commands. | `git-kb doctor --fix` applies the safe local repairs it supports and reruns checks. Inspect the diagnostic first to choose the relevant repair. ## Report an issue Collect the failing command, its output, `git-kb --version`, and steps to reproduce. Redact credentials from configuration and logs. The feedback command works without a KB or sign-in. Preview a report before sending it: ```bash git-kb feedback --category bug --message "Steps to reproduce..." --dry-run --json ``` Bug reports attach `doctor --json` output. `--include-diagnostics` additionally collects bounded system and tool details. Remove `--dry-run` when you want to submit the report. You can also use the [GitKB issue tracker](https://github.com/gitkb/gitkb-releases/issues). ## Related docs - [Configuration](/docs/reference/configuration/) — Project settings. - [Daemon](/docs/core-concepts/daemon/) — Background service behavior. - [CLI Reference](/docs/cli-reference/) — Installed command help.