@shahmilsaari/memory-core 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -10
- package/dist/{chunk-25Y2KI7M.js → chunk-DUUQHRIB.js} +6 -2
- package/dist/cli.js +844 -151
- package/dist/{db-5X5LTUCB.js → db-VLOR7L6Q.js} +1 -1
- package/package.json +4 -1
- package/templates/AGENTS.md.hbs +2 -3
- package/templates/AI_RULES.md.hbs +1 -2
- package/templates/CLAUDE.md.hbs +1 -1
- package/templates/PROJECT_MEMORY.md.hbs +2 -2
- package/templates/copilot-instructions.md.hbs +1 -1
- package/templates/cursorrules.hbs +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ You decide the architecture. memory-core remembers it. Every AI tool — Copilot
|
|
|
8
8
|
npx @shahmilsaari/memory-core init
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Fully local or cloud — your choice. **v0.2.
|
|
11
|
+
Fully local or cloud — your choice. **v0.2.13**
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -165,6 +165,15 @@ That's it. Every AI agent in your project now has your rules.
|
|
|
165
165
|
|
|
166
166
|
## Commands
|
|
167
167
|
|
|
168
|
+
For the full CLI reference, examples, and command behavior notes, see [COMMANDS.md](./COMMANDS.md).
|
|
169
|
+
|
|
170
|
+
New setup-management commands:
|
|
171
|
+
- `memory-core status` — show project name, provider/model, agents, hook state, generated files, and health checks
|
|
172
|
+
- `memory-core auto-sync` — show or change automatic agent file regeneration (`on`, `off`, or `status`)
|
|
173
|
+
- `memory-core provider set <provider>` — switch code-checking provider without rerunning `init`
|
|
174
|
+
- `memory-core model set <model>` — update chat or embedding model from the CLI
|
|
175
|
+
- `memory-core model doctor` — verify database, Ollama, model installation, and cloud API key presence
|
|
176
|
+
|
|
168
177
|
### `init` — Set up a project
|
|
169
178
|
|
|
170
179
|
```bash
|
|
@@ -181,7 +190,7 @@ Walks you through:
|
|
|
181
190
|
- Hook mode — **advisory** (logs violations, never blocks) or **strict** (blocks commits)
|
|
182
191
|
- Whether to enable caveman mode (optional token saver)
|
|
183
192
|
|
|
184
|
-
Generates config files for every selected AI agent, saves your choices to `.memory-core.json`, and automatically adds all generated files to `.gitignore` under a `# memory-core generated files` block.
|
|
193
|
+
Generates config files for every selected AI agent, saves your choices to `.memory-core.json`, enables auto-sync by default, and automatically adds all generated files to `.gitignore` under a `# memory-core generated files` block.
|
|
185
194
|
|
|
186
195
|
At the end, the banner shows live ✓/✗ status for PostgreSQL and Ollama so you know everything is working.
|
|
187
196
|
|
|
@@ -189,7 +198,7 @@ At the end, the banner shows live ✓/✗ status for PostgreSQL and Ollama so yo
|
|
|
189
198
|
|
|
190
199
|
### `sync` — Refresh all agent files
|
|
191
200
|
|
|
192
|
-
|
|
201
|
+
Regenerate every agent file on demand. This still exists even though `remember`, `import`, `edit`, `remove`, `forget`, and `ignore` auto-sync by default after changing memories.
|
|
193
202
|
|
|
194
203
|
```bash
|
|
195
204
|
npx @shahmilsaari/memory-core sync
|
|
@@ -201,6 +210,18 @@ Multi-selects which agents to sync (pre-checked from your `.memory-core.json` co
|
|
|
201
210
|
3 updated, 11 already up to date
|
|
202
211
|
```
|
|
203
212
|
|
|
213
|
+
Use `--no-sync` on memory-changing commands when you want to save database changes without regenerating files immediately.
|
|
214
|
+
|
|
215
|
+
Manage the default:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
npx @shahmilsaari/memory-core auto-sync # show current setting
|
|
219
|
+
npx @shahmilsaari/memory-core auto-sync off # save only, sync manually later
|
|
220
|
+
npx @shahmilsaari/memory-core auto-sync on # restore default behavior
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Auto-sync failures are non-fatal. If regeneration cannot run, memory-core prints the reason and tells you to run `memory-core sync` manually.
|
|
224
|
+
|
|
204
225
|
---
|
|
205
226
|
|
|
206
227
|
### `remember` — Save a decision
|
|
@@ -350,12 +371,14 @@ npx @shahmilsaari/memory-core hook uninstall # remove the hook
|
|
|
350
371
|
npx @shahmilsaari/memory-core list
|
|
351
372
|
```
|
|
352
373
|
|
|
353
|
-
|
|
374
|
+
By default, shows memories relevant to the current project context: detected stack, current project name, plus shared/global memories. Use `--all` for the old database-wide view.
|
|
354
375
|
|
|
355
376
|
```bash
|
|
377
|
+
npx @shahmilsaari/memory-core list --all
|
|
356
378
|
npx @shahmilsaari/memory-core list --type rule
|
|
357
379
|
npx @shahmilsaari/memory-core list --scope global
|
|
358
380
|
npx @shahmilsaari/memory-core list --arch clean-architecture
|
|
381
|
+
npx @shahmilsaari/memory-core list --project my-api
|
|
359
382
|
npx @shahmilsaari/memory-core list --limit 50
|
|
360
383
|
```
|
|
361
384
|
|
|
@@ -364,6 +387,9 @@ npx @shahmilsaari/memory-core list --limit 50
|
|
|
364
387
|
| `--type <type>` | Filter by type: `decision` `rule` `pattern` `note` |
|
|
365
388
|
| `--scope <scope>` | Filter by scope: `global` `project` |
|
|
366
389
|
| `--arch <architecture>` | Filter by architecture profile |
|
|
390
|
+
| `--project <name>` | Filter by project name |
|
|
391
|
+
| `--all` | Show the full shared database |
|
|
392
|
+
| `--current` | Explicitly use the current project context |
|
|
367
393
|
| `--limit <n>` | Max results (default 200) |
|
|
368
394
|
|
|
369
395
|
---
|
|
@@ -560,12 +586,19 @@ npx @shahmilsaari/memory-core seed # load 281 best-practice rules
|
|
|
560
586
|
npx @shahmilsaari/memory-core remember "All auth goes through middleware, never in controllers" \
|
|
561
587
|
--type decision --scope global
|
|
562
588
|
|
|
563
|
-
#
|
|
589
|
+
# Optional: refresh agent files manually anytime
|
|
564
590
|
npx @shahmilsaari/memory-core sync
|
|
565
591
|
|
|
566
592
|
# Not sure how something was decided? Search.
|
|
567
593
|
npx @shahmilsaari/memory-core search "caching strategy"
|
|
568
594
|
|
|
595
|
+
# Inspect current setup, provider, model, and health checks
|
|
596
|
+
npx @shahmilsaari/memory-core status
|
|
597
|
+
|
|
598
|
+
# Switch code-checking provider or model without rerunning init
|
|
599
|
+
npx @shahmilsaari/memory-core provider set openai --model gpt-4o-mini --api-key $OPENAI_API_KEY
|
|
600
|
+
npx @shahmilsaari/memory-core model set qwen2.5-coder --provider ollama
|
|
601
|
+
|
|
569
602
|
# See what rules are saved
|
|
570
603
|
npx @shahmilsaari/memory-core list --type rule
|
|
571
604
|
|
|
@@ -603,10 +636,15 @@ pgvector isn't installed for your PostgreSQL version. Follow the [pgvector insta
|
|
|
603
636
|
Start Ollama: `brew services start ollama` (macOS) or `ollama serve` (Linux).
|
|
604
637
|
|
|
605
638
|
**`Chat model "llama3.2" not found`**
|
|
606
|
-
Run `ollama pull llama3.2`. Or switch provider/model
|
|
639
|
+
Run `ollama pull llama3.2`. Or switch provider/model with `npx @shahmilsaari/memory-core provider set ...` or `npx @shahmilsaari/memory-core model set ...`.
|
|
607
640
|
|
|
608
641
|
**Using an API key instead of Ollama for code checking**
|
|
609
|
-
During `init` choose OpenAI, Anthropic, or MiniMax when prompted for the check provider. Or
|
|
642
|
+
During `init` choose OpenAI, Anthropic, or MiniMax when prompted for the check provider. Or switch later:
|
|
643
|
+
```bash
|
|
644
|
+
npx @shahmilsaari/memory-core provider set openai --model gpt-4o --api-key sk-...
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
Equivalent manual `.memory-core.env` settings:
|
|
610
648
|
```
|
|
611
649
|
CHAT_PROVIDER=openai
|
|
612
650
|
CHAT_MODEL=gpt-4o
|
|
@@ -617,6 +655,12 @@ Embeddings always use Ollama (`nomic-embed-text`) regardless of provider.
|
|
|
617
655
|
**`DATABASE_URL is not set`**
|
|
618
656
|
Run `npx @shahmilsaari/memory-core init` — it will create the `.memory-core.env` file for you.
|
|
619
657
|
|
|
658
|
+
**Not sure what memory-core is configured to use**
|
|
659
|
+
Run `npx @shahmilsaari/memory-core status`.
|
|
660
|
+
|
|
661
|
+
**Need to verify the model/database setup**
|
|
662
|
+
Run `npx @shahmilsaari/memory-core model doctor`.
|
|
663
|
+
|
|
620
664
|
**`createdb: role does not exist`**
|
|
621
665
|
```bash
|
|
622
666
|
createuser -s $(whoami)
|
|
@@ -630,6 +674,24 @@ Save an ignore pattern: `npx @shahmilsaari/memory-core ignore "your exception he
|
|
|
630
674
|
|
|
631
675
|
---
|
|
632
676
|
|
|
677
|
+
## Release checks
|
|
678
|
+
|
|
679
|
+
Before publishing, run the same checks as CI:
|
|
680
|
+
|
|
681
|
+
```bash
|
|
682
|
+
npm run lint
|
|
683
|
+
npm run typecheck
|
|
684
|
+
npm test
|
|
685
|
+
npm run build
|
|
686
|
+
npm run smoke:pack
|
|
687
|
+
npm run smoke:npx
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
`smoke:pack` verifies the npm tarball includes the built CLI plus templates/profiles.
|
|
691
|
+
`smoke:npx` installs that tarball into a fresh temporary project and runs `npx --no-install memory-core init --quick`.
|
|
692
|
+
|
|
693
|
+
---
|
|
694
|
+
|
|
633
695
|
## Roadmap
|
|
634
696
|
|
|
635
697
|
| | Feature |
|
|
@@ -643,15 +705,17 @@ Save an ignore pattern: `npx @shahmilsaari/memory-core ignore "your exception he
|
|
|
643
705
|
| ✓ | CI/CD — `ci-setup` generates GitHub Actions workflow for PR enforcement |
|
|
644
706
|
| ✓ | Violation stats — see which rules fire most and which files break most |
|
|
645
707
|
| ✓ | Agent selection — choose which agents to generate files for during init |
|
|
708
|
+
| ✓ | Auto-sync — memory-changing commands refresh selected agent files by default |
|
|
646
709
|
| ✓ | Export / import — portable memories.json for version control and team sharing |
|
|
647
710
|
| ✓ | List / remove / edit — full CRUD for stored memories |
|
|
648
711
|
| ✓ | False positive tagging — `ignore` command saves exceptions for hook and watcher |
|
|
649
712
|
| ✓ | Reset command — clean up generated files and optionally drop the DB table |
|
|
650
|
-
| ✓ | Test suite —
|
|
713
|
+
| ✓ | Test suite — smoke tests for all core commands and providers |
|
|
651
714
|
| ✓ | Multi-provider code checking — Ollama, OpenAI, Anthropic, MiniMax |
|
|
652
|
-
| | Context-aware retrieval — surface the most relevant rules for the file being edited |
|
|
715
|
+
| ✓ | Context-aware retrieval — surface the most relevant rules for the file being edited |
|
|
716
|
+
| ✓ | Setup management — `status`, `provider set`, `model set`, `model doctor` |
|
|
717
|
+
| ✓ | `--debug` flag — verbose output for diagnosing hook and watcher issues |
|
|
653
718
|
| | Model guidance during init — recommend a model based on machine specs |
|
|
654
|
-
| | `--debug` flag — verbose output for diagnosing hook and watcher issues |
|
|
655
719
|
| | Violation → rule pipeline — auto-suggest a new rule when the same violation repeats |
|
|
656
720
|
| | Rule analytics dashboard — visual breakdown of rule coverage and violations |
|
|
657
721
|
| | Team sync — shared database so the whole team works from the same rule set |
|
|
@@ -84,12 +84,16 @@ async function listMemories(filters = {}) {
|
|
|
84
84
|
if (filters.architecture) {
|
|
85
85
|
if (Array.isArray(filters.architecture)) {
|
|
86
86
|
params.push(filters.architecture);
|
|
87
|
-
where.push(`architecture = ANY($${params.length})`);
|
|
87
|
+
where.push(filters.includeGlobal ? `(architecture IS NULL OR architecture = ANY($${params.length}))` : `architecture = ANY($${params.length})`);
|
|
88
88
|
} else {
|
|
89
89
|
params.push(filters.architecture);
|
|
90
|
-
where.push(`architecture = $${params.length}`);
|
|
90
|
+
where.push(filters.includeGlobal ? `(architecture IS NULL OR architecture = $${params.length})` : `architecture = $${params.length}`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
if (filters.projectName) {
|
|
94
|
+
params.push(filters.projectName);
|
|
95
|
+
where.push(filters.includeGlobal ? `(project_name IS NULL OR project_name = $${params.length})` : `project_name = $${params.length}`);
|
|
96
|
+
}
|
|
93
97
|
if (filters.tags?.length) {
|
|
94
98
|
params.push(filters.tags);
|
|
95
99
|
where.push(`tags && $${params.length}::text[]`);
|