memories generate
Generate IDE rule and instruction files from memories.
memories generate [target] [options]Generate native configuration files for AI coding tools from your memory store. Each tool has its own format and file location.
Targets
| Target | Default Output Path | Description |
|---|---|---|
cursor | .cursor/rules/memories.mdc | Cursor rules with YAML frontmatter |
claude | CLAUDE.md | Claude Code instructions |
agents | AGENTS.md | For Amp, Codex, Goose, Kilo, Kiro, OpenCode |
copilot | .github/copilot-instructions.md | GitHub Copilot instructions |
windsurf | .windsurf/rules/memories.md | Windsurf rules (6000 char limit) |
cline | .clinerules/memories.md | Cline rules |
roo | .roo/rules/memories.md | Roo rules |
gemini | GEMINI.md | Gemini instructions |
Options
| Option | Description |
|---|---|
--types <types> | Comma-separated memory types to include (default: rule,decision,fact) |
--dry-run | Preview generated content without writing files |
--force | Overwrite files even if not managed by memories.sh |
-o, --output <path> | Custom output path (per-target subcommands only) |
-w, --watch | Watch for database changes and auto-regenerate |
Examples
Interactive target selection:
memories generateGenerate for a specific target:
memories generate cursor
memories generate claude --output ./docs/CLAUDE.mdGenerate for all targets:
memories generate allWatch mode (auto-regenerate on database changes):
memories generate all --watchPreview without writing:
memories generate cursor --dry-runOverwrite Safety
Generated files include a <!-- Generated by memories.sh --> marker comment. The generate command will not overwrite files that lack this marker unless --force is used. This prevents accidentally overwriting hand-edited files.
Watch Mode
Watch mode monitors the database file for changes and auto-regenerates with a 500ms debounce. This is useful during development when you're actively adding memories and want config files to stay in sync.