{{ theme.skipToContentLabel || 'Skip to content' }}

CLI ​

text
kontext [-C <dir>] <command> [options]

-C, --dir <dir> runs as if kontext was started in <dir> (works with every command). kontext <command> --help prints the options below.

Bootstrap ​

kontext init ​

Runs scan → history → render → wire → deepen. Safe to re-run.

OptionDefaultMeaning
--no-hooksdo not install git hooks
--connect <targets>also wire clients, comma-separated (claude,claude-hooks,cursor,opencode,agents-md)
--deepenrun pending deepen tasks with an LLM adapter
--llm <adapter>init.llmadapter with an llm op
--jobs <n>2parallel LLM calls
--max <n>50tasks per run
SubcommandMeaning
kontext init statusphase status and deepen progress
kontext init next [-n <count>] [--inline]print the next task(s); --inline attaches file excerpts (for pasting into a chat model)
kontext init submit <file|->record a task result (JSON: task_id, summary, overview, decisions, learnings)
kontext init skip <task> [--reason <text>]skip a task

Everyday ​

kontext brief ​

OptionDefaultMeaning
-f, --focus <path|word>prioritise these paths or topics (repeatable)
--budget <tokens>brief.budget_tokensapproximate size
--format <fmt>texttext, json, claude-hook (SessionStart additionalContext)
--no-adaptersskip adapter brief sections

kontext search <query…> ​

OptionDefaultMeaning
-k, --kind <kind>decision, convention, learning, incident, architecture, doc, commit (repeatable)
-s, --source <name>alllocal and/or adapter names (repeatable)
-n, --limit <n>10maximum hits
--jsonhits as JSON

kontext read <uri> ​

-l, --level <0|1|2> (default 2). URIs: kx:<id>, file:<path>[#section], git:<sha>, inbox:<id>, a plain repository path, or an adapter URI.

kontext why <target> ​

target is a path, path:line, path:start-end, a commit sha, or a symbol/topic. -n, --limit <n> (default 12) items per section.

kontext log ​

OptionDefaultMeaning
-k, --kind <kind>decisionkind to list
--allinclude superseded and rejected entries
-n, --limit <n>50rows
--jsonrows as JSON

Capturing and committing ​

kontext capture ​

OptionMeaning
-k, --kind <kind>decision, convention, learning (pitfall), incident — required
-t, --title <text>short statement — required
-b, --body <text> / --file <path|-> / stdinthe body
--summary <text>one line (derived from the body when omitted)
-p, --paths <a,b>paths or globs it governs
--tags <a,b>tags
--supersedes <id,…>entries it replaces
--status <status>proposed or accepted (decisions default to accepted)
--privatekeep it personal (never promoted)
--promotewrite into the store now instead of the inbox

kontext inbox [list | show <id> | drop <id…>] ​

Local candidates. list is the default.

kontext promote <id…> [--no-stage] ​

Write candidates into the store and git add them.

kontext prepare-commit [--promote <id>]… [--drop <id>]… ​

The report agents get from ctx_prepare_commit.

kontext check [--staged] ​

Validate all entries (or exactly what is staged) and scan them for secrets. Exit status 1 on errors.

Git hooks ​

CommandMeaning
kontext hooks install [--dir <dir>]install into core.hooksPath, .git/hooks, or <dir>
kontext hooks uninstall [--dir <dir>]remove kontext's blocks, restore chained originals
kontext hooks statuswhich hooks carry the block
kontext hook <name> [args…]entry point called by the hooks (pre-commit, prepare-commit-msg, post-commit, post-merge, post-rewrite)

Adapters ​

CommandMeaning
kontext adapters [list]active and inactive adapters, with the reason
kontext adapters test [<name>] [--query <q>]health check and a sample call of each op
kontext adapters inspect <name>an MCP adapter's tools and input schemas
kontext adapters add <preset> [--scope user|repo|local] [--var k=v]… [--force]append a preset to a config layer
kontext presets [<name>]list presets, or print one
kontext trusttrust the adapters declared in the shared config (after showing them)
kontext outbox [list | flush [--quiet]]queued deliveries; deliver now
kontext sync [--all]queue sync events for knowledge at HEAD (--all: every entry once)

Clients and servers ​

CommandMeaning
kontext mcprun the MCP server on stdio
kontext connect <target> [--write]claude, claude-hooks, codex, cursor, opencode, agents-md
kontext call <tool> ['<json>']call an agent tool locally, e.g. kontext call ctx_why '{"target":"src/api"}'

Maintenance ​

CommandMeaning
kontext statusidentity, config layers, store, index, inbox, init progress, adapters, hooks, outbox
kontext reindexrebuild the local search index

Environment variables ​

VariableMeaning
KONTEXT_CONFIG_DIRuser config directory (default $XDG_CONFIG_HOME/kontext or ~/.config/kontext)
KONTEXT_DIRrepository for kontext mcp when not started inside it
KONTEXT_SKIP=1hooks do nothing (one-off bypass)
KONTEXT_TRUST_REPO_ADAPTERS=1trust repository-declared adapters without kontext trust (CI, sandboxes)

Released under the MIT or Apache-2.0 license.