CLI Commands

The
code
mem
CLI is built on the Typer framework and serves as a thin command-line wrapper around
code
MemovManager
.

Core Commands

Initialize Repository

bash
mem init
Initialize
code
.mem/
repository in the current directory.

Track Files

bash
mem track <files>
Start tracking specified files. Files must be tracked before they can be included in snapshots.
Example:
bash
mem track src/main.py src/utils.py

Create Snapshot

bash
mem snap [--files <files>] [--prompt <prompt>] [--response <response>]
Create a snapshot of tracked files with optional prompt/response metadata.
Options:
OptionDescription
code
--files
Comma-separated list of files to snapshot
code
--prompt
User prompt to record
code
--response
AI response to record
code
--by-user
Mark as user-made changes (default: false)
Example:
bash
mem snap --files "src/api.py,src/models.py" --prompt "Add user authentication"

View History

bash
mem history [--limit <n>]
Show commit history with prompts, responses, and file changes.
Example:
bash
mem history --limit 10

Show Commit Details

bash
mem show <hash>
Display detailed information about a specific commit.

Jump to Snapshot

bash
mem jump <hash>
Restore files from a historical snapshot, creating a new branch.
Example:
bash
mem jump abc1234

Check Status

bash
mem status
Show working directory status: untracked, modified, and clean files.

Branch Commands

List Branches

bash
mem branch
List all branches with their current commit hashes.

Create Branch

bash
mem branch <name>
Create a new branch at the current HEAD.

Switch Branch

bash
mem switch <name>
Switch to an existing branch.

File Management

Rename File

bash
mem rename <old> <new>
Rename a tracked file, updating the tracking metadata.

Remove File

bash
mem remove <file>
Remove a file from tracking.

Amend Commit

bash
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
code
[rag]
extras.

Sync to VectorDB

bash
mem sync
Write pending operations to VectorDB for semantic search capabilities.
bash
mem search <query> [--type <type>]
Search through code history by prompt text, file paths, or content.
Options:
OptionValuesDescription
code
--type
code
prompt
,
code
response
,
code
code
Filter by content type
code
--limit
numberMaximum results to return

Web UI Commands

Start Web UI

bash
mem ui start [--port <port>]
Launch the Web UI server (default port: 38888).
Options:
OptionDefaultDescription
code
--port
38888Port to run the server on
code
--foreground
falseRun in foreground (blocking)
Example:
bash
mem ui start --port 8080

Command Reference Table

CommandPurposeKey Options
code
mem init
Initialize repository
code
mem track
Start tracking files
code
<files>
code
mem snap
Create snapshot
code
--files
,
code
--prompt
,
code
--response
code
mem history
Show history
code
--limit
code
mem show
Show commit
code
<hash>
code
mem jump
Time-travel
code
<hash>
code
mem status
Check status
code
mem branch
Manage branches
code
[name]
code
mem switch
Switch branch
code
<name>
code
mem rename
Rename file
code
<old>
,
code
<new>
code
mem remove
Remove file
code
<file>
code
mem amend
Update notes
code
<hash>
,
code
--prompt
,
code
--response
code
mem sync
Sync VectorDB
code
mem search
Semantic search
code
<query>
,
code
--type
code
mem ui
Start Web UI
code
--port
,
code
--foreground

Exit Codes

CodeMeaning
code
0
Success
code
1
Error (validation failed, operation failed, RAG unavailable)

Common Options

These options are available for most commands:
OptionTypeDefaultDescription
code
--loc
string
code
.
Project directory path
code
--prompt
stringNoneDescriptive prompt
code
--response
stringNoneAI/user response
code
--by-user
boolfalseMark 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
    code
    --format json
    for machine-readable output