This page documents the kontxt CLI as it ships from npm. Every example usesDocumentation Index
Fetch the complete documentation index at: https://docs.4stax.com/llms.txt
Use this file to discover all available pages before exploring further.
npx -y @4stax/kontxt so you do not need a global install.
If you prefer a global command, you can install the package globally and run kontxt directly. The flags and subcommands are the same.
Setup and initialization
init creates the local directory at ~/.kontxt/ and the SQLite vault at ~/.kontxt/vault.db. It also tries to configure supported MCP hosts.
Writing memories
add
Use add when you want to explicitly store a durable memory.
- Use short, declarative sentences.
- Attach a project label with
-pwhen it belongs to a specific repo or product. - Use
decisionfor irreversible choices so they are always easy to retrieve later.
Reading and searching
search
Use search to retrieve relevant memories. Search quality depends on your embedding backend.
list
Use list to browse what is stored.
Editing and deleting
edit
Use edit when a memory is mostly correct but needs updating.
delete
Use delete to remove a memory by id. Partial id matches are supported.
Capture from transcripts
capture
Use capture to extract durable context from a text file or stdin.
extract
extract is an alias for capture:
Scanning a codebase
scan
Use scan when you want kontxt to ingest stable facts about a repo or directory.
- Project name and purpose
- Tech stack
- Repo structure
- Commands you run often
- Secrets
- Large logs
- Files you would not want summarized into memory
MCP server commands
serve
Run the MCP server in the foreground. This is what most MCP hosts run.
start and stop
Use these when you want kontxt running as a background daemon.
Maintenance
status
Use status to see vault stats and embedding mode.

