Configuration
GitKB reads project settings from .kb/config.toml. Run git-kb init to initialize a KB, then change the settings your project needs.
# 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_remoteconfig 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. |
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.
[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.
git-kb remote add origin https://gitkb.com/api/v1/sync/acme/engineering
git-kb remote list --json
git-kb sync status origin --jsonSign 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:
git-kb remote add ci https://gitkb.com/api/v1/sync/acme/engineering --token-env GITKB_TOKEN
# or: --token-file <path>, --token-command <cmd>[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:
git-kb create task --next tasks/project --remote origin --title "Add sign-in" --json
git-kb slug next tasks/project --remote origin --jsoncreate --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:
[repos]
strategy = "monorepo"For explicit repository entries:
[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
[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.
[daemon]
sync_interval_secs = 15
auto_start = trueEmbeddings
Initialize local semantic search with git-kb semantic init and embed committed documents with git-kb semantic index.
[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.
[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
[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
[hooks]
context_injection = true
auto_commit_link = true
auto_worktree_bind = true
auto_progress = false
prompt_context = falseThese 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 — Command help captured from the installed CLI.
- Daemon — Watching and indexing behavior.
- Team Collaboration — Sparse sync and shared work.