@memnexus-ai/cli 0.1.1 β†’ 0.1.4

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 (62) hide show
  1. package/README.md +986 -986
  2. package/bin/mx.js +1 -1
  3. package/package.json +74 -67
  4. package/.env.example +0 -13
  5. package/.eslintrc.js +0 -24
  6. package/.github/ISSUE_TEMPLATE/phase-1-foundation.md +0 -1078
  7. package/.github/workflows/publish.yml +0 -277
  8. package/.github/workflows/test-app-token.yml +0 -54
  9. package/.npmrc.backup +0 -3
  10. package/.npmrc.example +0 -6
  11. package/.prettierignore +0 -4
  12. package/.prettierrc +0 -8
  13. package/PLATFORM_TESTING.md +0 -243
  14. package/RELEASE.md +0 -428
  15. package/RELEASE_READINESS.md +0 -253
  16. package/docs/README.md +0 -219
  17. package/docs/code-generation-strategy.md +0 -560
  18. package/docs/prd.md +0 -748
  19. package/docs/sync-strategy.md +0 -533
  20. package/jest.config.js +0 -30
  21. package/scripts/install-deps.sh +0 -38
  22. package/src/commands/apikeys.ts +0 -144
  23. package/src/commands/artifacts.ts +0 -296
  24. package/src/commands/auth.ts +0 -122
  25. package/src/commands/communities.ts +0 -153
  26. package/src/commands/config.ts +0 -144
  27. package/src/commands/conversations.ts +0 -176
  28. package/src/commands/facts.ts +0 -320
  29. package/src/commands/graphrag.ts +0 -149
  30. package/src/commands/memories.ts +0 -332
  31. package/src/commands/patterns.ts +0 -251
  32. package/src/commands/system.ts +0 -102
  33. package/src/commands/topics.ts +0 -354
  34. package/src/index.ts +0 -43
  35. package/src/lib/api-client.ts +0 -68
  36. package/src/lib/auth.ts +0 -42
  37. package/src/lib/config.ts +0 -68
  38. package/src/lib/errors.ts +0 -143
  39. package/src/lib/formatters.ts +0 -123
  40. package/src/lib/spinner.ts +0 -113
  41. package/src/lib/validators.ts +0 -302
  42. package/src/types/index.ts +0 -17
  43. package/tests/__mocks__/chalk.ts +0 -16
  44. package/tests/__mocks__/cli-table3.ts +0 -37
  45. package/tests/__mocks__/configstore.ts +0 -38
  46. package/tests/commands/apikeys.test.ts +0 -179
  47. package/tests/commands/artifacts.test.ts +0 -194
  48. package/tests/commands/auth.test.ts +0 -120
  49. package/tests/commands/communities.test.ts +0 -154
  50. package/tests/commands/config.test.ts +0 -154
  51. package/tests/commands/conversations.test.ts +0 -136
  52. package/tests/commands/facts.test.ts +0 -210
  53. package/tests/commands/graphrag.test.ts +0 -194
  54. package/tests/commands/memories.test.ts +0 -215
  55. package/tests/commands/patterns.test.ts +0 -201
  56. package/tests/commands/system.test.ts +0 -172
  57. package/tests/commands/topics.test.ts +0 -274
  58. package/tests/lib/auth.test.ts +0 -77
  59. package/tests/lib/config.test.ts +0 -50
  60. package/tests/lib/errors.test.ts +0 -126
  61. package/tests/lib/formatters.test.ts +0 -87
  62. package/tsconfig.json +0 -20
package/docs/README.md DELETED
@@ -1,219 +0,0 @@
1
- # MemNexus CLI Documentation
2
-
3
- Welcome to the mx-cli documentation! This directory contains comprehensive planning and strategy documents for building and maintaining the CLI.
4
-
5
- ## Core Documents
6
-
7
- ### πŸ“‹ [Product Requirements Document (PRD)](./prd.md)
8
- **Complete specification for the CLI project**
9
-
10
- What's inside:
11
- - Technology stack and dependencies
12
- - Architecture and system design
13
- - All CLI commands and features
14
- - Development roadmap (4-week plan)
15
- - Testing strategy
16
- - Distribution via GitHub Packages
17
-
18
- **Start here** if you want to understand what the CLI does and how it's built.
19
-
20
- ---
21
-
22
- ### πŸ”„ [CLI-API Sync Strategy](./sync-strategy.md)
23
- **How to keep CLI in sync with API changes**
24
-
25
- What's inside:
26
- - OpenAPI as single source of truth
27
- - Automated SDK generation workflow
28
- - Contract testing with Dredd/Prism
29
- - Version management (SemVer)
30
- - CI/CD integration
31
- - Breaking change detection
32
-
33
- **Read this** to understand how type safety and API compatibility is maintained.
34
-
35
- ---
36
-
37
- ### πŸ€– [Code Generation Strategy](./code-generation-strategy.md)
38
- **How CLI commands are created when APIs change**
39
-
40
- What's inside:
41
- - Why full auto-generation doesn't work for CLIs
42
- - Hybrid approach: scaffolding + manual implementation
43
- - Coverage detection to catch missing commands
44
- - Command scaffold generator (future)
45
- - Metadata-driven commands via OpenAPI extensions
46
-
47
- **Read this** to understand why CLI commands are manual in v1.0 and the roadmap for semi-automation.
48
-
49
- ---
50
-
51
- ## Quick Reference
52
-
53
- ### The Three-Layer Architecture
54
-
55
- ```
56
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
57
- β”‚ OpenAPI Specification β”‚ Single source of truth
58
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
59
- β”‚ generates
60
- β–Ό
61
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
62
- β”‚ @memnexus-ai/contracts β”‚ TypeScript SDK
63
- β”‚ - Auto-generated types β”‚ (Auto-sync)
64
- β”‚ - API client methods β”‚
65
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
66
- β”‚ dependency
67
- β–Ό
68
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
69
- β”‚ @memnexus-ai/cli β”‚ CLI tool
70
- β”‚ - Commands (manual) β”‚ (Manual for v1.0)
71
- β”‚ - Business logic β”‚
72
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
73
- ```
74
-
75
- ### What's Automated vs. Manual
76
-
77
- | Aspect | Status | Tool/Process |
78
- |--------|--------|-------------|
79
- | **TypeScript types** | βœ… Automated | `openapi-typescript` |
80
- | **API client methods** | βœ… Automated | `@memnexus-ai/contracts` build |
81
- | **Breaking change detection** | βœ… Automated | `oasdiff` (future) |
82
- | **Dependency updates** | βœ… Automated | Dependabot (future) |
83
- | **Contract testing** | βœ… Automated | Dredd/Prism (future) |
84
- | **CLI command structure** | ❌ Manual | Developer writes code |
85
- | **Business logic** | ❌ Manual | Developer writes code |
86
- | **Help text** | ❌ Manual | Developer writes code |
87
- | **Output formatting** | ❌ Manual | Developer writes code |
88
-
89
- ### Key Decisions
90
-
91
- 1. **TypeScript + Node.js** - Leverage existing codebase and contracts package
92
- 2. **Via API Gateway** - All requests go through Kong (production/staging)
93
- 3. **Exact version pinning** - Pin `@memnexus-ai/contracts` version in v1.0 for stability
94
- 4. **Manual commands for v1.0** - Build scaffolding generator after patterns stabilize
95
- 5. **GitHub Packages** - Primary distribution method
96
-
97
- ### Development Workflow
98
-
99
- **When an API endpoint is added/changed:**
100
-
101
- ```mermaid
102
- graph LR
103
- A[Change API] --> B[Update OpenAPI]
104
- B --> C[Publish contracts]
105
- C --> D[Update CLI dependency]
106
- D --> E[Implement command]
107
- E --> F[Test & publish CLI]
108
- ```
109
-
110
- **Detailed steps**:
111
- 1. Developer changes mx-core-api code
112
- 2. Developer updates OpenAPI spec (`contracts/openapi.yaml`)
113
- 3. Contracts package auto-generates types and publishes
114
- 4. CLI updates `@memnexus-ai/contracts` dependency
115
- 5. **Developer manually implements CLI command** (for v1.0)
116
- 6. CLI is tested and published via GitHub Actions
117
-
118
- ### Phased Automation Plan
119
-
120
- #### Phase 1: Manual (Weeks 1-4) βœ… Current
121
- - Use contracts for types
122
- - Write commands manually
123
- - Establish patterns
124
-
125
- #### Phase 2: Detection (Weeks 5-6) 🎯 Next
126
- - Build coverage checker
127
- - Alert on missing commands
128
- - CI/CD integration
129
-
130
- #### Phase 3: Scaffolding (Month 2) ⏸️ Future
131
- - Build command generator
132
- - Auto-create skeletons
133
- - Developer fills in logic
134
-
135
- #### Phase 4: Metadata-Driven (Month 3+) ⏸️ Future
136
- - OpenAPI extensions for CLI
137
- - Auto-generate help text
138
- - Near-automatic updates
139
-
140
- ## Common Questions
141
-
142
- ### Q: Do types update automatically when the API changes?
143
- **A**: Yes! When `@memnexus-ai/contracts` is updated, you get new TypeScript types automatically.
144
-
145
- ### Q: Do CLI commands update automatically?
146
- **A**: No (for v1.0). Developers must manually implement new commands. However:
147
- - Coverage detection will alert when commands are missing (Phase 2)
148
- - Scaffolding generator will create boilerplate (Phase 3)
149
- - Metadata-driven approach will minimize manual work (Phase 4)
150
-
151
- ### Q: Why not fully auto-generate CLI commands?
152
- **A**:
153
- - No mature tools for TypeScript/Commander.js generation
154
- - Generated code loses flexibility and polish
155
- - Help text, examples, and UX require human touch
156
- - Business logic is unique per endpoint
157
-
158
- See [Code Generation Strategy](./code-generation-strategy.md#evaluated-solutions) for detailed analysis.
159
-
160
- ### Q: How do I know if the CLI is out of sync with the API?
161
- **A**:
162
- - **v1.0**: Manual tracking
163
- - **Phase 2+**: Automated coverage checks in CI/CD
164
- - **Future**: GitHub bot creates PRs when endpoints are added
165
-
166
- ### Q: What happens when there's a breaking API change?
167
- **A**:
168
- 1. `oasdiff` detects breaking change in CI/CD
169
- 2. Contracts package bumps MAJOR version (e.g., 1.0.0 β†’ 2.0.0)
170
- 3. CLI must update code to handle new contract
171
- 4. CLI bumps MAJOR version too
172
- 5. Migration guide documents changes
173
-
174
- See [Sync Strategy - Breaking Changes](./sync-strategy.md#detecting-breaking-changes).
175
-
176
- ### Q: Can I point the CLI directly at mx-core-api instead of the gateway?
177
- **A**: Yes! For local development:
178
- ```bash
179
- export MX_API_URL=http://localhost:3000
180
- mx memories list
181
- ```
182
-
183
- Default is API Gateway (`https://api.memnexus.io` in production).
184
-
185
- ## Next Steps
186
-
187
- ### For Contributors
188
- 1. Read [PRD](./prd.md) to understand the project
189
- 2. Check [Development Plan](./prd.md#development-plan) for current priorities
190
- 3. See [Sync Strategy](./sync-strategy.md) for workflow details
191
-
192
- ### For Maintainers
193
- 1. Implement Phase 2 coverage detection after v1.0
194
- 2. Monitor contracts package updates
195
- 3. Keep documentation in sync with implementation
196
-
197
- ### For Users
198
- - Installation and usage docs will be in `../README.md` (root of mx-cli)
199
- - API reference will be in `../docs/api-reference.md` (future)
200
- - Examples will be in `../examples/` (future)
201
-
202
- ## Document Status
203
-
204
- | Document | Version | Last Updated | Status |
205
- |----------|---------|--------------|--------|
206
- | [prd.md](./prd.md) | 1.0 | 2025-11-13 | βœ… Complete |
207
- | [sync-strategy.md](./sync-strategy.md) | 1.0 | 2025-11-13 | βœ… Complete |
208
- | [code-generation-strategy.md](./code-generation-strategy.md) | 1.0 | 2025-11-13 | βœ… Complete |
209
-
210
- ## Contributing
211
-
212
- Found an issue or have a suggestion? Please:
213
- 1. Open an issue in the GitHub repository
214
- 2. Reference the relevant document
215
- 3. Propose specific changes
216
-
217
- ---
218
-
219
- **Questions?** Open an issue or reach out to the MemNexus team.