@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
@@ -0,0 +1,243 @@
1
+ # Platform Testing Report
2
+
3
+ This document tracks testing results across different platforms and Node.js versions.
4
+
5
+ ## Supported Platforms
6
+
7
+ The mx-cli is designed to work on:
8
+ - **Linux** (Ubuntu, Debian, Fedora, etc.)
9
+ - **macOS** (10.15+)
10
+ - **Windows** (10/11 with PowerShell or CMD)
11
+
12
+ ## Supported Node.js Versions
13
+
14
+ - **Node.js 18.x** (LTS)
15
+ - **Node.js 20.x** (LTS) - Recommended
16
+ - **Node.js 22.x** (Current)
17
+
18
+ ## Testing Matrix
19
+
20
+ ### Linux
21
+
22
+ | Distribution | Node Version | Status | Test Results | Notes |
23
+ |--------------|--------------|--------|--------------|-------|
24
+ | Ubuntu 22.04 (WSL2) | 24.11.0 | ✅ Passed | 128/128 tests passed | All features working |
25
+ | Ubuntu 20.04 | 20.x | ⏳ Pending | - | - |
26
+ | Debian 11 | 18.x | ⏳ Pending | - | - |
27
+
28
+ **Tested Features:**
29
+ - ✅ Installation via `npm link`
30
+ - ✅ All 128 tests passing
31
+ - ✅ Interactive prompts with inquirer
32
+ - ✅ Progress spinners with ora
33
+ - ✅ Colored output with chalk
34
+ - ✅ Table formatting with cli-table3
35
+ - ✅ JSON/YAML output formats
36
+ - ✅ File system operations (config storage)
37
+ - ✅ Environment variable handling
38
+
39
+ **Known Issues:**
40
+ - None
41
+
42
+ ### macOS
43
+
44
+ | Version | Node Version | Status | Test Results | Notes |
45
+ |---------|--------------|--------|--------------|-------|
46
+ | macOS 14 (Sonoma) | 20.x | ⏳ Pending | - | - |
47
+ | macOS 13 (Ventura) | 20.x | ⏳ Pending | - | - |
48
+ | macOS 12 (Monterey) | 18.x | ⏳ Pending | - | - |
49
+
50
+ **Expected Compatibility:**
51
+ - All features should work identically to Linux
52
+ - Terminal colors and spinners supported in Terminal.app and iTerm2
53
+ - Config file location: `~/.mx-cli/config.json`
54
+
55
+ **Potential Issues:**
56
+ - None anticipated (POSIX-compliant like Linux)
57
+
58
+ ### Windows
59
+
60
+ | Version | Node Version | Status | Test Results | Notes |
61
+ |---------|--------------|--------|--------------|-------|
62
+ | Windows 11 | 20.x | ⏳ Pending | - | PowerShell |
63
+ | Windows 11 | 20.x | ⏳ Pending | - | CMD |
64
+ | Windows 10 | 20.x | ⏳ Pending | - | PowerShell |
65
+
66
+ **Expected Compatibility:**
67
+ - All features should work with minor differences
68
+ - Terminal colors supported in Windows Terminal and PowerShell
69
+ - Config file location: `%USERPROFILE%\.mx-cli\config.json`
70
+
71
+ **Potential Issues:**
72
+ - Path separators (handled by Node.js `path` module)
73
+ - Line endings (CRLF vs LF) - should be transparent
74
+ - Terminal color support in older CMD.exe (may need Windows Terminal)
75
+
76
+ ## Testing Checklist
77
+
78
+ When testing on a new platform, verify the following:
79
+
80
+ ### Installation
81
+ - [ ] `npm install -g @memnexus-ai/cli` succeeds
82
+ - [ ] `mx --version` displays version
83
+ - [ ] `mx --help` displays help text
84
+
85
+ ### Authentication
86
+ - [ ] `mx auth login --interactive` prompts for API key
87
+ - [ ] Password masking works (API key hidden during input)
88
+ - [ ] `mx auth status` shows configuration
89
+ - [ ] Config file created at correct location
90
+
91
+ ### Memory Operations
92
+ - [ ] `mx memories create --interactive` prompts work
93
+ - [ ] `mx memories list` displays table correctly
94
+ - [ ] `mx memories list --format json` outputs valid JSON
95
+ - [ ] `mx memories list --format yaml` outputs valid YAML
96
+ - [ ] Spinners display during operations
97
+ - [ ] Colors display correctly
98
+
99
+ ### Fact Operations
100
+ - [ ] `mx facts create --interactive` prompts work
101
+ - [ ] `mx facts list` displays correctly
102
+ - [ ] Confirmation prompts work for delete
103
+
104
+ ### Advanced Commands
105
+ - [ ] `mx topics list` works
106
+ - [ ] `mx graphrag query --query "test"` works
107
+ - [ ] `mx system health` works
108
+
109
+ ### Error Handling
110
+ - [ ] Invalid API key shows helpful error message
111
+ - [ ] Network errors show troubleshooting steps
112
+ - [ ] Validation errors show clear messages
113
+
114
+ ### Output Formats
115
+ - [ ] Table format displays correctly in terminal
116
+ - [ ] JSON format is valid and parseable
117
+ - [ ] YAML format is valid and parseable
118
+ - [ ] Spinners disabled in JSON mode
119
+
120
+ ### Interactive Features
121
+ - [ ] Arrow keys work in prompts
122
+ - [ ] Tab completion works (if applicable)
123
+ - [ ] Ctrl+C cancels operations gracefully
124
+
125
+ ## Test Execution
126
+
127
+ ### Running Tests
128
+
129
+ ```bash
130
+ # Install dependencies
131
+ npm install
132
+
133
+ # Run all tests
134
+ npm test
135
+
136
+ # Run tests with coverage
137
+ npm test -- --coverage
138
+
139
+ # Run specific test file
140
+ npm test -- tests/commands/memories.test.ts
141
+ ```
142
+
143
+ ### Manual Testing
144
+
145
+ ```bash
146
+ # Build and link
147
+ npm run build
148
+ npm link
149
+
150
+ # Test authentication
151
+ mx auth login --interactive
152
+ mx auth status
153
+
154
+ # Test memory creation
155
+ mx memories create --interactive
156
+
157
+ # Test different output formats
158
+ mx memories list --format table
159
+ mx memories list --format json
160
+ mx memories list --format yaml
161
+
162
+ # Test error handling
163
+ mx memories list # Without auth (should show helpful error)
164
+ ```
165
+
166
+ ## Platform-Specific Notes
167
+
168
+ ### Linux
169
+ - **Terminal Emulators**: Tested with standard terminal, should work with all modern terminals
170
+ - **Shell**: Works with bash, zsh, fish
171
+ - **Permissions**: No special permissions required
172
+ - **Dependencies**: All dependencies are pure JavaScript (no native modules)
173
+
174
+ ### macOS
175
+ - **Terminal Emulators**: Should work with Terminal.app, iTerm2, Hyper, etc.
176
+ - **Shell**: Works with bash, zsh (default on macOS 10.15+)
177
+ - **Permissions**: No special permissions required
178
+ - **M1/M2 Chips**: No native dependencies, should work on both Intel and Apple Silicon
179
+
180
+ ### Windows
181
+ - **Terminal Emulators**:
182
+ - ✅ Windows Terminal (recommended)
183
+ - ✅ PowerShell 7+
184
+ - ⚠️ PowerShell 5.1 (colors may be limited)
185
+ - ⚠️ CMD.exe (colors may be limited)
186
+ - **Shell**: PowerShell recommended, CMD supported
187
+ - **Permissions**: No admin rights required
188
+ - **Path**: Ensure npm global bin directory is in PATH
189
+
190
+ ## CI/CD Testing
191
+
192
+ The GitHub Actions workflow tests on:
193
+ - **ubuntu-latest** (Linux)
194
+ - Node.js 20.x
195
+
196
+ Future enhancements could add:
197
+ - macOS runner: `macos-latest`
198
+ - Windows runner: `windows-latest`
199
+ - Multiple Node.js versions: 18.x, 20.x, 22.x
200
+
201
+ ## Reporting Issues
202
+
203
+ If you encounter platform-specific issues:
204
+
205
+ 1. **Check Node.js version**: `node --version` (must be 18+)
206
+ 2. **Check npm version**: `npm --version`
207
+ 3. **Check terminal**: Try Windows Terminal on Windows
208
+ 4. **Run tests**: `npm test` to verify installation
209
+ 5. **Report issue**: Include platform, Node version, terminal, and error message
210
+
211
+ ## Test Results Summary
212
+
213
+ | Platform | Status | Tests Passed | Last Tested | Tester |
214
+ |----------|--------|--------------|-------------|--------|
215
+ | Linux (Ubuntu 22.04 WSL2) | ✅ Passed | 128/128 | 2024-11-14 | Automated |
216
+ | macOS | ⏳ Pending | - | - | - |
217
+ | Windows | ⏳ Pending | - | - |
218
+
219
+ ## Conclusion
220
+
221
+ **Current Status:**
222
+ - ✅ Linux: Fully tested and working (128/128 tests passed)
223
+ - ⏳ macOS: Expected to work (POSIX-compliant, no platform-specific code)
224
+ - ⏳ Windows: Expected to work (no native dependencies, path handling via Node.js)
225
+
226
+ **Confidence Level:**
227
+ - **High** for Linux (tested)
228
+ - **High** for macOS (similar to Linux, no platform-specific code)
229
+ - **Medium-High** for Windows (no native deps, but terminal differences possible)
230
+
231
+ **Recommendation:**
232
+ The CLI is ready for release with Linux support confirmed. macOS and Windows testing should be performed by early adopters or in CI/CD before v1.0.0 final release.
233
+
234
+ **Next Steps:**
235
+ 1. Add macOS and Windows runners to GitHub Actions
236
+ 2. Test on real macOS and Windows machines
237
+ 3. Document any platform-specific issues discovered
238
+ 4. Update this document with results
239
+
240
+ ---
241
+
242
+ *Last updated: 2024-11-14*
243
+