{"skill":{"slug":"memories-cli","displayName":"memories.sh CLI","summary":"CLI reference and workflows for memories.sh — the persistent memory layer for AI agents. Use when: (1) Running memories CLI commands to add, search, edit, or...","description":"---\nname: memories-cli\ndescription: \"CLI reference and workflows for memories.sh — the persistent memory layer for AI agents. Use when: (1) Running memories CLI commands to add, search, edit, or manage memories, (2) Setting up memories.sh in a new project (memories init), (3) Generating AI tool config files (CLAUDE.md, .cursor/rules, etc.), (4) Importing existing rules from AI tools (memories ingest), (5) Managing cloud sync, embeddings, or git hooks, (6) Troubleshooting with memories doctor, (7) Working with memory templates, links, history, or tags.\"\n---\n\n# memories-cli\n\nCLI reference for `@memories.sh/cli` — manage memories, generate configs, and sync across tools.\n\n> **The CLI is the primary way to interact with memories.sh.** Use it to store memories, generate native config files, and manage your memory store. For environments where the CLI isn't available (v0, bolt.new, Lovable, or other browser-based agents), use the [MCP server](../memories-mcp/SKILL.md) as a fallback.\n\n## Install & Init\n\n```bash\nnpm install -g @memories.sh/cli   # or: npx @memories.sh/cli\nmemories init                      # Initialize in current project\n```\n\n`memories init` auto-detects AI tools (Claude Code, Cursor, Windsurf, VS Code) and configures MCP + generates instruction files.\n\n## Command Quick Reference\n\n| Command | Purpose |\n|---------|---------|\n| `memories add <content>` | Store a memory |\n| `memories recall` | Context-aware memories for current project |\n| `memories search <query>` | Full-text search |\n| `memories list` | List memories with filters |\n| `memories edit <id>` | Edit content, type, or tags |\n| `memories forget <id>` | Soft-delete a memory |\n| `memories generate` | Generate AI tool config files |\n| `memories prompt` | Generate a system prompt |\n| `memories serve` | Start MCP server |\n\n## Core Workflows\n\n### 1. New Project Setup\n\n```bash\ncd my-project\nmemories init              # Detect tools, configure MCP, generate files\nmemories add \"Use pnpm\" --type rule\nmemories add \"Chose Supabase for auth\" --type decision\nmemories generate          # Update all AI tool configs\n```\n\n### 2. Ingest Existing Rules\n\n```bash\nmemories ingest claude     # Import from CLAUDE.md\nmemories ingest cursor     # Import from .cursorrules / .cursor/rules/\nmemories ingest copilot    # Import from copilot-instructions.md\n```\n\n### 3. Search & Recall\n\n```bash\nmemories search \"auth\"                    # Full-text search\nmemories search \"auth\" --semantic         # Vector similarity (requires embeddings)\nmemories recall                           # Context for current project\nmemories list --type rule                 # Filter by type\nmemories list --tags api,auth             # Filter by tags\n```\n\n### 4. Generate Configs\n\n```bash\nmemories generate                         # All detected tools\nmemories generate claude                  # Only CLAUDE.md\nmemories generate cursor                  # Only .cursor/rules/memories.mdc\nmemories diff                             # Preview changes before generating\n```\n\nSupported targets: `claude`, `cursor`, `copilot`, `windsurf`, `cline`, `roo`, `gemini`\n\n### 5. Cloud Sync\n\n```bash\nmemories login                            # Device code auth flow\nmemories sync                             # Sync local DB to cloud\nmemories files ingest                     # Upload config files\nmemories files apply --global --force     # Restore configs on new machine\n```\n\n### 6. Embeddings\n\n```bash\nmemories embed                            # Generate embeddings for all memories\nmemories embed --dry-run                  # Preview what would be embedded\nmemories config model <model-name>        # Change embedding model\n```\n\n### 7. Maintenance\n\n```bash\nmemories doctor                           # Diagnose issues\nmemories stats                            # Memory statistics\nmemories stale --days 90                  # Find stale memories\nmemories review                           # Interactive cleanup\nmemories validate                         # Check memory integrity\n```\n\n## Memory Types\n\nUse `--type` flag with `add`:\n- **rule** — `memories add \"Always use strict mode\" --type rule`\n- **decision** — `memories add \"Chose JWT for auth\" --type decision`\n- **fact** — `memories add \"Rate limit: 100/min\" --type fact`\n- **note** — (default) `memories add \"Refactor auth module\"`\n\n## Scopes\n\n- **project** (default) — Scoped to current git repo\n- **global** — `memories add \"Use TypeScript\" --type rule --global`\n\nWhen using MCP instead of CLI commands (for example from browser tools or agents running outside the repo), use `add_memory` with `project_id` to force project scope.\n\n## Advanced Features\n\n- **Templates**: `memories add --template decision` — structured prompts for common patterns\n- **Links**: `memories link <id1> <id2> --type supports` — relate memories\n- **History**: `memories history <id>` / `memories revert <id> --to <version>`\n- **Tags**: `memories tag <id> add api,auth`\n- **Export/Import**: `memories export > backup.yaml` / `memories import backup.yaml`\n- **Git Hooks**: `memories hook install` — auto-generate on commit\n\n## Reference Files\n\n- **Full command reference**: See [references/commands.md](references/commands.md) for all commands with complete options and flags\n- **Workflow recipes**: See [references/workflows.md](references/workflows.md) for multi-step recipes and automation patterns\n","topics":["Git","Sync"],"tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":350,"installsAllTime":13,"installsCurrent":1,"stars":0,"versions":1},"createdAt":1771258876873,"updatedAt":1778990989384},"latestVersion":{"version":"1.0.0","createdAt":1771258876873,"changelog":"Initial release of memories-cli — the command-line utility for managing persistent memory for AI agents.\n\n- Adds CLI reference and documentation for installation, initialization, and integration with AI tools (Claude, Cursor, Copilot, and more).\n- Provides quick command reference for adding, searching, editing, and managing memories.\n- Documents core workflows: new project setup, rule ingestion, searching, config generation, cloud sync, embeddings, and maintenance.\n- Describes memory types, project/global scopes, and advanced features (templates, links, tags, git hooks, import/export).\n- Includes links to comprehensive command and workflow references.","license":null},"metadata":null,"owner":{"handle":"charlesrhoward","userId":"s171bq85jb19yfyaqyxkgdev0s8858xw","displayName":"charlesrhoward","image":"https://avatars.githubusercontent.com/u/96023061?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779971144494}}