← 返回
未分类 中文

memories.sh CLI

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...
memories.sh 的 CLI 参考与工作流——面向 AI 代理的持久化记忆层。适用场景:(1)运行 memories CLI 命令进行添加、搜索、编辑等操作时。
charlesrhoward
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 280
下载
💾 1
安装
1
版本
#latest

概述

memories-cli

CLI reference for @memories.sh/cli — manage memories, generate configs, and sync across tools.

> 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 as a fallback.

Install & Init

npm install -g @memories.sh/cli   # or: npx @memories.sh/cli
memories init                      # Initialize in current project

memories init auto-detects AI tools (Claude Code, Cursor, Windsurf, VS Code) and configures MCP + generates instruction files.

Command Quick Reference

CommandPurpose
------------------
memories add Store a memory
memories recallContext-aware memories for current project
memories search Full-text search
memories listList memories with filters
memories edit Edit content, type, or tags
memories forget Soft-delete a memory
memories generateGenerate AI tool config files
memories promptGenerate a system prompt
memories serveStart MCP server

Core Workflows

1. New Project Setup

cd my-project
memories init              # Detect tools, configure MCP, generate files
memories add "Use pnpm" --type rule
memories add "Chose Supabase for auth" --type decision
memories generate          # Update all AI tool configs

2. Ingest Existing Rules

memories ingest claude     # Import from CLAUDE.md
memories ingest cursor     # Import from .cursorrules / .cursor/rules/
memories ingest copilot    # Import from copilot-instructions.md

3. Search & Recall

memories search "auth"                    # Full-text search
memories search "auth" --semantic         # Vector similarity (requires embeddings)
memories recall                           # Context for current project
memories list --type rule                 # Filter by type
memories list --tags api,auth             # Filter by tags

4. Generate Configs

memories generate                         # All detected tools
memories generate claude                  # Only CLAUDE.md
memories generate cursor                  # Only .cursor/rules/memories.mdc
memories diff                             # Preview changes before generating

Supported targets: claude, cursor, copilot, windsurf, cline, roo, gemini

5. Cloud Sync

memories login                            # Device code auth flow
memories sync                             # Sync local DB to cloud
memories files ingest                     # Upload config files
memories files apply --global --force     # Restore configs on new machine

6. Embeddings

memories embed                            # Generate embeddings for all memories
memories embed --dry-run                  # Preview what would be embedded
memories config model <model-name>        # Change embedding model

7. Maintenance

memories doctor                           # Diagnose issues
memories stats                            # Memory statistics
memories stale --days 90                  # Find stale memories
memories review                           # Interactive cleanup
memories validate                         # Check memory integrity

Memory Types

Use --type flag with add:

  • rulememories add "Always use strict mode" --type rule
  • decisionmemories add "Chose JWT for auth" --type decision
  • factmemories add "Rate limit: 100/min" --type fact
  • note — (default) memories add "Refactor auth module"

Scopes

  • project (default) — Scoped to current git repo
  • globalmemories add "Use TypeScript" --type rule --global

When 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.

Advanced Features

  • Templates: memories add --template decision — structured prompts for common patterns
  • Links: memories link --type supports — relate memories
  • History: memories history / memories revert --to
  • Tags: memories tag add api,auth
  • Export/Import: memories export > backup.yaml / memories import backup.yaml
  • Git Hooks: memories hook install — auto-generate on commit

Reference Files

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:46 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,019
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,062 📥 799,765
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,219 📥 266,831