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