Getting Started
Install memories.sh, add your first memories, and generate config files for your AI coding tools.
Installation
Install the CLI globally using your preferred package manager:
npm install -g @memories.sh/clipnpm add -g @memories.sh/cliyarn global add @memories.sh/cliVerify the installation:
memories --versionInitialize
Navigate to a git repository and initialize memories for the project:
cd your-project
memories initThis creates the local database at ~/.config/memories/local.db (if it doesn't already exist) and detects your project from the git remote URL.
To initialize with some starter rules:
memories init --rule "Use TypeScript strict mode" --rule "Prefer functional patterns"For global memories that apply to all projects:
memories init --globalAdd Your First Memory
Memories come in four types: rules, decisions, facts, and notes.
Rules
Rules are always-active coding standards that should be followed:
memories add --rule "Always use early returns to reduce nesting"
memories add --rule "Use pnpm as the package manager"
memories add --rule "Prefer named exports over default exports"Decisions
Decisions capture the "why" behind architectural choices:
memories add --decision "Chose Tailwind CSS over styled-components for utility-first approach and smaller bundle size"
memories add --decision "Using Supabase for auth because it has built-in RLS and a generous free tier"Facts
Facts store project-specific knowledge:
memories add --fact "API rate limit is 100 requests per minute per user"
memories add --fact "The main database is PostgreSQL 15 hosted on Supabase"Notes
Notes are general-purpose memories (the default type):
memories add "The legacy API will be deprecated in Q3 2026"Tag Your Memories
Tags help organize and filter memories:
memories add --rule "Use React Server Components by default" --tags "react,architecture"
memories add --fact "Stripe webhook secret is in STRIPE_WEBHOOK_SECRET env var" --tags "stripe,config"Generate Config Files
Generate native rule files for your AI tools:
# Generate for a specific tool
memories generate cursor
memories generate claude
memories generate copilot
# Generate for all supported tools at once
memories generate allSupported targets: cursor, claude, agents, copilot, windsurf, cline, roo, gemini.
Each target writes to its standard location:
| Target | Output Path |
|---|---|
cursor | .cursor/rules/memories.mdc |
claude | CLAUDE.md |
agents | AGENTS.md |
copilot | .github/copilot-instructions.md |
windsurf | .windsurf/rules/memories.md |
cline | .clinerules/memories.md |
roo | .roo/rules/memories.md |
gemini | GEMINI.md |
Use the MCP Server
Instead of (or in addition to) generating files, you can connect memories directly to your AI tool via the MCP protocol:
memories serveThis starts an MCP server on stdio that exposes your memories as tools and resources. See the MCP Server guide for integration details.
Next Steps
- Read the CLI Reference for complete command documentation
- Learn about Memory Types and Scopes
- Set up Git Hooks to auto-generate files on commit
- Configure Cloud Sync for multi-device access