code-session-memory 0.8.0 → 0.8.1
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 +40 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -144,6 +144,40 @@ Retrieve the full ordered content of a specific session message. Use the `sessio
|
|
|
144
144
|
| `startIndex` | number | no | First chunk index (0-based) |
|
|
145
145
|
| `endIndex` | number | no | Last chunk index (0-based, inclusive) |
|
|
146
146
|
|
|
147
|
+
### Querying from the CLI
|
|
148
|
+
|
|
149
|
+
You can search your indexed sessions directly from the terminal without going through the AI agent:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npx code-session-memory query "authentication middleware"
|
|
153
|
+
npx code-session-memory query "auth flow" --source opencode
|
|
154
|
+
npx code-session-memory query "migration" --limit 10
|
|
155
|
+
npx code-session-memory query "error handling" --from 2026-02-01 --to 2026-02-20
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
| Flag | Default | Description |
|
|
159
|
+
|---|---|---|
|
|
160
|
+
| `--source <s>` | none | Filter by tool: `opencode`, `claude-code`, or `cursor` |
|
|
161
|
+
| `--limit <n>` | 5 | Max number of results |
|
|
162
|
+
| `--from <date>` | none | Only include sessions from this date (ISO 8601, e.g. `2026-02-01`) |
|
|
163
|
+
| `--to <date>` | none | Only include sessions up to this date (inclusive) |
|
|
164
|
+
|
|
165
|
+
Requires `OPENAI_API_KEY` to be set (used to embed the query text).
|
|
166
|
+
|
|
167
|
+
Example output:
|
|
168
|
+
```
|
|
169
|
+
Found 2 result(s) for "authentication middleware" (limit=5)
|
|
170
|
+
|
|
171
|
+
1. [1.1665] "Implement auth flow" (opencode)
|
|
172
|
+
Section: Assistant
|
|
173
|
+
Chunk 1/3 — session://ses_abc123#msg_def456
|
|
174
|
+
────────────────────────────────────────────────────────────
|
|
175
|
+
[Session: Implement auth flow > Assistant]
|
|
176
|
+
|
|
177
|
+
We implemented JWT authentication middleware using Express.js...
|
|
178
|
+
────────────────────────────────────────────────────────────
|
|
179
|
+
```
|
|
180
|
+
|
|
147
181
|
### Browsing sessions
|
|
148
182
|
|
|
149
183
|
You can browse, inspect, and delete indexed sessions directly from the CLI:
|
|
@@ -240,7 +274,8 @@ code-session-memory/
|
|
|
240
274
|
│ ├── indexer-cli.ts # Node.js subprocess (called by OpenCode plugin)
|
|
241
275
|
│ ├── indexer-cli-claude.ts # Node.js subprocess (called by Claude Code hook)
|
|
242
276
|
│ ├── indexer-cli-cursor.ts # Node.js subprocess (called by Cursor stop hook)
|
|
243
|
-
│ ├── cli.ts # install / status / uninstall / reset-db commands
|
|
277
|
+
│ ├── cli.ts # install / status / uninstall / reset-db / query commands
|
|
278
|
+
│ ├── cli-query.ts # query command: semantic search from the terminal
|
|
244
279
|
│ └── cli-sessions.ts # sessions list / print / delete / purge (TUI)
|
|
245
280
|
├── mcp/
|
|
246
281
|
│ ├── server.ts # MCP query handlers (testable, injected deps)
|
|
@@ -261,9 +296,10 @@ code-session-memory/
|
|
|
261
296
|
├── cursor-to-messages.test.ts # Unit tests: Cursor SQLite reader
|
|
262
297
|
├── cursor-transcript-to-messages.test.ts # Unit tests: Cursor JSONL parser
|
|
263
298
|
├── opencode-db-to-messages.test.ts # Unit tests: OpenCode internal DB reader
|
|
299
|
+
├── cli-query.test.ts # Unit tests: query CLI command
|
|
264
300
|
├── e2e-claude.test.ts # End-to-end: Claude Code pipeline
|
|
301
|
+
├── e2e-cursor.test.ts # End-to-end: Cursor pipeline
|
|
265
302
|
├── e2e-opencode.test.ts # End-to-end: OpenCode pipeline
|
|
266
|
-
├── e2e-cursor.test.ts # End-to-end: Cursor pipeline
|
|
267
303
|
└── fixtures/ # Committed session files (generated by generate-fixtures)
|
|
268
304
|
```
|
|
269
305
|
|
|
@@ -306,10 +342,11 @@ Tests use [Vitest](https://vitest.dev) and run without any external dependencies
|
|
|
306
342
|
✓ tests/cursor-to-messages.test.ts (15 tests)
|
|
307
343
|
✓ tests/cursor-transcript-to-messages.test.ts (7 tests)
|
|
308
344
|
✓ tests/opencode-db-to-messages.test.ts (8 tests)
|
|
345
|
+
✓ tests/cli-query.test.ts (23 tests)
|
|
309
346
|
✓ tests/e2e-claude.test.ts (18 tests)
|
|
310
347
|
✓ tests/e2e-cursor.test.ts (8 tests)
|
|
311
348
|
✓ tests/e2e-opencode.test.ts (14 tests)
|
|
312
|
-
Tests
|
|
349
|
+
Tests 188 passed
|
|
313
350
|
```
|
|
314
351
|
|
|
315
352
|
To refresh the e2e fixtures (e.g. after changing the indexer or parsers), run:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-session-memory",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Automatically index OpenCode, Claude Code, and Cursor sessions into a shared sqlite-vec vector database for semantic search across your AI coding history",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/src/indexer.js",
|