CLI Reference
CLI Reference
Complete reference for all memories.sh CLI commands.
The memories CLI is the primary interface for managing your AI agent memory store. All commands operate on a local SQLite database at ~/.config/memories/local.db.
| Command | Description |
|---|
init | Initialize memories for a project or globally |
add | Add a new memory |
recall | Get rules and relevant memories for AI agents |
prompt | Output memories formatted for AI system prompts |
| Command | Description |
|---|
search | Full-text search across memories |
list | List memories with optional filters |
| Command | Description |
|---|
edit | Edit an existing memory |
forget | Soft-delete memories by ID or bulk filter |
tag | Bulk tag and untag operations |
| Command | Description |
|---|
generate | Generate IDE rule files from memories |
diff | Show what changed since last generate |
| Command | Description |
|---|
export | Export memories to JSON or YAML |
import | Import memories from JSON or YAML |
ingest | Import from existing IDE rule files |
| Command | Description |
|---|
config | Manage agent configuration |
serve | Start the MCP server |
sync | Manage cloud sync |
stats | Show memory statistics |
doctor | Check health and diagnose issues |
hook | Manage git hooks |
login | Authenticate for cloud features |
- When inside a git repository, commands automatically scope to the current project (detected from the
origin remote URL)
- When outside a git repo, or when
--global is passed, memories are stored with global scope
- All memories are stored in a single SQLite database with FTS5 full-text search
- Soft-deleted memories are retained in the database but excluded from all queries