memories.sh
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 Overview

Core Commands

CommandDescription
initInitialize memories for a project or globally
addAdd a new memory
recallGet rules and relevant memories for AI agents
promptOutput memories formatted for AI system prompts

Query Commands

CommandDescription
searchFull-text search across memories
listList memories with optional filters

Management Commands

CommandDescription
editEdit an existing memory
forgetSoft-delete memories by ID or bulk filter
tagBulk tag and untag operations

Generation Commands

CommandDescription
generateGenerate IDE rule files from memories
diffShow what changed since last generate

Data Commands

CommandDescription
exportExport memories to JSON or YAML
importImport memories from JSON or YAML
ingestImport from existing IDE rule files

System Commands

CommandDescription
configManage agent configuration
serveStart the MCP server
syncManage cloud sync
statsShow memory statistics
doctorCheck health and diagnose issues
hookManage git hooks
loginAuthenticate for cloud features

Global Behavior

  • 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