Configuration

GitKB reads project settings from .kb/config.toml. Run git-kb init to initialize a KB, then change the settings your project needs.

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

KeyValue
user.name, user.emailThe commit author. Stored per user in ~/.config/gitkb/config.toml, never in .kb.
daemon.sync_interval_secsSeconds 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_contexttrue or false; see Harness hook features.
sync.autostashtrue (default) lets pull merge into files with uncommitted edits; false leaves them as they are.
sync.default_remoteA configured remote’s name. git-kb config unset sync.default_remote clears it.
sync.remotes.<name>.urlAn https://, http:// or gitkb:// URL.
sync.remotes.<name>.token.env, .token.file, .token.commandThe 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.

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

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

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

StrategySource of repositories
customExplicit entries under [repos.<name>]; the default strategy.
metaA workspace managed by meta.
git_submodulesGit submodules.
monorepoOne 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
SettingDefaultMeaning
backend"candle"Inference backend ("candle").
modelBackend defaultOptional model override.
batch_size16Maximum texts per forward pass; must be positive.
batch_delay_ms0Optional 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.