memextend 0.1.0
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/dist/commands/edit.d.ts +2 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +84 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/export.d.ts +8 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +88 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/forget.d.ts +10 -0
- package/dist/commands/forget.d.ts.map +1 -0
- package/dist/commands/forget.js +199 -0
- package/dist/commands/forget.js.map +1 -0
- package/dist/commands/help.d.ts +2 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +437 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/import.d.ts +7 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +138 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +258 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +7 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +67 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/save.d.ts +8 -0
- package/dist/commands/save.d.ts.map +1 -0
- package/dist/commands/save.js +95 -0
- package/dist/commands/save.js.map +1 -0
- package/dist/commands/search.d.ts +8 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +82 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/status.d.ts +7 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +231 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/uninstall.d.ts +7 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +188 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/webui.d.ts +7 -0
- package/dist/commands/webui.d.ts.map +1 -0
- package/dist/commands/webui.js +314 -0
- package/dist/commands/webui.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +97 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
// apps/cli/src/commands/help.ts
|
|
2
|
+
// Copyright (c) 2026 ZodTTD LLC. MIT License.
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
const HELP_TEXT = `
|
|
5
|
+
${chalk.cyan.bold('╔═══════════════════════════════════════════════════════════════════╗')}
|
|
6
|
+
${chalk.cyan.bold('║ memextend ║')}
|
|
7
|
+
${chalk.cyan.bold('║ Free, local AI memory extension for coding assistants ║')}
|
|
8
|
+
${chalk.cyan.bold('╚═══════════════════════════════════════════════════════════════════╝')}
|
|
9
|
+
|
|
10
|
+
${chalk.yellow.bold('OVERVIEW')}
|
|
11
|
+
|
|
12
|
+
memextend gives your AI coding assistant persistent memory across sessions.
|
|
13
|
+
It captures what you work on (edits, commands, patterns) and injects relevant
|
|
14
|
+
context at the start of each new session.
|
|
15
|
+
|
|
16
|
+
${chalk.dim('• 100% local - your data never leaves your machine')}
|
|
17
|
+
${chalk.dim('• Automatic - captures and retrieves memories without manual effort')}
|
|
18
|
+
${chalk.dim('• Project-aware - memories are scoped to each git repository')}
|
|
19
|
+
|
|
20
|
+
${chalk.yellow.bold('HOW IT WORKS')}
|
|
21
|
+
|
|
22
|
+
${chalk.green('Session Start:')} Relevant memories are automatically injected into context
|
|
23
|
+
${chalk.green('During Session:')} Work normally; Claude can search/save memories via MCP
|
|
24
|
+
${chalk.green('Session End:')} Tool invocations (edits, commands) are saved as memories
|
|
25
|
+
|
|
26
|
+
${chalk.yellow.bold('MEMORY SCOPES')}
|
|
27
|
+
|
|
28
|
+
${chalk.cyan('Project Memories')} - Automatically tied to your git repository
|
|
29
|
+
• Captured when you edit files, run commands, create files
|
|
30
|
+
• Retrieved when you return to the same project
|
|
31
|
+
• Use --project flag to filter CLI commands
|
|
32
|
+
|
|
33
|
+
${chalk.cyan('Global Profile')} - Cross-project preferences and patterns
|
|
34
|
+
• Save via MCP tool: memextend_save_global
|
|
35
|
+
• Included in all session contexts
|
|
36
|
+
• Use --global flag to filter CLI commands
|
|
37
|
+
|
|
38
|
+
${chalk.yellow.bold('COMMANDS')}
|
|
39
|
+
|
|
40
|
+
${chalk.cyan('memextend status')}
|
|
41
|
+
Show memory statistics and system health.
|
|
42
|
+
|
|
43
|
+
${chalk.dim('Options:')}
|
|
44
|
+
${chalk.dim('-p, --project')} Show stats for current project only
|
|
45
|
+
${chalk.dim('--check-embeddings')} Run embedding model diagnostics
|
|
46
|
+
|
|
47
|
+
${chalk.dim('Example:')}
|
|
48
|
+
${chalk.dim('$ memextend status')}
|
|
49
|
+
${chalk.dim('$ memextend status --project')}
|
|
50
|
+
${chalk.dim('$ memextend status --check-embeddings')}
|
|
51
|
+
|
|
52
|
+
${chalk.cyan('memextend list')}
|
|
53
|
+
List recent memories with their IDs, timestamps, and content preview.
|
|
54
|
+
|
|
55
|
+
${chalk.dim('Options:')}
|
|
56
|
+
${chalk.dim('-p, --project')} List current project only
|
|
57
|
+
${chalk.dim('-l, --limit <n>')} Maximum results (default: 20)
|
|
58
|
+
|
|
59
|
+
${chalk.dim('Example:')}
|
|
60
|
+
${chalk.dim('$ memextend list')}
|
|
61
|
+
${chalk.dim('$ memextend list --project --limit 50')}
|
|
62
|
+
|
|
63
|
+
${chalk.cyan('memextend save')}
|
|
64
|
+
Create a new memory manually.
|
|
65
|
+
|
|
66
|
+
${chalk.dim('Options:')}
|
|
67
|
+
${chalk.dim('-g, --global')} Save as global memory (all projects)
|
|
68
|
+
${chalk.dim('-p, --project <id>')} Save to specific project
|
|
69
|
+
${chalk.dim('-m, --message <text>')} Memory content (or enter interactively)
|
|
70
|
+
|
|
71
|
+
${chalk.dim('Examples:')}
|
|
72
|
+
${chalk.dim('$ memextend save --global -m "Prefer TypeScript over JavaScript"')}
|
|
73
|
+
${chalk.dim('$ memextend save # Interactive mode')}
|
|
74
|
+
${chalk.dim('$ memextend save -g # Interactive global memory')}
|
|
75
|
+
|
|
76
|
+
${chalk.cyan('memextend search <query>')}
|
|
77
|
+
Search memories using hybrid search (keyword + semantic).
|
|
78
|
+
|
|
79
|
+
${chalk.dim('Options:')}
|
|
80
|
+
${chalk.dim('-p, --project')} Search current project only
|
|
81
|
+
${chalk.dim('-g, --global')} Search global profile only
|
|
82
|
+
${chalk.dim('-l, --limit <n>')} Maximum results (default: 10)
|
|
83
|
+
|
|
84
|
+
${chalk.dim('Example:')}
|
|
85
|
+
${chalk.dim('$ memextend search "authentication"')}
|
|
86
|
+
${chalk.dim('$ memextend search "API endpoints" --project')}
|
|
87
|
+
|
|
88
|
+
${chalk.cyan('memextend edit <memory-id>')}
|
|
89
|
+
Interactively edit a memory's content.
|
|
90
|
+
|
|
91
|
+
${chalk.dim('Usage:')}
|
|
92
|
+
1. Run the command with the memory ID
|
|
93
|
+
2. View current content
|
|
94
|
+
3. Type new content (press Enter twice to save)
|
|
95
|
+
4. Press Ctrl+C to cancel
|
|
96
|
+
|
|
97
|
+
${chalk.dim('Example:')}
|
|
98
|
+
${chalk.dim('$ memextend edit abc123def456')}
|
|
99
|
+
|
|
100
|
+
${chalk.cyan('memextend forget <memory-id>')}
|
|
101
|
+
Delete a specific memory by ID.
|
|
102
|
+
|
|
103
|
+
${chalk.dim('Example:')}
|
|
104
|
+
${chalk.dim('$ memextend forget abc123def456')}
|
|
105
|
+
|
|
106
|
+
${chalk.cyan('memextend forget --all')}
|
|
107
|
+
Delete ALL memories (requires confirmation).
|
|
108
|
+
|
|
109
|
+
${chalk.dim('Options:')}
|
|
110
|
+
${chalk.dim('-a, --all')} Delete all memories
|
|
111
|
+
${chalk.dim('-p, --project')} Only delete from current project
|
|
112
|
+
${chalk.dim('--before <date>')} Delete memories before date (YYYY-MM-DD)
|
|
113
|
+
${chalk.dim('--delete-project <name>')} Delete all memories in a project
|
|
114
|
+
${chalk.dim('--clear-global')} Clear all global profile entries
|
|
115
|
+
|
|
116
|
+
${chalk.dim('Examples:')}
|
|
117
|
+
${chalk.dim('$ memextend forget --all # Delete everything')}
|
|
118
|
+
${chalk.dim('$ memextend forget --all --project # Delete current project only')}
|
|
119
|
+
${chalk.dim('$ memextend forget --before 2025-01-01 # Delete old memories')}
|
|
120
|
+
${chalk.dim('$ memextend forget --delete-project myproject # Delete all project memories')}
|
|
121
|
+
${chalk.dim('$ memextend forget --clear-global # Clear global profile')}
|
|
122
|
+
|
|
123
|
+
${chalk.cyan('memextend init')}
|
|
124
|
+
Initialize memextend (run by installer, rarely needed manually).
|
|
125
|
+
|
|
126
|
+
${chalk.dim('Options:')}
|
|
127
|
+
${chalk.dim('--manual')} Print manual configuration instructions
|
|
128
|
+
|
|
129
|
+
${chalk.cyan('memextend export')}
|
|
130
|
+
Export memories to a JSON file for backup or transfer.
|
|
131
|
+
|
|
132
|
+
${chalk.dim('Options:')}
|
|
133
|
+
${chalk.dim('-o, --output <path>')} Output directory (default: current)
|
|
134
|
+
${chalk.dim('-p, --project')} Export current project only
|
|
135
|
+
|
|
136
|
+
${chalk.dim('Examples:')}
|
|
137
|
+
${chalk.dim('$ memextend export')}
|
|
138
|
+
${chalk.dim('$ memextend export --output ~/backup')}
|
|
139
|
+
${chalk.dim('$ memextend export --project')}
|
|
140
|
+
|
|
141
|
+
${chalk.cyan('memextend import <file>')}
|
|
142
|
+
Import memories from a JSON export file.
|
|
143
|
+
|
|
144
|
+
${chalk.dim('Options:')}
|
|
145
|
+
${chalk.dim('-m, --merge')} Skip duplicates (don\'t overwrite)
|
|
146
|
+
${chalk.dim('--validate-only')} Validate file without importing
|
|
147
|
+
|
|
148
|
+
${chalk.dim('Examples:')}
|
|
149
|
+
${chalk.dim('$ memextend import ./memextend-export-2026-01-31.json')}
|
|
150
|
+
${chalk.dim('$ memextend import ./backup.json --merge')}
|
|
151
|
+
${chalk.dim('$ memextend import ./backup.json --validate-only')}
|
|
152
|
+
|
|
153
|
+
${chalk.cyan('memextend webui')}
|
|
154
|
+
Start the web UI for browsing and managing memories.
|
|
155
|
+
|
|
156
|
+
${chalk.dim('Options:')}
|
|
157
|
+
${chalk.dim('-p, --port <number>')} Port number (default: 3333)
|
|
158
|
+
${chalk.dim('-H, --host <host>')} Host to bind to (default: localhost)
|
|
159
|
+
|
|
160
|
+
${chalk.dim('Features:')}
|
|
161
|
+
${chalk.dim('• Dashboard with memory statistics')}
|
|
162
|
+
${chalk.dim('• View and filter all memories')}
|
|
163
|
+
${chalk.dim('• Create, edit, and delete memories')}
|
|
164
|
+
${chalk.dim('• Search with hybrid search')}
|
|
165
|
+
${chalk.dim('• View and manage global profiles')}
|
|
166
|
+
${chalk.dim('• Configure capture and retrieval settings')}
|
|
167
|
+
|
|
168
|
+
${chalk.dim('Examples:')}
|
|
169
|
+
${chalk.dim('$ memextend webui')}
|
|
170
|
+
${chalk.dim('$ memextend webui --port 8080')}
|
|
171
|
+
${chalk.dim('$ memextend webui --host 0.0.0.0 --port 3333')}
|
|
172
|
+
|
|
173
|
+
${chalk.cyan('memextend uninstall')}
|
|
174
|
+
Remove memextend and all integrations from your system.
|
|
175
|
+
|
|
176
|
+
${chalk.dim('Options:')}
|
|
177
|
+
${chalk.dim('-f, --force')} Skip confirmation prompt
|
|
178
|
+
${chalk.dim('-k, --keep-data')} Keep memories, only remove integrations
|
|
179
|
+
|
|
180
|
+
${chalk.dim('Removes:')}
|
|
181
|
+
${chalk.dim('• Claude Code hooks (SessionStart, Stop, PreCompact)')}
|
|
182
|
+
${chalk.dim('• Claude Code MCP server registration')}
|
|
183
|
+
${chalk.dim('• memextend section from ~/.claude/CLAUDE.md')}
|
|
184
|
+
${chalk.dim('• All data in ~/.memextend/ (unless --keep-data)')}
|
|
185
|
+
|
|
186
|
+
${chalk.dim('Examples:')}
|
|
187
|
+
${chalk.dim('$ memextend uninstall')}
|
|
188
|
+
${chalk.dim('$ memextend uninstall --force')}
|
|
189
|
+
${chalk.dim('$ memextend uninstall --keep-data')}
|
|
190
|
+
|
|
191
|
+
${chalk.yellow.bold('MCP TOOLS (used by Claude during sessions)')}
|
|
192
|
+
|
|
193
|
+
${chalk.dim('memextend_search')} - Search memories mid-session
|
|
194
|
+
${chalk.dim('memextend_save')} - Explicitly save something important
|
|
195
|
+
${chalk.dim('memextend_save_global')} - Save to global profile (cross-project)
|
|
196
|
+
${chalk.dim('memextend_forget')} - Delete a memory
|
|
197
|
+
${chalk.dim('memextend_status')} - Check memory statistics
|
|
198
|
+
|
|
199
|
+
${chalk.yellow.bold('FILES & DIRECTORIES')}
|
|
200
|
+
|
|
201
|
+
${chalk.dim('~/.memextend/')} Data directory
|
|
202
|
+
${chalk.dim('~/.memextend/memextend.db')} SQLite database (memories, FTS index)
|
|
203
|
+
${chalk.dim('~/.memextend/vectors/')} LanceDB vector storage
|
|
204
|
+
${chalk.dim('~/.memextend/models/')} Embedding models (downloaded on first use)
|
|
205
|
+
${chalk.dim('~/.memextend/config.json')} Configuration file
|
|
206
|
+
|
|
207
|
+
${chalk.yellow.bold('MORE INFORMATION')}
|
|
208
|
+
|
|
209
|
+
Documentation: ${chalk.blue('https://github.com/zodttd/memextend')}
|
|
210
|
+
Issues: ${chalk.blue('https://github.com/zodttd/memextend/issues')}
|
|
211
|
+
|
|
212
|
+
${chalk.dim('by ZodTTD • www.zodttd.com')}
|
|
213
|
+
`;
|
|
214
|
+
export async function helpCommand(topic) {
|
|
215
|
+
if (!topic) {
|
|
216
|
+
console.log(HELP_TEXT);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
// Topic-specific help
|
|
220
|
+
const topics = {
|
|
221
|
+
'status': `
|
|
222
|
+
${chalk.cyan.bold('memextend status')}
|
|
223
|
+
|
|
224
|
+
Show memory statistics and system health.
|
|
225
|
+
|
|
226
|
+
${chalk.yellow('Options:')}
|
|
227
|
+
-p, --project Show stats for current project only
|
|
228
|
+
--check-embeddings Run embedding model diagnostics
|
|
229
|
+
|
|
230
|
+
${chalk.yellow('Output includes:')}
|
|
231
|
+
• Total memory count
|
|
232
|
+
• Database size
|
|
233
|
+
• Project count
|
|
234
|
+
• Recent activity summary
|
|
235
|
+
|
|
236
|
+
${chalk.yellow('Embedding Diagnostics:')}
|
|
237
|
+
Use --check-embeddings to verify the embedding model is working:
|
|
238
|
+
• Downloads model if not present (~274MB one-time)
|
|
239
|
+
• Loads and tests the model
|
|
240
|
+
• Generates test embeddings
|
|
241
|
+
• Verifies semantic similarity is working
|
|
242
|
+
|
|
243
|
+
${chalk.yellow('Examples:')}
|
|
244
|
+
$ memextend status
|
|
245
|
+
$ memextend status --project
|
|
246
|
+
$ memextend status --check-embeddings
|
|
247
|
+
`,
|
|
248
|
+
'save': `
|
|
249
|
+
${chalk.cyan.bold('memextend save')}
|
|
250
|
+
|
|
251
|
+
Create a new memory manually.
|
|
252
|
+
|
|
253
|
+
${chalk.yellow('Options:')}
|
|
254
|
+
-g, --global Save as global memory (available in all projects)
|
|
255
|
+
-p, --project <id> Save to specific project
|
|
256
|
+
-m, --message <text> Memory content (or enter interactively)
|
|
257
|
+
|
|
258
|
+
${chalk.yellow('Examples:')}
|
|
259
|
+
$ memextend save --global -m "Always use TypeScript"
|
|
260
|
+
$ memextend save # Interactive mode
|
|
261
|
+
$ memextend save -g # Interactive global memory
|
|
262
|
+
|
|
263
|
+
${chalk.yellow('Interactive Mode:')}
|
|
264
|
+
When no message is provided, you can type content line by line.
|
|
265
|
+
Press Enter twice (empty line) to save, or Ctrl+C to cancel.
|
|
266
|
+
|
|
267
|
+
${chalk.yellow('Project vs Global:')}
|
|
268
|
+
• Project memories are tied to a git repository
|
|
269
|
+
• Global memories are included in ALL sessions
|
|
270
|
+
• Without --global, saves to current project (detected from cwd)
|
|
271
|
+
`,
|
|
272
|
+
'search': `
|
|
273
|
+
${chalk.cyan.bold('memextend search <query>')}
|
|
274
|
+
|
|
275
|
+
Search memories using hybrid search combining:
|
|
276
|
+
• Full-text search (SQLite FTS5) for keyword matching
|
|
277
|
+
• Vector search (LanceDB) for semantic similarity
|
|
278
|
+
• Reciprocal Rank Fusion to combine results
|
|
279
|
+
|
|
280
|
+
${chalk.yellow('Options:')}
|
|
281
|
+
-p, --project Search current project only
|
|
282
|
+
-g, --global Search global profile only
|
|
283
|
+
-l, --limit <n> Maximum results (default: 10)
|
|
284
|
+
|
|
285
|
+
${chalk.yellow('Examples:')}
|
|
286
|
+
$ memextend search "authentication"
|
|
287
|
+
$ memextend search "how to handle errors" --project
|
|
288
|
+
$ memextend search "database migrations" --limit 20
|
|
289
|
+
`,
|
|
290
|
+
'forget': `
|
|
291
|
+
${chalk.cyan.bold('memextend forget')}
|
|
292
|
+
|
|
293
|
+
Delete memories. Can delete single memories, bulk delete, or delete all memories in a project.
|
|
294
|
+
|
|
295
|
+
${chalk.yellow('Single delete:')}
|
|
296
|
+
$ memextend forget <memory-id>
|
|
297
|
+
|
|
298
|
+
${chalk.yellow('Bulk delete options:')}
|
|
299
|
+
-a, --all Delete all memories (with confirmation)
|
|
300
|
+
-p, --project Only affect current project
|
|
301
|
+
--before <date> Delete memories before date (YYYY-MM-DD)
|
|
302
|
+
--delete-project <name> Delete all memories in a project
|
|
303
|
+
--clear-global Clear all global profile entries
|
|
304
|
+
|
|
305
|
+
${chalk.yellow('Examples:')}
|
|
306
|
+
$ memextend forget abc123 # Single memory
|
|
307
|
+
$ memextend forget --all # Everything (careful!)
|
|
308
|
+
$ memextend forget --all --project # Current project only
|
|
309
|
+
$ memextend forget --before 2025-01-01 # Old memories
|
|
310
|
+
$ memextend forget --delete-project myproject # Delete all project memories
|
|
311
|
+
$ memextend forget --clear-global # Clear global profile
|
|
312
|
+
|
|
313
|
+
${chalk.red('Warning:')} All deletes are permanent and cannot be undone.
|
|
314
|
+
`,
|
|
315
|
+
'edit': `
|
|
316
|
+
${chalk.cyan.bold('memextend edit <memory-id>')}
|
|
317
|
+
|
|
318
|
+
Interactively edit a memory's content.
|
|
319
|
+
|
|
320
|
+
${chalk.yellow('Usage:')}
|
|
321
|
+
1. Run: memextend edit <memory-id>
|
|
322
|
+
2. Current content is displayed
|
|
323
|
+
3. Type new content line by line
|
|
324
|
+
4. Press Enter twice (empty line) to save
|
|
325
|
+
5. Press Ctrl+C to cancel without saving
|
|
326
|
+
|
|
327
|
+
${chalk.yellow('Example:')}
|
|
328
|
+
$ memextend edit abc123def456
|
|
329
|
+
|
|
330
|
+
${chalk.yellow('Tips:')}
|
|
331
|
+
• Use 'memextend list' to find memory IDs
|
|
332
|
+
• The memory ID is shown in search/list output
|
|
333
|
+
`,
|
|
334
|
+
'export': `
|
|
335
|
+
${chalk.cyan.bold('memextend export')}
|
|
336
|
+
|
|
337
|
+
Export memories to a JSON file for backup or transfer.
|
|
338
|
+
|
|
339
|
+
${chalk.yellow('Options:')}
|
|
340
|
+
-o, --output <path> Output directory (default: current directory)
|
|
341
|
+
-p, --project Export current project only
|
|
342
|
+
|
|
343
|
+
${chalk.yellow('Examples:')}
|
|
344
|
+
$ memextend export # Export all to current directory
|
|
345
|
+
$ memextend export --output ~/backup # Export to specific directory
|
|
346
|
+
$ memextend export --project # Export current project only
|
|
347
|
+
`,
|
|
348
|
+
'import': `
|
|
349
|
+
${chalk.cyan.bold('memextend import <file>')}
|
|
350
|
+
|
|
351
|
+
Import memories from a JSON export file.
|
|
352
|
+
|
|
353
|
+
${chalk.yellow('Options:')}
|
|
354
|
+
-m, --merge Skip duplicate IDs (don't overwrite existing)
|
|
355
|
+
--validate-only Check file is valid without importing
|
|
356
|
+
|
|
357
|
+
${chalk.yellow('Examples:')}
|
|
358
|
+
$ memextend import ./memextend-export-2026-01-31.json
|
|
359
|
+
$ memextend import ./backup.json --merge
|
|
360
|
+
$ memextend import ./backup.json --validate-only
|
|
361
|
+
`,
|
|
362
|
+
'webui': `
|
|
363
|
+
${chalk.cyan.bold('memextend webui')}
|
|
364
|
+
|
|
365
|
+
Start a local web server for browsing and managing memories.
|
|
366
|
+
|
|
367
|
+
${chalk.yellow('Options:')}
|
|
368
|
+
-p, --port <number> Port number (default: 3333)
|
|
369
|
+
-H, --host <host> Host to bind to (default: localhost)
|
|
370
|
+
|
|
371
|
+
${chalk.yellow('Features:')}
|
|
372
|
+
• ${chalk.green('Dashboard')} - Memory statistics, activity chart, breakdowns
|
|
373
|
+
• ${chalk.green('Memory List')} - View all memories with filtering
|
|
374
|
+
• ${chalk.green('Create')} - Add new memories (project or global)
|
|
375
|
+
• ${chalk.green('Search')} - Hybrid search (FTS + vector)
|
|
376
|
+
• ${chalk.green('Edit/Delete')} - Modify or remove memories
|
|
377
|
+
• ${chalk.green('Global Profiles')} - Manage cross-project preferences
|
|
378
|
+
• ${chalk.green('Settings')} - Configure capture and retrieval options
|
|
379
|
+
|
|
380
|
+
${chalk.yellow('Retrieval Settings (in WebUI):')}
|
|
381
|
+
• ${chalk.dim('Auto-Inject')} - Enable/disable memory injection at session start
|
|
382
|
+
• ${chalk.dim('Max Memories')} - Limit memories retrieved (0 = unlimited)
|
|
383
|
+
• ${chalk.dim('Recent Days')} - Only retrieve memories from last N days (0 = unlimited)
|
|
384
|
+
• ${chalk.dim('Include Global')} - Include global profile in injections
|
|
385
|
+
• ${chalk.dim('Deduplication Threshold')} - Similarity threshold for removing duplicates (0.85 default)
|
|
386
|
+
• ${chalk.dim('Session Max Chars')} - Max characters at session start (10000 ≈ 2500 tokens)
|
|
387
|
+
• ${chalk.dim('Compact Max Chars')} - Max characters after compaction (2000 ≈ 500 tokens)
|
|
388
|
+
|
|
389
|
+
${chalk.yellow('Examples:')}
|
|
390
|
+
$ memextend webui # Start on localhost:3333
|
|
391
|
+
$ memextend webui --port 8080 # Custom port
|
|
392
|
+
$ memextend webui --host 0.0.0.0 # Bind to all interfaces
|
|
393
|
+
|
|
394
|
+
${chalk.yellow('Access:')}
|
|
395
|
+
Open http://localhost:3333 in your browser after starting.
|
|
396
|
+
|
|
397
|
+
${chalk.dim('Note:')} Use the "+ New Memory" or "+ New Global Memory" buttons
|
|
398
|
+
to create memories directly in the UI.
|
|
399
|
+
`,
|
|
400
|
+
'uninstall': `
|
|
401
|
+
${chalk.cyan.bold('memextend uninstall')}
|
|
402
|
+
|
|
403
|
+
Remove memextend and all integrations from your system.
|
|
404
|
+
|
|
405
|
+
${chalk.yellow('Options:')}
|
|
406
|
+
-f, --force Skip confirmation prompt
|
|
407
|
+
-k, --keep-data Keep memories and data, only remove integrations
|
|
408
|
+
|
|
409
|
+
${chalk.yellow('What gets removed:')}
|
|
410
|
+
• Claude Code hooks (SessionStart, Stop, PreCompact)
|
|
411
|
+
• Claude Code MCP server registration
|
|
412
|
+
• memextend section from ~/.claude/CLAUDE.md
|
|
413
|
+
• All data in ~/.memextend/ (unless --keep-data)
|
|
414
|
+
|
|
415
|
+
${chalk.yellow('Examples:')}
|
|
416
|
+
$ memextend uninstall # Interactive uninstall
|
|
417
|
+
$ memextend uninstall --force # Skip confirmation
|
|
418
|
+
$ memextend uninstall --keep-data # Keep memories for later
|
|
419
|
+
|
|
420
|
+
${chalk.yellow('Re-installing:')}
|
|
421
|
+
After using --keep-data, you can reinstall with:
|
|
422
|
+
$ memextend init
|
|
423
|
+
|
|
424
|
+
Your memories will be reconnected automatically.
|
|
425
|
+
`
|
|
426
|
+
};
|
|
427
|
+
const topicHelp = topics[topic.toLowerCase()];
|
|
428
|
+
if (topicHelp) {
|
|
429
|
+
console.log(topicHelp);
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
console.log(chalk.yellow(`\n Unknown topic: ${topic}`));
|
|
433
|
+
console.log(chalk.dim(` Available topics: ${Object.keys(topics).join(', ')}\n`));
|
|
434
|
+
console.log(chalk.dim(` Run 'memextend help' for general help.\n`));
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,gCAA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AK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AA2CD,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAoI3F"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// apps/cli/src/commands/import.ts
|
|
2
|
+
// Copyright (c) 2026 ZodTTD LLC. MIT License.
|
|
3
|
+
import { existsSync, readFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { homedir } from 'os';
|
|
6
|
+
import { createInterface } from 'readline';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
const MEMEXTEND_DIR = join(homedir(), '.memextend');
|
|
9
|
+
const DB_PATH = join(MEMEXTEND_DIR, 'memextend.db');
|
|
10
|
+
const VECTORS_PATH = join(MEMEXTEND_DIR, 'vectors');
|
|
11
|
+
const MODELS_PATH = join(MEMEXTEND_DIR, 'models');
|
|
12
|
+
async function confirm(message) {
|
|
13
|
+
const rl = createInterface({
|
|
14
|
+
input: process.stdin,
|
|
15
|
+
output: process.stdout,
|
|
16
|
+
});
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
rl.question(`${message} (y/N): `, (answer) => {
|
|
19
|
+
rl.close();
|
|
20
|
+
resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export async function importCommand(filePath, options) {
|
|
25
|
+
if (!existsSync(DB_PATH)) {
|
|
26
|
+
console.log(chalk.yellow('\n ⚠ memextend not initialized. Run `memextend init` first.\n'));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!existsSync(filePath)) {
|
|
30
|
+
console.log(chalk.red(`\n ✗ File not found: ${filePath}\n`));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
// Read and parse export file
|
|
35
|
+
console.log(chalk.bold('\n Reading export file...\n'));
|
|
36
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
37
|
+
let exportData;
|
|
38
|
+
try {
|
|
39
|
+
exportData = JSON.parse(content);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
console.log(chalk.red(' ✗ Invalid JSON file\n'));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// Validate export format
|
|
46
|
+
if (!exportData.version || !exportData.memories) {
|
|
47
|
+
console.log(chalk.red(' ✗ Invalid export file format\n'));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
console.log(chalk.dim(` Export version: ${exportData.version}`));
|
|
51
|
+
console.log(chalk.dim(` Exported at: ${exportData.exportedAt}`));
|
|
52
|
+
console.log(chalk.dim(` Export type: ${exportData.exportType}`));
|
|
53
|
+
console.log(chalk.dim(` Memories: ${exportData.memories.length}`));
|
|
54
|
+
console.log(chalk.dim(` Global profiles: ${exportData.globalProfiles?.length || 0}`));
|
|
55
|
+
console.log('');
|
|
56
|
+
// Validate only mode
|
|
57
|
+
if (options.validateOnly) {
|
|
58
|
+
console.log(chalk.green(' ✓ Export file is valid\n'));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Confirm import
|
|
62
|
+
if (!options.merge) {
|
|
63
|
+
console.log(chalk.yellow(' ⚠ Import will add new memories. Existing memories will NOT be deleted.'));
|
|
64
|
+
console.log(chalk.dim(' Use --merge to skip duplicates based on ID.\n'));
|
|
65
|
+
}
|
|
66
|
+
const confirmed = await confirm(chalk.cyan(' Proceed with import?'));
|
|
67
|
+
if (!confirmed) {
|
|
68
|
+
console.log(chalk.dim('\n Import cancelled.\n'));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// Import data
|
|
72
|
+
const { SQLiteStorage, LanceDBStorage, createEmbedFunction } = await import('@memextend/core');
|
|
73
|
+
const sqlite = new SQLiteStorage(DB_PATH);
|
|
74
|
+
const lancedb = await LanceDBStorage.create(VECTORS_PATH);
|
|
75
|
+
const embedder = await createEmbedFunction(MODELS_PATH);
|
|
76
|
+
let importedMemories = 0;
|
|
77
|
+
let importedProfiles = 0;
|
|
78
|
+
let skipped = 0;
|
|
79
|
+
console.log(chalk.bold('\n Importing...\n'));
|
|
80
|
+
// Import memories
|
|
81
|
+
for (const memory of exportData.memories) {
|
|
82
|
+
// Check if memory already exists (merge mode)
|
|
83
|
+
if (options.merge) {
|
|
84
|
+
const existing = sqlite.getMemory(memory.id);
|
|
85
|
+
if (existing) {
|
|
86
|
+
skipped++;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Insert memory
|
|
91
|
+
sqlite.insertMemory({
|
|
92
|
+
id: memory.id,
|
|
93
|
+
projectId: memory.projectId,
|
|
94
|
+
content: memory.content,
|
|
95
|
+
type: memory.type,
|
|
96
|
+
sourceTool: memory.sourceTool,
|
|
97
|
+
createdAt: memory.createdAt,
|
|
98
|
+
sessionId: memory.sessionId,
|
|
99
|
+
metadata: memory.metadata,
|
|
100
|
+
});
|
|
101
|
+
// Generate and store embedding
|
|
102
|
+
const vector = await embedder.embed(memory.content);
|
|
103
|
+
await lancedb.insertVector(memory.id, vector);
|
|
104
|
+
importedMemories++;
|
|
105
|
+
}
|
|
106
|
+
// Import global profiles
|
|
107
|
+
for (const profile of exportData.globalProfiles || []) {
|
|
108
|
+
if (options.merge) {
|
|
109
|
+
// Simple duplicate check by content
|
|
110
|
+
const existing = sqlite.getGlobalProfiles(1000);
|
|
111
|
+
if (existing.some(p => p.content === profile.content && p.key === profile.key)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
sqlite.insertGlobalProfile({
|
|
116
|
+
id: profile.id,
|
|
117
|
+
key: profile.key,
|
|
118
|
+
content: profile.content,
|
|
119
|
+
createdAt: profile.createdAt,
|
|
120
|
+
});
|
|
121
|
+
importedProfiles++;
|
|
122
|
+
}
|
|
123
|
+
console.log(chalk.green(` ✓ Imported ${importedMemories} memories`));
|
|
124
|
+
console.log(chalk.green(` ✓ Imported ${importedProfiles} global profiles`));
|
|
125
|
+
if (skipped > 0) {
|
|
126
|
+
console.log(chalk.dim(` ↷ Skipped ${skipped} duplicates`));
|
|
127
|
+
}
|
|
128
|
+
console.log('');
|
|
129
|
+
sqlite.close();
|
|
130
|
+
await lancedb.close();
|
|
131
|
+
await embedder.close();
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
console.error(chalk.red(`\n Error: ${error instanceof Error ? error.message : error}\n`));
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/commands/import.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,8CAA8C;AAE9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AACpD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AACpD,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACpD,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAkClD,KAAK,UAAU,OAAO,CAAC,OAAe;IACpC,MAAM,EAAE,GAAG,eAAe,CAAC;QACzB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;K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