Built with Node.js + TypeScript. DeepSeek is the default provider, and OpenAI-compatible APIs are supported.
Memo Code is an open-source coding agent that lives in your terminal, understands repository context, and helps you move faster with natural-language commands.
npm install -g @memo-code/memo
# or
pnpm add -g @memo-code/memo
# or
yarn global add @memo-code/memo
# or
bun add -g @memo-code/memoexport DEEPSEEK_API_KEY=your_key # or OPENAI_API_KEYmemo
# First run guides provider/model setup and saves config to ~/.memo/config.toml- Interactive mode:
memo(default TUI; supports multi-turn chat, streaming, tool visualization, shortcuts). - One-shot mode:
memo "your prompt" --once(plain text output; useful for scripts). - Dangerous mode:
memo --dangerousormemo -d(skip tool approvals; use carefully). - Version:
memo --versionormemo -v.
Location: ~/.memo/config.toml (can be changed via MEMO_HOME).
current_provider = "deepseek"
stream_output = false
[[providers.deepseek]]
name = "deepseek"
env_api_key = "DEEPSEEK_API_KEY"
model = "deepseek-chat"
base_url = "https://api.deepseek.com"You can configure multiple providers and switch with current_provider.
Both local and remote MCP servers are supported:
# Local MCP server
[mcp_servers.local_tools]
command = "/path/to/mcp-server"
args = []
# Remote HTTP MCP server
[mcp_servers.remote]
type = "streamable_http"
url = "https://your-mcp-server.com/mcp"
# headers = { Authorization = "Bearer xxx" }You can also manage MCP configs via CLI (aligned with Codex CLI style):
# List MCP servers
memo mcp list
# Add local MCP server (stdio)
memo mcp add local_tools -- /path/to/mcp-server --flag
# Add remote MCP server (streamable HTTP)
memo mcp add remote --url https://your-mcp-server.com/mcp --bearer-token-env-var MCP_TOKEN
# Show/remove
memo mcp get remote
memo mcp remove remotebash: execute shell commandsread: read fileswrite: write filesedit: edit filesglob: find files by patterngrep: search content by regexwebfetch: fetch webpagessave_memory: save long-term memorytodo: manage a task list
More tools can be added through MCP.
Memo includes a tool-approval mechanism to reduce risky operations:
- Auto-approve: safe tools (
read,glob,grep, etc.) - Manual approval: risky tools (
bash,write,edit, etc.) - Approval options:
once: approve current operation onlysession: approve all matching operations for this sessiondeny: reject operation
- Dangerous mode:
--dangerousskips all approvals (trusted scenarios only)
All sessions are saved to ~/.memo/sessions/, grouped by working directory and date:
~/.memo/sessions/
βββ workspace-name/
β βββ 2026-02-01_143020_abc123.jsonl
β βββ 2026-02-01_150315_def456.jsonl
βββ another-project/
βββ 2026-02-01_160000_xyz789.jsonl
JSONL format is useful for analysis and debugging.
pnpm install
pnpm start
# or
pnpm start "prompt" --oncepnpm run build # generates dist/index.jspnpm test # all tests
pnpm test packages/core # core package
pnpm test packages/tools # tools packagenpm run format # format all files
npm run format:check # check format (CI)memo-cli/
βββ packages/
β βββ core/ # core logic: Session, tool routing, config
β βββ tools/ # built-in tool implementations
β βββ cli/ # TUI interface
βββ docs/ # technical docs
βββ dist/ # build output
/help: show help and shortcut guide./models: list available Provider/Model entries and switch with Enter; also supports direct selection like/models deepseek./context: open 80k/120k/150k/200k options and apply immediately.$ <cmd>: run a local shell command in current cwd and display result directly (Shell Result).resumehistory: typeresumeto list and load past sessions for current directory.- Exit and clear:
exit//exit,Ctrl+Lfor new session,Esc Escto cancel current run or clear input. - Tool approval: risky operations open an approval dialog with
once/session/deny.
Session logs are written only when a session contains user messages, to avoid empty files.
- Runtime: Node.js 18+
- Language: TypeScript
- UI: React + Ink
- Protocol: MCP (Model Context Protocol)
- Token counting: tiktoken
- User Guide - User-facing docs by module
- Core Architecture - Core implementation details
- CLI Adaptation History - Historical migration notes (Tool Use API)
- Contributing - Contribution guide
- Project Guidelines - Coding conventions and development process
MIT