CLI Commands
The mem CLI is built on the Typer framework and serves as a thin command-line wrapper around MemovManager.
Core Commands
Initialize Repository
mem initInitialize .mem/ repository in the current directory.
Track Files
mem track <files>Start tracking specified files. Files must be tracked before they can be included in snapshots.
Example:
mem track src/main.py src/utils.pyCreate Snapshot
mem snap [--files <files>] [--prompt <prompt>] [--response <response>]Create a snapshot of tracked files with optional prompt/response metadata.
Options:
| Option | Description |
|---|---|
--files | Comma-separated list of files to snapshot |
--prompt | User prompt to record |
--response | AI response to record |
--by-user | Mark as user-made changes (default: false) |
Example:
mem snap --files "src/api.py,src/models.py" --prompt "Add user authentication"View History
mem history [--limit <n>]Show commit history with prompts, responses, and file changes.
Example:
mem history --limit 10Show Commit Details
mem show <hash>Display detailed information about a specific commit.
Jump to Snapshot
mem jump <hash>Restore files from a historical snapshot, creating a new branch.
Example:
mem jump abc1234Check Status
mem statusShow working directory status: untracked, modified, and clean files.
Branch Commands
List Branches
mem branchList all branches with their current commit hashes.
Create Branch
mem branch <name>Create a new branch at the current HEAD.
Switch Branch
mem switch <name>Switch to an existing branch.
File Management
Rename File
mem rename <old> <new>Rename a tracked file, updating the tracking metadata.
Remove File
mem remove <file>Remove a file from tracking.
Amend Commit
mem amend <hash> [--prompt <prompt>] [--response <response>]Update the notes (prompt/response) of an existing commit without changing the commit itself.
RAG Mode Commands
These commands require installation with [rag] extras.
Sync to VectorDB
mem syncWrite pending operations to VectorDB for semantic search capabilities.
Semantic Search
mem search <query> [--type <type>]Search through code history by prompt text, file paths, or content.
Options:
| Option | Values | Description |
|---|---|---|
--type | prompt, response, code | Filter by content type |
--limit | number | Maximum results to return |
Web UI Commands
Start Web UI
mem ui start [--port <port>]Launch the Web UI server (default port: 38888).
Options:
| Option | Default | Description |
|---|---|---|
--port | 38888 | Port to run the server on |
--foreground | false | Run in foreground (blocking) |
Example:
mem ui start --port 8080Command Reference Table
| Command | Purpose | Key Options |
|---|---|---|
mem init | Initialize repository | — |
mem track | Start tracking files | <files> |
mem snap | Create snapshot | --files, --prompt, --response |
mem history | Show history | --limit |
mem show | Show commit | <hash> |
mem jump | Time-travel | <hash> |
mem status | Check status | — |
mem branch | Manage branches | [name] |
mem switch | Switch branch | <name> |
mem rename | Rename file | <old>, <new> |
mem remove | Remove file | <file> |
mem amend | Update notes | <hash>, --prompt, --response |
mem sync | Sync VectorDB | — |
mem search | Semantic search | <query>, --type |
mem ui | Start Web UI | --port, --foreground |
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (validation failed, operation failed, RAG unavailable) |
Common Options
These options are available for most commands:
| Option | Type | Default | Description |
|---|---|---|---|
--loc | string | . | Project directory path |
--prompt | string | None | Descriptive prompt |
--response | string | None | AI/user response |
--by-user | bool | false | Mark as user operation |
Output Formatting
The CLI uses Rich library for formatted output:
- Tables - Results display in structured table format
- Colors - Status indicators with color coding
- JSON - Use
--format jsonfor machine-readable output