@memnexus-ai/cli 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.
Files changed (148) hide show
  1. package/.env.example +13 -0
  2. package/.eslintrc.js +24 -0
  3. package/.github/ISSUE_TEMPLATE/phase-1-foundation.md +1078 -0
  4. package/.github/workflows/publish.yml +277 -0
  5. package/.github/workflows/test-app-token.yml +54 -0
  6. package/.npmrc.backup +3 -0
  7. package/.npmrc.example +6 -0
  8. package/.prettierignore +4 -0
  9. package/.prettierrc +8 -0
  10. package/CHANGELOG.md +138 -0
  11. package/PLATFORM_TESTING.md +243 -0
  12. package/README.md +986 -0
  13. package/RELEASE.md +428 -0
  14. package/RELEASE_READINESS.md +253 -0
  15. package/USAGE.md +1373 -0
  16. package/bin/mx.js +2 -0
  17. package/dist/commands/apikeys.d.ts +7 -0
  18. package/dist/commands/apikeys.d.ts.map +1 -0
  19. package/dist/commands/apikeys.js +133 -0
  20. package/dist/commands/apikeys.js.map +1 -0
  21. package/dist/commands/artifacts.d.ts +7 -0
  22. package/dist/commands/artifacts.d.ts.map +1 -0
  23. package/dist/commands/artifacts.js +277 -0
  24. package/dist/commands/artifacts.js.map +1 -0
  25. package/dist/commands/auth.d.ts +7 -0
  26. package/dist/commands/auth.d.ts.map +1 -0
  27. package/dist/commands/auth.js +119 -0
  28. package/dist/commands/auth.js.map +1 -0
  29. package/dist/commands/communities.d.ts +7 -0
  30. package/dist/commands/communities.d.ts.map +1 -0
  31. package/dist/commands/communities.js +137 -0
  32. package/dist/commands/communities.js.map +1 -0
  33. package/dist/commands/config.d.ts +7 -0
  34. package/dist/commands/config.d.ts.map +1 -0
  35. package/dist/commands/config.js +138 -0
  36. package/dist/commands/config.js.map +1 -0
  37. package/dist/commands/conversations.d.ts +7 -0
  38. package/dist/commands/conversations.d.ts.map +1 -0
  39. package/dist/commands/conversations.js +160 -0
  40. package/dist/commands/conversations.js.map +1 -0
  41. package/dist/commands/facts.d.ts +7 -0
  42. package/dist/commands/facts.d.ts.map +1 -0
  43. package/dist/commands/facts.js +298 -0
  44. package/dist/commands/facts.js.map +1 -0
  45. package/dist/commands/graphrag.d.ts +7 -0
  46. package/dist/commands/graphrag.d.ts.map +1 -0
  47. package/dist/commands/graphrag.js +139 -0
  48. package/dist/commands/graphrag.js.map +1 -0
  49. package/dist/commands/memories.d.ts +7 -0
  50. package/dist/commands/memories.d.ts.map +1 -0
  51. package/dist/commands/memories.js +304 -0
  52. package/dist/commands/memories.js.map +1 -0
  53. package/dist/commands/patterns.d.ts +7 -0
  54. package/dist/commands/patterns.d.ts.map +1 -0
  55. package/dist/commands/patterns.js +227 -0
  56. package/dist/commands/patterns.js.map +1 -0
  57. package/dist/commands/system.d.ts +7 -0
  58. package/dist/commands/system.d.ts.map +1 -0
  59. package/dist/commands/system.js +97 -0
  60. package/dist/commands/system.js.map +1 -0
  61. package/dist/commands/topics.d.ts +7 -0
  62. package/dist/commands/topics.d.ts.map +1 -0
  63. package/dist/commands/topics.js +314 -0
  64. package/dist/commands/topics.js.map +1 -0
  65. package/dist/index.d.ts +3 -0
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/index.js +44 -0
  68. package/dist/index.js.map +1 -0
  69. package/dist/lib/api-client.d.ts +29 -0
  70. package/dist/lib/api-client.d.ts.map +1 -0
  71. package/dist/lib/api-client.js +64 -0
  72. package/dist/lib/api-client.js.map +1 -0
  73. package/dist/lib/auth.d.ts +10 -0
  74. package/dist/lib/auth.d.ts.map +1 -0
  75. package/dist/lib/auth.js +47 -0
  76. package/dist/lib/auth.js.map +1 -0
  77. package/dist/lib/config.d.ts +19 -0
  78. package/dist/lib/config.d.ts.map +1 -0
  79. package/dist/lib/config.js +59 -0
  80. package/dist/lib/config.js.map +1 -0
  81. package/dist/lib/errors.d.ts +7 -0
  82. package/dist/lib/errors.d.ts.map +1 -0
  83. package/dist/lib/errors.js +133 -0
  84. package/dist/lib/errors.js.map +1 -0
  85. package/dist/lib/formatters.d.ts +12 -0
  86. package/dist/lib/formatters.d.ts.map +1 -0
  87. package/dist/lib/formatters.js +103 -0
  88. package/dist/lib/formatters.js.map +1 -0
  89. package/dist/lib/spinner.d.ts +54 -0
  90. package/dist/lib/spinner.d.ts.map +1 -0
  91. package/dist/lib/spinner.js +108 -0
  92. package/dist/lib/spinner.js.map +1 -0
  93. package/dist/lib/validators.d.ts +92 -0
  94. package/dist/lib/validators.d.ts.map +1 -0
  95. package/dist/lib/validators.js +257 -0
  96. package/dist/lib/validators.js.map +1 -0
  97. package/dist/types/index.d.ts +13 -0
  98. package/dist/types/index.d.ts.map +1 -0
  99. package/dist/types/index.js +3 -0
  100. package/dist/types/index.js.map +1 -0
  101. package/docs/README.md +219 -0
  102. package/docs/code-generation-strategy.md +560 -0
  103. package/docs/prd.md +748 -0
  104. package/docs/sync-strategy.md +533 -0
  105. package/jest.config.js +30 -0
  106. package/package.json +67 -0
  107. package/scripts/install-deps.sh +38 -0
  108. package/src/commands/apikeys.ts +144 -0
  109. package/src/commands/artifacts.ts +296 -0
  110. package/src/commands/auth.ts +122 -0
  111. package/src/commands/communities.ts +153 -0
  112. package/src/commands/config.ts +144 -0
  113. package/src/commands/conversations.ts +176 -0
  114. package/src/commands/facts.ts +320 -0
  115. package/src/commands/graphrag.ts +149 -0
  116. package/src/commands/memories.ts +332 -0
  117. package/src/commands/patterns.ts +251 -0
  118. package/src/commands/system.ts +102 -0
  119. package/src/commands/topics.ts +354 -0
  120. package/src/index.ts +43 -0
  121. package/src/lib/api-client.ts +68 -0
  122. package/src/lib/auth.ts +42 -0
  123. package/src/lib/config.ts +68 -0
  124. package/src/lib/errors.ts +143 -0
  125. package/src/lib/formatters.ts +123 -0
  126. package/src/lib/spinner.ts +113 -0
  127. package/src/lib/validators.ts +302 -0
  128. package/src/types/index.ts +17 -0
  129. package/tests/__mocks__/chalk.ts +16 -0
  130. package/tests/__mocks__/cli-table3.ts +37 -0
  131. package/tests/__mocks__/configstore.ts +38 -0
  132. package/tests/commands/apikeys.test.ts +179 -0
  133. package/tests/commands/artifacts.test.ts +194 -0
  134. package/tests/commands/auth.test.ts +120 -0
  135. package/tests/commands/communities.test.ts +154 -0
  136. package/tests/commands/config.test.ts +154 -0
  137. package/tests/commands/conversations.test.ts +136 -0
  138. package/tests/commands/facts.test.ts +210 -0
  139. package/tests/commands/graphrag.test.ts +194 -0
  140. package/tests/commands/memories.test.ts +215 -0
  141. package/tests/commands/patterns.test.ts +201 -0
  142. package/tests/commands/system.test.ts +172 -0
  143. package/tests/commands/topics.test.ts +274 -0
  144. package/tests/lib/auth.test.ts +77 -0
  145. package/tests/lib/config.test.ts +50 -0
  146. package/tests/lib/errors.test.ts +126 -0
  147. package/tests/lib/formatters.test.ts +87 -0
  148. package/tsconfig.json +20 -0
package/USAGE.md ADDED
@@ -0,0 +1,1373 @@
1
+ # mx-cli Usage Guide
2
+
3
+ Complete reference for all mx-cli commands, options, and usage patterns.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Authentication Commands](#authentication-commands)
8
+ - [Configuration Commands](#configuration-commands)
9
+ - [Memory Commands](#memory-commands)
10
+ - [Conversation Commands](#conversation-commands)
11
+ - [Fact Commands](#fact-commands)
12
+ - [Topic Commands](#topic-commands)
13
+ - [Community Commands](#community-commands)
14
+ - [Pattern Commands](#pattern-commands)
15
+ - [GraphRAG Commands](#graphrag-commands)
16
+ - [Artifact Commands](#artifact-commands)
17
+ - [API Key Commands](#api-key-commands)
18
+ - [System Commands](#system-commands)
19
+ - [Global Options](#global-options)
20
+ - [Output Formats](#output-formats)
21
+ - [Best Practices](#best-practices)
22
+
23
+ ---
24
+
25
+ ## Authentication Commands
26
+
27
+ ### `mx auth login`
28
+
29
+ Configure API key for authentication.
30
+
31
+ **Options:**
32
+ - `--api-key <key>` - API key to store
33
+ - `--interactive` - Prompt for API key with password masking
34
+
35
+ **Examples:**
36
+ ```bash
37
+ # Direct login
38
+ mx auth login --api-key cmk_live_abc123.xyz789
39
+
40
+ # Interactive mode (recommended for security)
41
+ mx auth login --interactive
42
+ ```
43
+
44
+ **Notes:**
45
+ - Interactive mode masks the API key input for security
46
+ - API key is stored in `~/.mx-cli/config.json`
47
+ - Can also be set via `MX_API_KEY` environment variable
48
+
49
+ ### `mx auth logout`
50
+
51
+ Remove stored credentials.
52
+
53
+ **Examples:**
54
+ ```bash
55
+ mx auth logout
56
+ ```
57
+
58
+ ### `mx auth status`
59
+
60
+ Show current authentication status.
61
+
62
+ **Examples:**
63
+ ```bash
64
+ mx auth status
65
+ ```
66
+
67
+ **Output:**
68
+ - Authentication status (configured/not configured)
69
+ - API URL
70
+ - Output format
71
+ - Source of configuration (environment/config file)
72
+
73
+ ---
74
+
75
+ ## Configuration Commands
76
+
77
+ ### `mx config set <key> <value>`
78
+
79
+ Set a configuration value.
80
+
81
+ **Available Keys:**
82
+ - `apiUrl` - MemNexus API base URL
83
+ - `format` - Default output format (json|table|yaml)
84
+
85
+ **Examples:**
86
+ ```bash
87
+ mx config set apiUrl https://api.memnexus.io
88
+ mx config set format json
89
+ ```
90
+
91
+ ### `mx config get <key>`
92
+
93
+ Get a configuration value.
94
+
95
+ **Examples:**
96
+ ```bash
97
+ mx config get apiUrl
98
+ mx config get format
99
+ ```
100
+
101
+ ### `mx config list`
102
+
103
+ List all configuration values.
104
+
105
+ **Examples:**
106
+ ```bash
107
+ mx config list
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Memory Commands
113
+
114
+ ### `mx memories list`
115
+
116
+ List memories with pagination.
117
+
118
+ **Options:**
119
+ - `--page <number>` - Page number (default: 0)
120
+ - `--limit <number>` - Results per page (default: 20)
121
+ - `--format <format>` - Output format (json|table|yaml)
122
+
123
+ **Examples:**
124
+ ```bash
125
+ # List first page
126
+ mx memories list
127
+
128
+ # List with custom pagination
129
+ mx memories list --page 2 --limit 50
130
+
131
+ # Output as JSON
132
+ mx memories list --format json
133
+ ```
134
+
135
+ ### `mx memories get <id>`
136
+
137
+ Get a specific memory by ID.
138
+
139
+ **Options:**
140
+ - `--format <format>` - Output format (json|table|yaml)
141
+
142
+ **Examples:**
143
+ ```bash
144
+ mx memories get 26be666e-7503-40d7-9293-8ffbcdc04dd2
145
+ mx memories get 26be666e-7503-40d7-9293-8ffbcdc04dd2 --format json
146
+ ```
147
+
148
+ ### `mx memories create`
149
+
150
+ Create a new memory.
151
+
152
+ **Options:**
153
+ - `--content <text>` - Memory content (required in direct mode)
154
+ - `--memory-type <type>` - Type: episodic or semantic (default: episodic)
155
+ - `--context <context>` - Context identifier
156
+ - `--topics <topics>` - Comma-separated topics
157
+ - `--importance <number>` - Importance score 0-1 (default: 0.5)
158
+ - `--interactive` - Interactive mode with prompts
159
+ - `--format <format>` - Output format (json|table|yaml)
160
+
161
+ **Examples:**
162
+ ```bash
163
+ # Interactive mode (recommended)
164
+ mx memories create --interactive
165
+
166
+ # Direct mode
167
+ mx memories create \
168
+ --content "Meeting notes: Q4 planning session" \
169
+ --memory-type episodic \
170
+ --context work \
171
+ --topics "meetings,planning,q4" \
172
+ --importance 0.8
173
+
174
+ # Minimal creation
175
+ mx memories create --content "Quick note"
176
+ ```
177
+
178
+ ### `mx memories update <id>`
179
+
180
+ Update an existing memory.
181
+
182
+ **Options:**
183
+ - `--content <text>` - Updated content
184
+ - `--memory-type <type>` - Updated memory type
185
+ - `--context <context>` - Updated context
186
+ - `--topics <topics>` - Updated topics (comma-separated)
187
+ - `--importance <number>` - Updated importance (0-1)
188
+ - `--format <format>` - Output format (json|table|yaml)
189
+
190
+ **Examples:**
191
+ ```bash
192
+ # Update content
193
+ mx memories update 26be666e-7503-40d7-9293-8ffbcdc04dd2 \
194
+ --content "Updated meeting notes"
195
+
196
+ # Update multiple fields
197
+ mx memories update 26be666e-7503-40d7-9293-8ffbcdc04dd2 \
198
+ --content "New content" \
199
+ --topics "updated,tags" \
200
+ --importance 0.9
201
+ ```
202
+
203
+ ### `mx memories delete <id>`
204
+
205
+ Delete a memory.
206
+
207
+ **Options:**
208
+ - `--force` - Skip confirmation prompt
209
+
210
+ **Examples:**
211
+ ```bash
212
+ # With confirmation
213
+ mx memories delete 26be666e-7503-40d7-9293-8ffbcdc04dd2
214
+
215
+ # Skip confirmation
216
+ mx memories delete 26be666e-7503-40d7-9293-8ffbcdc04dd2 --force
217
+ ```
218
+
219
+ ### `mx memories search`
220
+
221
+ Search memories using semantic or keyword search.
222
+
223
+ **Options:**
224
+ - `--query <text>` - Search query (required)
225
+ - `--limit <number>` - Maximum results (default: 20)
226
+ - `--mode <mode>` - Search mode: unified|content|facts (default: unified)
227
+ - `--format <format>` - Output format (json|table|yaml)
228
+
229
+ **Examples:**
230
+ ```bash
231
+ # Basic search
232
+ mx memories search --query "Q4 planning"
233
+
234
+ # Search with limit
235
+ mx memories search --query "meetings" --limit 10
236
+
237
+ # Content-only search
238
+ mx memories search --query "technical discussion" --mode content
239
+
240
+ # Facts-only search
241
+ mx memories search --query "TypeScript" --mode facts
242
+ ```
243
+
244
+ ---
245
+
246
+ ## Conversation Commands
247
+
248
+ ### `mx conversations list`
249
+
250
+ List conversations with pagination.
251
+
252
+ **Options:**
253
+ - `--page <number>` - Page number (default: 0)
254
+ - `--limit <number>` - Results per page (default: 20)
255
+ - `--format <format>` - Output format (json|table|yaml)
256
+
257
+ **Examples:**
258
+ ```bash
259
+ mx conversations list
260
+ mx conversations list --page 1 --limit 50
261
+ ```
262
+
263
+ ### `mx conversations get <id>`
264
+
265
+ Get conversation details.
266
+
267
+ **Options:**
268
+ - `--format <format>` - Output format (json|table|yaml)
269
+
270
+ **Examples:**
271
+ ```bash
272
+ mx conversations get conv_abc123
273
+ ```
274
+
275
+ ### `mx conversations timeline <id>`
276
+
277
+ Get chronological message history for a conversation.
278
+
279
+ **Options:**
280
+ - `--format <format>` - Output format (json|table|yaml)
281
+
282
+ **Examples:**
283
+ ```bash
284
+ mx conversations timeline conv_abc123
285
+ ```
286
+
287
+ ### `mx conversations search`
288
+
289
+ Search through conversation content.
290
+
291
+ **Options:**
292
+ - `--query <text>` - Search query (required)
293
+ - `--limit <number>` - Maximum results (default: 20)
294
+ - `--format <format>` - Output format (json|table|yaml)
295
+
296
+ **Examples:**
297
+ ```bash
298
+ mx conversations search --query "authentication discussion"
299
+ ```
300
+
301
+ ### `mx conversations by-topic`
302
+
303
+ Find conversations by topic.
304
+
305
+ **Options:**
306
+ - `--topic-id <id>` - Topic ID (required)
307
+ - `--limit <number>` - Maximum results (default: 20)
308
+ - `--format <format>` - Output format (json|table|yaml)
309
+
310
+ **Examples:**
311
+ ```bash
312
+ mx conversations by-topic --topic-id topic_123
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Fact Commands
318
+
319
+ ### `mx facts list`
320
+
321
+ List facts with pagination.
322
+
323
+ **Options:**
324
+ - `--page <number>` - Page number (default: 0)
325
+ - `--limit <number>` - Results per page (default: 20)
326
+ - `--format <format>` - Output format (json|table|yaml)
327
+
328
+ **Examples:**
329
+ ```bash
330
+ mx facts list
331
+ mx facts list --page 1 --limit 50 --format json
332
+ ```
333
+
334
+ ### `mx facts get <id>`
335
+
336
+ Get a specific fact by ID.
337
+
338
+ **Options:**
339
+ - `--format <format>` - Output format (json|table|yaml)
340
+
341
+ **Examples:**
342
+ ```bash
343
+ mx facts get fact_abc123
344
+ ```
345
+
346
+ ### `mx facts create`
347
+
348
+ Create a new fact (subject-predicate-object triple).
349
+
350
+ **Options:**
351
+ - `--subject <text>` - Subject of the fact (required in direct mode)
352
+ - `--predicate <text>` - Predicate/relationship (required in direct mode)
353
+ - `--object <text>` - Object of the fact (required in direct mode)
354
+ - `--confidence <number>` - Confidence score 0-1 (default: 1.0)
355
+ - `--memory-id <id>` - Associated memory ID
356
+ - `--interactive` - Interactive mode with prompts
357
+ - `--format <format>` - Output format (json|table|yaml)
358
+
359
+ **Examples:**
360
+ ```bash
361
+ # Interactive mode
362
+ mx facts create --interactive
363
+
364
+ # Direct mode
365
+ mx facts create \
366
+ --subject "TypeScript" \
367
+ --predicate "is_a" \
368
+ --object "Programming Language" \
369
+ --confidence 1.0
370
+
371
+ # With memory association
372
+ mx facts create \
373
+ --subject "mx-cli" \
374
+ --predicate "built_with" \
375
+ --object "TypeScript" \
376
+ --confidence 1.0 \
377
+ --memory-id mem_abc123
378
+ ```
379
+
380
+ ### `mx facts update <id>`
381
+
382
+ Update an existing fact.
383
+
384
+ **Options:**
385
+ - `--subject <text>` - Updated subject
386
+ - `--predicate <text>` - Updated predicate
387
+ - `--object <text>` - Updated object
388
+ - `--confidence <number>` - Updated confidence (0-1)
389
+ - `--format <format>` - Output format (json|table|yaml)
390
+
391
+ **Examples:**
392
+ ```bash
393
+ mx facts update fact_abc123 --confidence 0.9
394
+ mx facts update fact_abc123 --predicate "uses" --confidence 0.95
395
+ ```
396
+
397
+ ### `mx facts delete <id>`
398
+
399
+ Delete a fact.
400
+
401
+ **Options:**
402
+ - `--force` - Skip confirmation prompt
403
+
404
+ **Examples:**
405
+ ```bash
406
+ # With confirmation
407
+ mx facts delete fact_abc123
408
+
409
+ # Skip confirmation
410
+ mx facts delete fact_abc123 --force
411
+ ```
412
+
413
+ ### `mx facts search`
414
+
415
+ Search through facts.
416
+
417
+ **Options:**
418
+ - `--query <text>` - Search query (required)
419
+ - `--limit <number>` - Maximum results (default: 20)
420
+ - `--format <format>` - Output format (json|table|yaml)
421
+
422
+ **Examples:**
423
+ ```bash
424
+ mx facts search --query "TypeScript"
425
+ mx facts search --query "programming" --limit 10 --format json
426
+ ```
427
+
428
+ ---
429
+
430
+ ## Topic Commands
431
+
432
+ ### `mx topics list`
433
+
434
+ List all topics.
435
+
436
+ **Options:**
437
+ - `--page <number>` - Page number (default: 0)
438
+ - `--limit <number>` - Results per page (default: 20)
439
+ - `--format <format>` - Output format (json|table|yaml)
440
+
441
+ **Examples:**
442
+ ```bash
443
+ mx topics list
444
+ mx topics list --limit 50 --format json
445
+ ```
446
+
447
+ ### `mx topics get <id>`
448
+
449
+ Get topic details.
450
+
451
+ **Options:**
452
+ - `--format <format>` - Output format (json|table|yaml)
453
+
454
+ **Examples:**
455
+ ```bash
456
+ mx topics get topic_abc123
457
+ ```
458
+
459
+ ### `mx topics merge`
460
+
461
+ Merge two topics together.
462
+
463
+ **Options:**
464
+ - `--source-id <id>` - Source topic ID to merge from (required)
465
+ - `--target-id <id>` - Target topic ID to merge into (required)
466
+ - `--force` - Skip confirmation prompt
467
+
468
+ **Examples:**
469
+ ```bash
470
+ # With confirmation
471
+ mx topics merge --source-id topic_123 --target-id topic_456
472
+
473
+ # Skip confirmation
474
+ mx topics merge --source-id topic_123 --target-id topic_456 --force
475
+ ```
476
+
477
+ ### `mx topics discover-related`
478
+
479
+ Discover topics related to a given topic.
480
+
481
+ **Options:**
482
+ - `--topic-id <id>` - Topic ID (required)
483
+ - `--limit <number>` - Maximum results (default: 10)
484
+ - `--format <format>` - Output format (json|table|yaml)
485
+
486
+ **Examples:**
487
+ ```bash
488
+ mx topics discover-related --topic-id topic_abc123
489
+ mx topics discover-related --topic-id topic_abc123 --limit 20
490
+ ```
491
+
492
+ ### `mx topics similarity`
493
+
494
+ Calculate similarity between two topics.
495
+
496
+ **Options:**
497
+ - `--topic-id-1 <id>` - First topic ID (required)
498
+ - `--topic-id-2 <id>` - Second topic ID (required)
499
+ - `--format <format>` - Output format (json|table|yaml)
500
+
501
+ **Examples:**
502
+ ```bash
503
+ mx topics similarity --topic-id-1 topic_123 --topic-id-2 topic_456
504
+ ```
505
+
506
+ ### `mx topics find-similar`
507
+
508
+ Find topics similar to a given topic.
509
+
510
+ **Options:**
511
+ - `--topic-id <id>` - Topic ID (required)
512
+ - `--threshold <number>` - Similarity threshold 0-1 (default: 0.7)
513
+ - `--limit <number>` - Maximum results (default: 10)
514
+ - `--format <format>` - Output format (json|table|yaml)
515
+
516
+ **Examples:**
517
+ ```bash
518
+ mx topics find-similar --topic-id topic_abc123
519
+ mx topics find-similar --topic-id topic_abc123 --threshold 0.8 --limit 20
520
+ ```
521
+
522
+ ### `mx topics cluster`
523
+
524
+ Cluster topics using various algorithms.
525
+
526
+ **Options:**
527
+ - `--algorithm <name>` - Algorithm: kmeans|hierarchical|dbscan (required)
528
+ - `--num-clusters <number>` - Number of clusters (for kmeans, default: 5)
529
+ - `--format <format>` - Output format (json|table|yaml)
530
+
531
+ **Examples:**
532
+ ```bash
533
+ # K-means clustering
534
+ mx topics cluster --algorithm kmeans --num-clusters 5
535
+
536
+ # Hierarchical clustering
537
+ mx topics cluster --algorithm hierarchical
538
+
539
+ # DBSCAN clustering
540
+ mx topics cluster --algorithm dbscan
541
+ ```
542
+
543
+ ### `mx topics detect-communities`
544
+
545
+ Detect communities in the topic graph.
546
+
547
+ **Options:**
548
+ - `--algorithm <name>` - Algorithm: louvain|label-propagation|girvan-newman (required)
549
+ - `--min-size <number>` - Minimum community size (default: 2)
550
+ - `--format <format>` - Output format (json|table|yaml)
551
+
552
+ **Examples:**
553
+ ```bash
554
+ # Louvain method
555
+ mx topics detect-communities --algorithm louvain
556
+
557
+ # Label propagation
558
+ mx topics detect-communities --algorithm label-propagation --min-size 3
559
+
560
+ # Girvan-Newman
561
+ mx topics detect-communities --algorithm girvan-newman
562
+ ```
563
+
564
+ ---
565
+
566
+ ## Community Commands
567
+
568
+ ### `mx communities list`
569
+
570
+ List all communities.
571
+
572
+ **Options:**
573
+ - `--page <number>` - Page number (default: 0)
574
+ - `--limit <number>` - Results per page (default: 20)
575
+ - `--format <format>` - Output format (json|table|yaml)
576
+
577
+ **Examples:**
578
+ ```bash
579
+ mx communities list
580
+ mx communities list --limit 50
581
+ ```
582
+
583
+ ### `mx communities get <id>`
584
+
585
+ Get community details.
586
+
587
+ **Options:**
588
+ - `--format <format>` - Output format (json|table|yaml)
589
+
590
+ **Examples:**
591
+ ```bash
592
+ mx communities get community_abc123
593
+ ```
594
+
595
+ ### `mx communities merge`
596
+
597
+ Merge two communities.
598
+
599
+ **Options:**
600
+ - `--source-id <id>` - Source community ID (required)
601
+ - `--target-id <id>` - Target community ID (required)
602
+ - `--force` - Skip confirmation prompt
603
+
604
+ **Examples:**
605
+ ```bash
606
+ # With confirmation
607
+ mx communities merge --source-id comm_123 --target-id comm_456
608
+
609
+ # Skip confirmation
610
+ mx communities merge --source-id comm_123 --target-id comm_456 --force
611
+ ```
612
+
613
+ ---
614
+
615
+ ## Pattern Commands
616
+
617
+ ### `mx patterns compile`
618
+
619
+ Compile behavioral patterns from a context.
620
+
621
+ **Options:**
622
+ - `--context-id <id>` - Context ID (required)
623
+ - `--format <format>` - Output format (json|table|yaml)
624
+
625
+ **Examples:**
626
+ ```bash
627
+ mx patterns compile --context-id ctx_abc123
628
+ ```
629
+
630
+ ### `mx patterns feedback`
631
+
632
+ Record feedback on a pattern.
633
+
634
+ **Options:**
635
+ - `--pattern-id <id>` - Pattern ID (required)
636
+ - `--feedback <type>` - Feedback type: positive|negative (required)
637
+ - `--format <format>` - Output format (json|table|yaml)
638
+
639
+ **Examples:**
640
+ ```bash
641
+ mx patterns feedback --pattern-id pattern_123 --feedback positive
642
+ mx patterns feedback --pattern-id pattern_456 --feedback negative
643
+ ```
644
+
645
+ ### `mx patterns set-state`
646
+
647
+ Set the state of a behavioral pattern.
648
+
649
+ **Options:**
650
+ - `--pattern-id <id>` - Pattern ID (required)
651
+ - `--state <state>` - State: active|inactive (required)
652
+ - `--format <format>` - Output format (json|table|yaml)
653
+
654
+ **Examples:**
655
+ ```bash
656
+ mx patterns set-state --pattern-id pattern_123 --state active
657
+ mx patterns set-state --pattern-id pattern_456 --state inactive
658
+ ```
659
+
660
+ ---
661
+
662
+ ## GraphRAG Commands
663
+
664
+ ### `mx graphrag query`
665
+
666
+ Execute a graph-based retrieval augmented generation query.
667
+
668
+ **Options:**
669
+ - `--query <text>` - Query text (required)
670
+ - `--format <format>` - Output format (json|table|yaml)
671
+
672
+ **Examples:**
673
+ ```bash
674
+ mx graphrag query --query "What are the main themes in my work memories?"
675
+ mx graphrag query --query "Summarize technical discussions from last week"
676
+ ```
677
+
678
+ ### `mx graphrag explain`
679
+
680
+ Generate an explanation for a specific memory using graph context.
681
+
682
+ **Options:**
683
+ - `--memory-id <id>` - Memory ID (required)
684
+ - `--format <format>` - Output format (json|table|yaml)
685
+
686
+ **Examples:**
687
+ ```bash
688
+ mx graphrag explain --memory-id mem_abc123
689
+ ```
690
+
691
+ ### `mx graphrag query-communities`
692
+
693
+ Query across detected communities.
694
+
695
+ **Options:**
696
+ - `--query <text>` - Query text (required)
697
+ - `--limit <number>` - Maximum communities to query (default: 5)
698
+ - `--format <format>` - Output format (json|table|yaml)
699
+
700
+ **Examples:**
701
+ ```bash
702
+ mx graphrag query-communities --query "technical discussions"
703
+ mx graphrag query-communities --query "project planning" --limit 10
704
+ ```
705
+
706
+ ---
707
+
708
+ ## Artifact Commands
709
+
710
+ ### `mx artifacts list`
711
+
712
+ List artifacts with pagination.
713
+
714
+ **Options:**
715
+ - `--page <number>` - Page number (default: 0)
716
+ - `--limit <number>` - Results per page (default: 20)
717
+ - `--format <format>` - Output format (json|table|yaml)
718
+
719
+ **Examples:**
720
+ ```bash
721
+ mx artifacts list
722
+ mx artifacts list --page 1 --limit 50
723
+ ```
724
+
725
+ ### `mx artifacts get <id>`
726
+
727
+ Get artifact details.
728
+
729
+ **Options:**
730
+ - `--format <format>` - Output format (json|table|yaml)
731
+
732
+ **Examples:**
733
+ ```bash
734
+ mx artifacts get artifact_abc123
735
+ ```
736
+
737
+ ### `mx artifacts create`
738
+
739
+ Create a new artifact.
740
+
741
+ **Options:**
742
+ - `--name <text>` - Artifact name (required in direct mode)
743
+ - `--type <text>` - Artifact type (required in direct mode)
744
+ - `--context-id <id>` - Associated context ID
745
+ - `--data <json>` - Artifact data as JSON string
746
+ - `--metadata <json>` - Artifact metadata as JSON string
747
+ - `--interactive` - Interactive mode with prompts
748
+ - `--format <format>` - Output format (json|table|yaml)
749
+
750
+ **Examples:**
751
+ ```bash
752
+ # Interactive mode (recommended)
753
+ mx artifacts create --interactive
754
+
755
+ # Direct mode
756
+ mx artifacts create \
757
+ --name "Project Document" \
758
+ --type "pdf" \
759
+ --context-id ctx_123 \
760
+ --data '{"url": "https://example.com/doc.pdf"}' \
761
+ --metadata '{"author": "John Doe"}'
762
+ ```
763
+
764
+ ### `mx artifacts update <id>`
765
+
766
+ Update an existing artifact.
767
+
768
+ **Options:**
769
+ - `--name <text>` - Updated name
770
+ - `--type <text>` - Updated type
771
+ - `--data <json>` - Updated data as JSON string
772
+ - `--metadata <json>` - Updated metadata as JSON string
773
+ - `--format <format>` - Output format (json|table|yaml)
774
+
775
+ **Examples:**
776
+ ```bash
777
+ mx artifacts update artifact_abc123 --name "Updated Document"
778
+ mx artifacts update artifact_abc123 --metadata '{"version": "2.0"}'
779
+ ```
780
+
781
+ ### `mx artifacts delete <id>`
782
+
783
+ Delete an artifact.
784
+
785
+ **Options:**
786
+ - `--force` - Skip confirmation prompt
787
+
788
+ **Examples:**
789
+ ```bash
790
+ # With confirmation
791
+ mx artifacts delete artifact_abc123
792
+
793
+ # Skip confirmation
794
+ mx artifacts delete artifact_abc123 --force
795
+ ```
796
+
797
+ ---
798
+
799
+ ## API Key Commands
800
+
801
+ ### `mx apikeys list`
802
+
803
+ List API keys (metadata only, never shows actual keys).
804
+
805
+ **Options:**
806
+ - `--page <number>` - Page number (default: 0)
807
+ - `--limit <number>` - Results per page (default: 20)
808
+ - `--format <format>` - Output format (json|table|yaml)
809
+
810
+ **Examples:**
811
+ ```bash
812
+ mx apikeys list
813
+ mx apikeys list --format json
814
+ ```
815
+
816
+ **Note:** For security, actual API keys are never displayed. Only metadata like ID, label, and creation date are shown.
817
+
818
+ ### `mx apikeys create`
819
+
820
+ Create a new API key.
821
+
822
+ **Options:**
823
+ - `--label <text>` - Label for the API key (required)
824
+ - `--expires-at <datetime>` - Expiration date (ISO 8601 format)
825
+ - `--format <format>` - Output format (json|table|yaml)
826
+
827
+ **Examples:**
828
+ ```bash
829
+ # Create key without expiration
830
+ mx apikeys create --label "My CLI Key"
831
+
832
+ # Create key with expiration
833
+ mx apikeys create --label "Temporary Key" --expires-at "2024-12-31T23:59:59Z"
834
+ ```
835
+
836
+ **Important:** The actual API key is only shown once during creation. Save it securely!
837
+
838
+ ### `mx apikeys delete <id>`
839
+
840
+ Delete an API key.
841
+
842
+ **Options:**
843
+ - `--force` - Skip confirmation prompt
844
+
845
+ **Examples:**
846
+ ```bash
847
+ # With confirmation
848
+ mx apikeys delete key_abc123
849
+
850
+ # Skip confirmation
851
+ mx apikeys delete key_abc123 --force
852
+ ```
853
+
854
+ ---
855
+
856
+ ## System Commands
857
+
858
+ ### `mx system health`
859
+
860
+ Check system health status.
861
+
862
+ **Options:**
863
+ - `--format <format>` - Output format (json|table|yaml)
864
+
865
+ **Examples:**
866
+ ```bash
867
+ mx system health
868
+ mx system health --format json
869
+ ```
870
+
871
+ ### `mx system status`
872
+
873
+ Get detailed system status.
874
+
875
+ **Options:**
876
+ - `--format <format>` - Output format (json|table|yaml)
877
+
878
+ **Examples:**
879
+ ```bash
880
+ mx system status
881
+ ```
882
+
883
+ ### `mx system feature-flags`
884
+
885
+ List available feature flags.
886
+
887
+ **Options:**
888
+ - `--format <format>` - Output format (json|table|yaml)
889
+
890
+ **Examples:**
891
+ ```bash
892
+ mx system feature-flags
893
+ mx system feature-flags --format json
894
+ ```
895
+
896
+ ---
897
+
898
+ ## Global Options
899
+
900
+ These options are available for most commands:
901
+
902
+ ### `--format <format>`
903
+
904
+ Control output format.
905
+
906
+ **Values:**
907
+ - `table` - Human-readable table format (default)
908
+ - `json` - JSON format for scripting and parsing
909
+ - `yaml` - YAML format for human-readable structured data
910
+
911
+ **Examples:**
912
+ ```bash
913
+ mx memories list --format json
914
+ mx facts list --format yaml
915
+ mx topics list --format table
916
+ ```
917
+
918
+ **Note:** Can also be set globally via:
919
+ - Environment variable: `MX_OUTPUT_FORMAT=json`
920
+ - Config command: `mx config set format json`
921
+
922
+ ### `--page <number>`
923
+
924
+ Specify page number for paginated results (0-based).
925
+
926
+ **Default:** 0
927
+
928
+ **Examples:**
929
+ ```bash
930
+ mx memories list --page 0 # First page
931
+ mx memories list --page 1 # Second page
932
+ mx memories list --page 5 # Sixth page
933
+ ```
934
+
935
+ ### `--limit <number>`
936
+
937
+ Specify number of results per page.
938
+
939
+ **Default:** 20
940
+
941
+ **Examples:**
942
+ ```bash
943
+ mx memories list --limit 10 # 10 items per page
944
+ mx memories list --limit 50 # 50 items per page
945
+ mx memories list --limit 100 # 100 items per page
946
+ ```
947
+
948
+ ### `--force`
949
+
950
+ Skip confirmation prompts for destructive operations.
951
+
952
+ **Applies to:**
953
+ - Delete operations (memories, facts, artifacts, apikeys)
954
+ - Merge operations (topics, communities)
955
+
956
+ **Examples:**
957
+ ```bash
958
+ mx memories delete mem_123 --force
959
+ mx topics merge --source-id topic_1 --target-id topic_2 --force
960
+ ```
961
+
962
+ **⚠️ Warning:** Use with caution! This bypasses safety confirmations.
963
+
964
+ ### `--interactive`
965
+
966
+ Enable interactive mode with prompts.
967
+
968
+ **Applies to:**
969
+ - `mx auth login`
970
+ - `mx memories create`
971
+ - `mx facts create`
972
+ - `mx artifacts create`
973
+
974
+ **Examples:**
975
+ ```bash
976
+ mx memories create --interactive
977
+ mx facts create --interactive
978
+ ```
979
+
980
+ **Benefits:**
981
+ - Input validation
982
+ - Helpful error messages
983
+ - Default values
984
+ - Password masking for sensitive inputs
985
+
986
+ ---
987
+
988
+ ## Output Formats
989
+
990
+ ### Table Format (Default)
991
+
992
+ Human-readable table output, ideal for terminal viewing.
993
+
994
+ **Example:**
995
+ ```bash
996
+ mx memories list --format table
997
+ ```
998
+
999
+ **Output:**
1000
+ ```
1001
+ ┌──────────────────────────────────────┬─────────────────────────┬──────────────┬────────────┐
1002
+ │ ID │ Content │ Type │ Importance │
1003
+ ├──────────────────────────────────────┼─────────────────────────┼──────────────┼────────────┤
1004
+ │ 26be666e-7503-40d7-9293-8ffbcdc04dd2 │ Meeting notes: Q4... │ episodic │ 0.8 │
1005
+ │ 3f7a8b2c-1234-5678-90ab-cdef12345678 │ Technical discussion... │ episodic │ 0.7 │
1006
+ └──────────────────────────────────────┴─────────────────────────┴──────────────┴────────────┘
1007
+ ```
1008
+
1009
+ **Best for:**
1010
+ - Interactive terminal use
1011
+ - Quick visual inspection
1012
+ - Human readability
1013
+
1014
+ ### JSON Format
1015
+
1016
+ Machine-readable JSON output, ideal for scripting and parsing.
1017
+
1018
+ **Example:**
1019
+ ```bash
1020
+ mx memories list --format json
1021
+ ```
1022
+
1023
+ **Output:**
1024
+ ```json
1025
+ {
1026
+ "data": [
1027
+ {
1028
+ "id": "26be666e-7503-40d7-9293-8ffbcdc04dd2",
1029
+ "content": "Meeting notes: Q4 planning",
1030
+ "memoryType": "episodic",
1031
+ "importance": 0.8,
1032
+ "topics": ["meetings", "planning"],
1033
+ "createdAt": "2024-01-15T10:30:00Z"
1034
+ }
1035
+ ],
1036
+ "pagination": {
1037
+ "page": 0,
1038
+ "limit": 20,
1039
+ "total": 1
1040
+ }
1041
+ }
1042
+ ```
1043
+
1044
+ **Best for:**
1045
+ - Scripting and automation
1046
+ - Piping to tools like `jq`
1047
+ - Integration with other systems
1048
+ - Programmatic processing
1049
+
1050
+ **Note:** Progress spinners are automatically disabled in JSON mode to prevent interference with output parsing.
1051
+
1052
+ ### YAML Format
1053
+
1054
+ Human-readable structured data output.
1055
+
1056
+ **Example:**
1057
+ ```bash
1058
+ mx memories list --format yaml
1059
+ ```
1060
+
1061
+ **Output:**
1062
+ ```yaml
1063
+ data:
1064
+ - id: 26be666e-7503-40d7-9293-8ffbcdc04dd2
1065
+ content: Meeting notes: Q4 planning
1066
+ memoryType: episodic
1067
+ importance: 0.8
1068
+ topics:
1069
+ - meetings
1070
+ - planning
1071
+ createdAt: 2024-01-15T10:30:00Z
1072
+ pagination:
1073
+ page: 0
1074
+ limit: 20
1075
+ total: 1
1076
+ ```
1077
+
1078
+ **Best for:**
1079
+ - Configuration files
1080
+ - Human-readable structured data
1081
+ - Documentation
1082
+ - Debugging
1083
+
1084
+ ---
1085
+
1086
+ ## Best Practices
1087
+
1088
+ ### Authentication
1089
+
1090
+ **✅ Do:**
1091
+ - Use interactive mode for login: `mx auth login --interactive`
1092
+ - Store API keys in environment variables for CI/CD
1093
+ - Verify authentication before operations: `mx auth status`
1094
+ - Use separate API keys for different environments
1095
+
1096
+ **❌ Don't:**
1097
+ - Commit API keys to version control
1098
+ - Share API keys in plain text
1099
+ - Use production keys in development
1100
+
1101
+ ### Creating Resources
1102
+
1103
+ **✅ Do:**
1104
+ - Use interactive mode for complex resources: `mx memories create --interactive`
1105
+ - Validate JSON before passing to `--data` or `--metadata` options
1106
+ - Use meaningful labels and descriptions
1107
+ - Set appropriate importance scores (0-1)
1108
+
1109
+ **❌ Don't:**
1110
+ - Skip validation by forcing operations without review
1111
+ - Use generic or unclear content
1112
+ - Set all importance scores to 1.0
1113
+
1114
+ ### Destructive Operations
1115
+
1116
+ **✅ Do:**
1117
+ - Review confirmation prompts carefully
1118
+ - Use `--force` only in scripts and automation
1119
+ - Test delete operations on non-critical data first
1120
+ - Keep backups of important data
1121
+
1122
+ **❌ Don't:**
1123
+ - Use `--force` flag casually
1124
+ - Delete resources without verification
1125
+ - Merge topics/communities without understanding impact
1126
+
1127
+ ### Scripting and Automation
1128
+
1129
+ **✅ Do:**
1130
+ - Use JSON format for parsing: `--format json`
1131
+ - Pipe JSON to `jq` for filtering and transformation
1132
+ - Check exit codes in scripts
1133
+ - Use `--force` to skip interactive prompts
1134
+ - Set environment variables for configuration
1135
+
1136
+ **Example:**
1137
+ ```bash
1138
+ #!/bin/bash
1139
+ set -e # Exit on error
1140
+
1141
+ # Export memories to file
1142
+ mx memories list --format json --limit 1000 > memories_backup.json
1143
+
1144
+ # Find high-importance memories
1145
+ mx memories list --format json | \
1146
+ jq '.data[] | select(.importance > 0.8)' > important_memories.json
1147
+
1148
+ # Check if operation succeeded
1149
+ if [ $? -eq 0 ]; then
1150
+ echo "Backup completed successfully"
1151
+ else
1152
+ echo "Backup failed"
1153
+ exit 1
1154
+ fi
1155
+ ```
1156
+
1157
+ **❌ Don't:**
1158
+ - Parse table format output in scripts
1159
+ - Ignore error codes
1160
+ - Hard-code credentials in scripts
1161
+
1162
+ ### Performance
1163
+
1164
+ **✅ Do:**
1165
+ - Use pagination for large datasets
1166
+ - Adjust `--limit` based on your needs
1167
+ - Use specific search queries instead of listing all
1168
+ - Filter results with `jq` when using JSON format
1169
+
1170
+ **Example:**
1171
+ ```bash
1172
+ # Efficient: Search with limit
1173
+ mx memories search --query "Q4" --limit 10
1174
+
1175
+ # Efficient: Paginate large results
1176
+ mx memories list --page 0 --limit 50
1177
+ mx memories list --page 1 --limit 50
1178
+ ```
1179
+
1180
+ **❌ Don't:**
1181
+ - Request all data at once without pagination
1182
+ - Use very large `--limit` values unnecessarily
1183
+ - List all resources when you need specific ones
1184
+
1185
+ ### Error Handling
1186
+
1187
+ **✅ Do:**
1188
+ - Read error messages carefully - they include troubleshooting steps
1189
+ - Check authentication status when getting 401 errors
1190
+ - Verify API URL configuration for connection errors
1191
+ - Use `mx system health` to check API availability
1192
+
1193
+ **Example Error Message:**
1194
+ ```
1195
+ ❌ Authentication Error: Invalid or missing API key
1196
+
1197
+ 💡 To fix this:
1198
+ 1. Check auth status: mx auth status
1199
+ 2. Login with your API key: mx auth login --api-key <your-key>
1200
+ 3. Or use interactive mode: mx auth login --interactive
1201
+ ```
1202
+
1203
+ **❌ Don't:**
1204
+ - Ignore error messages
1205
+ - Retry failed operations without addressing the root cause
1206
+ - Skip authentication verification
1207
+
1208
+ ### Output Format Selection
1209
+
1210
+ **Use `table` format when:**
1211
+ - Working interactively in terminal
1212
+ - Quickly reviewing data
1213
+ - Presenting to humans
1214
+
1215
+ **Use `json` format when:**
1216
+ - Scripting and automation
1217
+ - Piping to other tools
1218
+ - Programmatic processing
1219
+ - Storing data for later use
1220
+
1221
+ **Use `yaml` format when:**
1222
+ - Creating configuration files
1223
+ - Debugging complex structures
1224
+ - Documentation purposes
1225
+ - Human-readable exports
1226
+
1227
+ ### Topic and Community Management
1228
+
1229
+ **✅ Do:**
1230
+ - Use `discover-related` to explore topic connections
1231
+ - Set appropriate similarity thresholds (0.7-0.9)
1232
+ - Review merge operations carefully
1233
+ - Use clustering to organize large topic sets
1234
+
1235
+ **❌ Don't:**
1236
+ - Merge topics without understanding relationships
1237
+ - Use very low similarity thresholds (<0.5)
1238
+ - Delete communities without reviewing members
1239
+
1240
+ ### GraphRAG Queries
1241
+
1242
+ **✅ Do:**
1243
+ - Use specific, focused queries
1244
+ - Leverage community queries for broad topics
1245
+ - Use `explain` to understand memory context
1246
+ - Combine with regular search for comprehensive results
1247
+
1248
+ **Example:**
1249
+ ```bash
1250
+ # Specific query
1251
+ mx graphrag query --query "What technical decisions were made in Q4?"
1252
+
1253
+ # Community-based query
1254
+ mx graphrag query-communities --query "project planning" --limit 5
1255
+
1256
+ # Explain specific memory
1257
+ mx graphrag explain --memory-id mem_abc123
1258
+ ```
1259
+
1260
+ **❌ Don't:**
1261
+ - Use overly broad queries
1262
+ - Expect instant results for complex queries
1263
+ - Ignore regular search capabilities
1264
+
1265
+ ---
1266
+
1267
+ ## Troubleshooting
1268
+
1269
+ ### Common Issues
1270
+
1271
+ **Issue: "Authentication Error: Invalid or missing API key"**
1272
+
1273
+ **Solution:**
1274
+ ```bash
1275
+ # Check current auth status
1276
+ mx auth status
1277
+
1278
+ # Login with API key
1279
+ mx auth login --interactive
1280
+ ```
1281
+
1282
+ **Issue: "Connection refused" or "Network error"**
1283
+
1284
+ **Solution:**
1285
+ ```bash
1286
+ # Check API URL configuration
1287
+ mx config get apiUrl
1288
+
1289
+ # Set correct API URL
1290
+ mx config set apiUrl https://api.memnexus.io
1291
+
1292
+ # Check system health
1293
+ mx system health
1294
+ ```
1295
+
1296
+ **Issue: "Validation error" when creating resources**
1297
+
1298
+ **Solution:**
1299
+ - Use interactive mode for guided input: `mx memories create --interactive`
1300
+ - Check that JSON strings are properly formatted
1301
+ - Verify confidence scores are between 0 and 1
1302
+ - Ensure required fields are provided
1303
+
1304
+ **Issue: "Rate limit exceeded"**
1305
+
1306
+ **Solution:**
1307
+ - Wait before retrying (check error message for retry-after time)
1308
+ - Reduce request frequency
1309
+ - Use pagination with smaller page sizes
1310
+ - Contact API administrator for rate limit increase
1311
+
1312
+ ### Getting Help
1313
+
1314
+ ```bash
1315
+ # General help
1316
+ mx --help
1317
+
1318
+ # Command-specific help
1319
+ mx memories --help
1320
+ mx facts create --help
1321
+ mx topics cluster --help
1322
+
1323
+ # Check version
1324
+ mx --version
1325
+
1326
+ # System status
1327
+ mx system health
1328
+ mx system status
1329
+ ```
1330
+
1331
+ ---
1332
+
1333
+ ## Environment Variables Reference
1334
+
1335
+ | Variable | Description | Default | Example |
1336
+ |----------|-------------|---------|---------|
1337
+ | `MX_API_URL` | MemNexus API base URL | `https://api.memnexus.io` | `https://api.memnexus.io` |
1338
+ | `MX_API_KEY` | API authentication key | - | `cmk_live_abc123.xyz789` |
1339
+ | `MX_OUTPUT_FORMAT` | Default output format | `table` | `json`, `table`, `yaml` |
1340
+ | `MX_DEFAULT_PAGE_SIZE` | Default pagination size | `20` | `50`, `100` |
1341
+
1342
+ **Setting Environment Variables:**
1343
+
1344
+ ```bash
1345
+ # Linux/macOS
1346
+ export MX_API_URL="https://api.memnexus.io"
1347
+ export MX_API_KEY="cmk_live_abc123.xyz789"
1348
+ export MX_OUTPUT_FORMAT="json"
1349
+
1350
+ # Windows (PowerShell)
1351
+ $env:MX_API_URL="https://api.memnexus.io"
1352
+ $env:MX_API_KEY="cmk_live_abc123.xyz789"
1353
+ $env:MX_OUTPUT_FORMAT="json"
1354
+
1355
+ # Windows (CMD)
1356
+ set MX_API_URL=https://api.memnexus.io
1357
+ set MX_API_KEY=cmk_live_abc123.xyz789
1358
+ set MX_OUTPUT_FORMAT=json
1359
+ ```
1360
+
1361
+ ---
1362
+
1363
+ ## Additional Resources
1364
+
1365
+ - **README**: Quick start and installation guide
1366
+ - **GitHub Repository**: https://github.com/memnexus-ai/mx-cli
1367
+ - **API Documentation**: https://docs.memnexus.io
1368
+ - **Issue Tracker**: https://github.com/memnexus-ai/mx-cli/issues
1369
+
1370
+ ---
1371
+
1372
+ *Last updated: 2024-11-14*
1373
+