Quick Start

Explore a codebase

After installing GitKB, 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:

shell
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:

shell
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 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:

shell
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:

shell
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/<name>/. The main workspace is usually .kb/workspaces/main/; linked Git worktrees have their own identities.

To edit an existing document:

shell
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

shell
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:

shell
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 for sparse sync and conflict recovery.

Next steps