cohaku CLI provides full access to the memory system from your terminal. Every operation available through MCP tools has a corresponding CLI command.
Installation
Quick Setup
- Initialize the SQLite database at
~/.config/cohaku/memory.db - Auto-detect installed AI coding tools (Claude Code, Cursor, VS Code, etc.)
- Register the MCP server with each detected tool
Command Groups
| Group | Commands | Description |
|---|---|---|
| Memory | add, search, update, delete, context, duplicates, consolidate | Store and retrieve memories |
| Graph | entity, edge, graph | Knowledge graph operations |
| Episode | episode | Chronological event logging |
| Session | session | Work session lifecycle |
| Generate | generate | Export memories to editor config files |
Server Commands
| Command | Description |
|---|---|
cohaku mcp | Start MCP server (stdio transport) |
cohaku start | Start MCP server + dashboard |
cohaku serve | Start HTTP API + dashboard (no MCP) |
Common Options
Scope
Most commands accept a--scope / -s option:
| Value | Description |
|---|---|
project | Current project only (default) |
global | Global scope only |
all | Both project and global |
Memory Layers
| Layer | Priority | Description |
|---|---|---|
rule | 10 | Permanent constraints, always loaded first |
working | 5 | Temporary session-scoped notes |
long_term | 1 | Durable cross-session knowledge (default) |