The Konteks CLI manages local project memory. It can run through npx, bunx, pnpm dlx, or yarn dlx for one-off commands, but MCP server registration should use the installed command form that matches the user's runtime.
For terms, see the Glossary.
[!INFO] The examples below use
konteks, the CLI display name. When running through a package runner, use the published package name, for examplenpx -y konteks-cli <command>.
| Command | Capability | Use When |
|---|---|---|
konteks init |
Initialize | Prepare a project for local memory storage. |
konteks rebuild |
Rebuild | Rebuild derived project memory artifacts from scratch while preserving durable memories and diary entries. |
konteks status |
Status | Check memory health and freshness. |
konteks memory export <file> |
Export | Write portable durable memories and diary entries to JSON. |
konteks memory import <file> |
Import | Merge portable durable memories and diary entries from JSON. |
konteks backup <file> |
Backup | Create a full .konteks .tar.gz archive. |
konteks restore <file> |
Restore | Restore a full .konteks archive. |
konteks mcp |
Serve | Start the MCP server for an agent client. |
konteks install-skills |
Compatibility | Install Konteks skills for agents without MCP prompt support. |
Important
Bun users should configure MCP clients with "command": "bunx", "args": ["--bun", "konteks-cli", "mcp"]. Node users can configure MCP with "command": "konteks-cli", "args": ["mcp"]; the direct konteks-cli command requires Node.js on PATH because the current package bin uses a Node shebang.
Durable memory export/import is the portable path. It includes saved observations and diary entries, then rebuilds local retrieval indexes on import:
konteks memory export memories.konteks.json
konteks memory import memories.konteks.jsonBy default, export includes only active durable memory. Use --include-inactive to include soft-deleted or suppressed records. Use konteks memory import --dry-run <file> to validate and preview import counts without writing.
Full backups are exact operational snapshots of the project memory directory:
konteks backup konteks-backup.tar.gz
konteks restore konteks-backup.tar.gzRestore refuses to replace a non-empty memory directory unless --force is provided. Forced restore creates a safety backup archive before replacing existing memory.
These commands inspect MCP behavior from the terminal without registering an agent.
| Command | Shows |
|---|---|
konteks mcp tools |
Choose an MCP tool interactively, review its schema, enter input values, and run it. |
konteks mcp tools <tool> |
Review and run one MCP tool by name. |
konteks mcp tools --json <tool> |
Print the tool result as JSON. |
Important
konteks mcp tools runs the selected MCP tool after confirmation. Optional text, number, and JSON fields can be left blank to omit them. Complex fields such as arrays and objects are entered as JSON text.
If your agent supports MCP but does not show MCP prompts in its autocomplete UI (e.g. Codex), you can install native skills as a workaround:
konteks install-skills [--global]This writes the Konteks lifecycle prompts (warm-up, recall, save) as native skills into .agents/skills (local) or ~/.agents/skills (global).