@closedloop-ai/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +437 -0
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/docs/CLI_COMMANDS.md +505 -0
- package/package.json +49 -26
- package/packages/cli/dist/api/team.js +45 -0
- package/packages/cli/dist/api/team.js.map +1 -0
- package/{dist → packages/cli/dist}/cli.js +7 -0
- package/packages/cli/dist/cli.js.map +1 -0
- package/packages/cli/dist/commands/team.js +44 -0
- package/packages/cli/dist/commands/team.js.map +1 -0
- package/dist/cli.js.map +0 -1
- package/jest.config.js +0 -14
- package/src/__tests__/cli.test.ts +0 -44
- package/src/__tests__/config.test.ts +0 -38
- package/src/__tests__/errors.test.ts +0 -132
- package/src/__tests__/setup.ts +0 -21
- package/src/__tests__/validation.test.ts +0 -156
- package/src/api/auth.ts +0 -21
- package/src/api/feedback.ts +0 -64
- package/src/api/input.ts +0 -55
- package/src/api/usage.ts +0 -45
- package/src/cli.ts +0 -158
- package/src/commands/config.ts +0 -192
- package/src/commands/feedback.ts +0 -250
- package/src/commands/input.ts +0 -389
- package/src/commands/list.ts +0 -84
- package/src/commands/status.ts +0 -96
- package/src/commands/submit.ts +0 -214
- package/src/config/constants.ts +0 -36
- package/src/config/index.ts +0 -59
- package/src/types/index.ts +0 -119
- package/src/utils/errors.ts +0 -98
- package/src/utils/validation.ts +0 -166
- package/tsconfig.json +0 -25
- /package/{dist → packages/cli/dist}/__tests__/cli.test.js +0 -0
- /package/{dist → packages/cli/dist}/__tests__/cli.test.js.map +0 -0
- /package/{dist → packages/cli/dist}/__tests__/config.test.js +0 -0
- /package/{dist → packages/cli/dist}/__tests__/config.test.js.map +0 -0
- /package/{dist → packages/cli/dist}/__tests__/errors.test.js +0 -0
- /package/{dist → packages/cli/dist}/__tests__/errors.test.js.map +0 -0
- /package/{dist → packages/cli/dist}/__tests__/setup.js +0 -0
- /package/{dist → packages/cli/dist}/__tests__/setup.js.map +0 -0
- /package/{dist → packages/cli/dist}/__tests__/validation.test.js +0 -0
- /package/{dist → packages/cli/dist}/__tests__/validation.test.js.map +0 -0
- /package/{dist → packages/cli/dist}/api/auth.js +0 -0
- /package/{dist → packages/cli/dist}/api/auth.js.map +0 -0
- /package/{dist → packages/cli/dist}/api/feedback.js +0 -0
- /package/{dist → packages/cli/dist}/api/feedback.js.map +0 -0
- /package/{dist → packages/cli/dist}/api/input.js +0 -0
- /package/{dist → packages/cli/dist}/api/input.js.map +0 -0
- /package/{dist → packages/cli/dist}/api/usage.js +0 -0
- /package/{dist → packages/cli/dist}/api/usage.js.map +0 -0
- /package/{dist → packages/cli/dist}/commands/config.js +0 -0
- /package/{dist → packages/cli/dist}/commands/config.js.map +0 -0
- /package/{dist → packages/cli/dist}/commands/feedback.js +0 -0
- /package/{dist → packages/cli/dist}/commands/feedback.js.map +0 -0
- /package/{dist → packages/cli/dist}/commands/input.js +0 -0
- /package/{dist → packages/cli/dist}/commands/input.js.map +0 -0
- /package/{dist → packages/cli/dist}/commands/list.js +0 -0
- /package/{dist → packages/cli/dist}/commands/list.js.map +0 -0
- /package/{dist → packages/cli/dist}/commands/status.js +0 -0
- /package/{dist → packages/cli/dist}/commands/status.js.map +0 -0
- /package/{dist → packages/cli/dist}/commands/submit.js +0 -0
- /package/{dist → packages/cli/dist}/commands/submit.js.map +0 -0
- /package/{dist → packages/cli/dist}/commands/usage.js +0 -0
- /package/{dist → packages/cli/dist}/commands/usage.js.map +0 -0
- /package/{dist → packages/cli/dist}/config/constants.js +0 -0
- /package/{dist → packages/cli/dist}/config/constants.js.map +0 -0
- /package/{dist → packages/cli/dist}/config/index.js +0 -0
- /package/{dist → packages/cli/dist}/config/index.js.map +0 -0
- /package/{dist → packages/cli/dist}/types/index.js +0 -0
- /package/{dist → packages/cli/dist}/types/index.js.map +0 -0
- /package/{dist → packages/cli/dist}/utils/config.js +0 -0
- /package/{dist → packages/cli/dist}/utils/config.js.map +0 -0
- /package/{dist → packages/cli/dist}/utils/errors.js +0 -0
- /package/{dist → packages/cli/dist}/utils/errors.js.map +0 -0
- /package/{dist → packages/cli/dist}/utils/validation.js +0 -0
- /package/{dist → packages/cli/dist}/utils/validation.js.map +0 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
# Contributing to ClosedLoop AI CLI
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to the ClosedLoop AI CLI! We welcome contributions from the community and are grateful for your help in making this project better.
|
|
4
|
+
|
|
5
|
+
## 🚀 Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
Before you begin, make sure you have the following installed:
|
|
10
|
+
|
|
11
|
+
- **Node.js** 16.0.0 or higher
|
|
12
|
+
- **npm** 8.0.0 or higher (or yarn/pnpm)
|
|
13
|
+
- **Git** 2.0.0 or higher
|
|
14
|
+
- **TypeScript** 5.0.0 or higher
|
|
15
|
+
|
|
16
|
+
### Development Setup
|
|
17
|
+
|
|
18
|
+
1. **Fork the repository**
|
|
19
|
+
```bash
|
|
20
|
+
# Click the "Fork" button on GitHub, then clone your fork
|
|
21
|
+
git clone https://github.com/YOUR_USERNAME/closedloop-cli.git
|
|
22
|
+
cd closedloop-cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. **Add upstream remote**
|
|
26
|
+
```bash
|
|
27
|
+
git remote add upstream https://github.com/closed-loop-ai/closedloop-cli.git
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. **Install dependencies**
|
|
31
|
+
```bash
|
|
32
|
+
npm install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
4. **Build the project**
|
|
36
|
+
```bash
|
|
37
|
+
npm run build
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
5. **Run tests**
|
|
41
|
+
```bash
|
|
42
|
+
npm test
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
6. **Run linting**
|
|
46
|
+
```bash
|
|
47
|
+
npm run lint
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 🏗️ Project Structure
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
closedloop-cli/
|
|
54
|
+
├── packages/
|
|
55
|
+
│ ├── core/ # TypeScript client library
|
|
56
|
+
│ │ ├── src/ # Source code
|
|
57
|
+
│ │ ├── dist/ # Compiled output
|
|
58
|
+
│ │ └── tests/ # Unit tests
|
|
59
|
+
│ ├── cli/ # CLI tool
|
|
60
|
+
│ │ ├── src/ # Source code
|
|
61
|
+
│ │ ├── dist/ # Compiled output
|
|
62
|
+
│ │ └── __tests__/ # Unit tests
|
|
63
|
+
│ └── examples/ # Usage examples
|
|
64
|
+
├── docs/ # Documentation
|
|
65
|
+
├── tests/ # Integration tests
|
|
66
|
+
└── .github/ # GitHub workflows and templates
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 🔄 Development Workflow
|
|
70
|
+
|
|
71
|
+
### 1. Create a Feature Branch
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Make sure you're on main and up to date
|
|
75
|
+
git checkout main
|
|
76
|
+
git pull upstream main
|
|
77
|
+
|
|
78
|
+
# Create a new branch for your feature
|
|
79
|
+
git checkout -b feature/your-feature-name
|
|
80
|
+
|
|
81
|
+
# Or for bug fixes
|
|
82
|
+
git checkout -b fix/your-bug-description
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 2. Make Your Changes
|
|
86
|
+
|
|
87
|
+
- Write clean, readable code
|
|
88
|
+
- Follow the existing code style
|
|
89
|
+
- Add tests for new functionality
|
|
90
|
+
- Update documentation as needed
|
|
91
|
+
- Ensure all tests pass
|
|
92
|
+
|
|
93
|
+
### 3. Test Your Changes
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Run all tests
|
|
97
|
+
npm test
|
|
98
|
+
|
|
99
|
+
# Run tests with coverage
|
|
100
|
+
npm run test:coverage
|
|
101
|
+
|
|
102
|
+
# Run linting
|
|
103
|
+
npm run lint
|
|
104
|
+
|
|
105
|
+
# Build the project
|
|
106
|
+
npm run build
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 4. Commit Your Changes
|
|
110
|
+
|
|
111
|
+
We use conventional commits. Please format your commit messages as follows:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
type(scope): description
|
|
115
|
+
|
|
116
|
+
[optional body]
|
|
117
|
+
|
|
118
|
+
[optional footer]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Types:**
|
|
122
|
+
- `feat`: New feature
|
|
123
|
+
- `fix`: Bug fix
|
|
124
|
+
- `docs`: Documentation changes
|
|
125
|
+
- `style`: Code style changes (formatting, etc.)
|
|
126
|
+
- `refactor`: Code refactoring
|
|
127
|
+
- `test`: Adding or updating tests
|
|
128
|
+
- `chore`: Maintenance tasks
|
|
129
|
+
|
|
130
|
+
**Examples:**
|
|
131
|
+
```bash
|
|
132
|
+
git commit -m "feat(cli): add --wait flag for input processing"
|
|
133
|
+
git commit -m "fix(api): handle 401 errors gracefully"
|
|
134
|
+
git commit -m "docs: update installation instructions"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 5. Push and Create Pull Request
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Push your branch
|
|
141
|
+
git push origin feature/your-feature-name
|
|
142
|
+
|
|
143
|
+
# Create a pull request on GitHub
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## 📝 Code Standards
|
|
147
|
+
|
|
148
|
+
### TypeScript Guidelines
|
|
149
|
+
|
|
150
|
+
- Use TypeScript for all new code
|
|
151
|
+
- Provide proper type definitions
|
|
152
|
+
- Use interfaces for object shapes
|
|
153
|
+
- Prefer `const` over `let` when possible
|
|
154
|
+
- Use meaningful variable and function names
|
|
155
|
+
|
|
156
|
+
### Code Style
|
|
157
|
+
|
|
158
|
+
- Use 2 spaces for indentation
|
|
159
|
+
- Use single quotes for strings
|
|
160
|
+
- Use semicolons
|
|
161
|
+
- Use trailing commas in objects and arrays
|
|
162
|
+
- Use camelCase for variables and functions
|
|
163
|
+
- Use PascalCase for classes and interfaces
|
|
164
|
+
|
|
165
|
+
### Example:
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
interface UserConfig {
|
|
169
|
+
apiKey: string;
|
|
170
|
+
baseUrl?: string;
|
|
171
|
+
timeout?: number;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
class ClosedLoopClient {
|
|
175
|
+
private config: UserConfig;
|
|
176
|
+
|
|
177
|
+
constructor(config: UserConfig) {
|
|
178
|
+
this.config = config;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
async submitFeedback(data: FeedbackData): Promise<SubmissionResult> {
|
|
182
|
+
// Implementation
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## 🧪 Testing Guidelines
|
|
188
|
+
|
|
189
|
+
### Unit Tests
|
|
190
|
+
|
|
191
|
+
- Write tests for all new functionality
|
|
192
|
+
- Aim for high test coverage (>90%)
|
|
193
|
+
- Use descriptive test names
|
|
194
|
+
- Test both success and error cases
|
|
195
|
+
- Mock external dependencies
|
|
196
|
+
|
|
197
|
+
### Test Structure
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
describe('FeedbackService', () => {
|
|
201
|
+
describe('submitFeedback', () => {
|
|
202
|
+
it('should submit feedback successfully', async () => {
|
|
203
|
+
// Arrange
|
|
204
|
+
const mockData = { content: 'Test feedback' };
|
|
205
|
+
const expectedResult = { id: '123', status: 'submitted' };
|
|
206
|
+
|
|
207
|
+
// Act
|
|
208
|
+
const result = await feedbackService.submitFeedback(mockData);
|
|
209
|
+
|
|
210
|
+
// Assert
|
|
211
|
+
expect(result).toEqual(expectedResult);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it('should handle API errors gracefully', async () => {
|
|
215
|
+
// Test error handling
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Integration Tests
|
|
222
|
+
|
|
223
|
+
- Test the CLI commands end-to-end
|
|
224
|
+
- Test API integration
|
|
225
|
+
- Test error scenarios
|
|
226
|
+
- Test configuration handling
|
|
227
|
+
|
|
228
|
+
## 📚 Documentation Guidelines
|
|
229
|
+
|
|
230
|
+
### Code Documentation
|
|
231
|
+
|
|
232
|
+
- Add JSDoc comments for public APIs
|
|
233
|
+
- Include parameter descriptions
|
|
234
|
+
- Include return value descriptions
|
|
235
|
+
- Include usage examples
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
/**
|
|
239
|
+
* Submit customer feedback for AI analysis
|
|
240
|
+
* @param data - The feedback data to submit
|
|
241
|
+
* @param options - Optional configuration
|
|
242
|
+
* @returns Promise resolving to submission result
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const result = await client.feedback.create({
|
|
246
|
+
* content: "The dashboard is confusing",
|
|
247
|
+
* title: "UX Issue"
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
async create(data: FeedbackData, options?: CreateOptions): Promise<SubmissionResult> {
|
|
252
|
+
// Implementation
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### README Updates
|
|
257
|
+
|
|
258
|
+
- Update README.md for new features
|
|
259
|
+
- Add examples for new functionality
|
|
260
|
+
- Update installation instructions if needed
|
|
261
|
+
- Update CLI command documentation
|
|
262
|
+
|
|
263
|
+
## 🐛 Bug Reports
|
|
264
|
+
|
|
265
|
+
When reporting bugs, please include:
|
|
266
|
+
|
|
267
|
+
1. **Clear description** of the issue
|
|
268
|
+
2. **Steps to reproduce** the problem
|
|
269
|
+
3. **Expected behavior** vs actual behavior
|
|
270
|
+
4. **Environment details** (OS, Node.js version, etc.)
|
|
271
|
+
5. **Error messages** or logs
|
|
272
|
+
6. **Screenshots** if applicable
|
|
273
|
+
|
|
274
|
+
### Bug Report Template
|
|
275
|
+
|
|
276
|
+
```markdown
|
|
277
|
+
## Bug Description
|
|
278
|
+
Brief description of the bug
|
|
279
|
+
|
|
280
|
+
## Steps to Reproduce
|
|
281
|
+
1. Run command `cl input "test"`
|
|
282
|
+
2. See error
|
|
283
|
+
|
|
284
|
+
## Expected Behavior
|
|
285
|
+
What should happen
|
|
286
|
+
|
|
287
|
+
## Actual Behavior
|
|
288
|
+
What actually happens
|
|
289
|
+
|
|
290
|
+
## Environment
|
|
291
|
+
- OS: macOS 13.0
|
|
292
|
+
- Node.js: 18.17.0
|
|
293
|
+
- CLI Version: 0.2.0
|
|
294
|
+
|
|
295
|
+
## Additional Context
|
|
296
|
+
Any other relevant information
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## ✨ Feature Requests
|
|
300
|
+
|
|
301
|
+
When requesting features, please include:
|
|
302
|
+
|
|
303
|
+
1. **Clear description** of the feature
|
|
304
|
+
2. **Use case** and motivation
|
|
305
|
+
3. **Proposed implementation** (if you have ideas)
|
|
306
|
+
4. **Alternatives considered**
|
|
307
|
+
5. **Additional context**
|
|
308
|
+
|
|
309
|
+
## 🔍 Pull Request Guidelines
|
|
310
|
+
|
|
311
|
+
### Before Submitting
|
|
312
|
+
|
|
313
|
+
- [ ] Code follows the project's style guidelines
|
|
314
|
+
- [ ] All tests pass
|
|
315
|
+
- [ ] New tests added for new functionality
|
|
316
|
+
- [ ] Documentation updated
|
|
317
|
+
- [ ] Commit messages follow conventional format
|
|
318
|
+
- [ ] Branch is up to date with main
|
|
319
|
+
|
|
320
|
+
### PR Description
|
|
321
|
+
|
|
322
|
+
Include a clear description of your changes:
|
|
323
|
+
|
|
324
|
+
```markdown
|
|
325
|
+
## Description
|
|
326
|
+
Brief description of what this PR does
|
|
327
|
+
|
|
328
|
+
## Changes
|
|
329
|
+
- Added new CLI command `cl status`
|
|
330
|
+
- Updated error handling for API calls
|
|
331
|
+
- Added tests for new functionality
|
|
332
|
+
|
|
333
|
+
## Testing
|
|
334
|
+
- [ ] Unit tests pass
|
|
335
|
+
- [ ] Integration tests pass
|
|
336
|
+
- [ ] Manual testing completed
|
|
337
|
+
|
|
338
|
+
## Breaking Changes
|
|
339
|
+
- None (or list any breaking changes)
|
|
340
|
+
|
|
341
|
+
## Related Issues
|
|
342
|
+
Fixes #123
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Review Process
|
|
346
|
+
|
|
347
|
+
1. **Automated checks** must pass
|
|
348
|
+
2. **Code review** by maintainers
|
|
349
|
+
3. **Testing** on multiple environments
|
|
350
|
+
4. **Documentation** review
|
|
351
|
+
5. **Approval** and merge
|
|
352
|
+
|
|
353
|
+
## 🏷️ Release Process
|
|
354
|
+
|
|
355
|
+
We follow semantic versioning:
|
|
356
|
+
|
|
357
|
+
- **MAJOR** (1.0.0): Breaking changes
|
|
358
|
+
- **MINOR** (0.1.0): New features (backward compatible)
|
|
359
|
+
- **PATCH** (0.0.1): Bug fixes (backward compatible)
|
|
360
|
+
|
|
361
|
+
### Release Checklist
|
|
362
|
+
|
|
363
|
+
- [ ] All tests pass
|
|
364
|
+
- [ ] Documentation updated
|
|
365
|
+
- [ ] CHANGELOG.md updated
|
|
366
|
+
- [ ] Version bumped in package.json
|
|
367
|
+
- [ ] Release notes prepared
|
|
368
|
+
- [ ] NPM package published
|
|
369
|
+
|
|
370
|
+
## 🤝 Community Guidelines
|
|
371
|
+
|
|
372
|
+
### Code of Conduct
|
|
373
|
+
|
|
374
|
+
- Be respectful and inclusive
|
|
375
|
+
- Welcome newcomers and help them learn
|
|
376
|
+
- Focus on constructive feedback
|
|
377
|
+
- Respect different opinions and approaches
|
|
378
|
+
- Help maintain a positive environment
|
|
379
|
+
|
|
380
|
+
### Getting Help
|
|
381
|
+
|
|
382
|
+
- **GitHub Issues**: For bugs and feature requests
|
|
383
|
+
- **GitHub Discussions**: For questions and general discussion
|
|
384
|
+
- **Email**: support@closedloop.sh for private matters
|
|
385
|
+
|
|
386
|
+
## 📋 Development Commands
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
# Install dependencies
|
|
390
|
+
npm install
|
|
391
|
+
|
|
392
|
+
# Build all packages
|
|
393
|
+
npm run build
|
|
394
|
+
|
|
395
|
+
# Run all tests
|
|
396
|
+
npm test
|
|
397
|
+
|
|
398
|
+
# Run tests with coverage
|
|
399
|
+
npm run test:coverage
|
|
400
|
+
|
|
401
|
+
# Run linting
|
|
402
|
+
npm run lint
|
|
403
|
+
|
|
404
|
+
# Fix linting issues
|
|
405
|
+
npm run lint:fix
|
|
406
|
+
|
|
407
|
+
# Clean build artifacts
|
|
408
|
+
npm run clean
|
|
409
|
+
|
|
410
|
+
# Build specific package
|
|
411
|
+
npm run build:core
|
|
412
|
+
npm run build:cli
|
|
413
|
+
|
|
414
|
+
# Test specific package
|
|
415
|
+
npm run test:core
|
|
416
|
+
npm run test:cli
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
## 🎯 Areas for Contribution
|
|
420
|
+
|
|
421
|
+
We especially welcome contributions in these areas:
|
|
422
|
+
|
|
423
|
+
- **New CLI commands** and features
|
|
424
|
+
- **Improved error handling** and user experience
|
|
425
|
+
- **Additional examples** and documentation
|
|
426
|
+
- **Performance optimizations**
|
|
427
|
+
- **Test coverage improvements**
|
|
428
|
+
- **Cross-platform compatibility**
|
|
429
|
+
- **Integration examples** for popular frameworks
|
|
430
|
+
|
|
431
|
+
## 📞 Contact
|
|
432
|
+
|
|
433
|
+
- **Maintainers**: @closedloop-team
|
|
434
|
+
- **Email**: team@closedloop.sh
|
|
435
|
+
- **GitHub**: [closed-loop-ai/closedloop-cli](https://github.com/closed-loop-ai/closedloop-cli)
|
|
436
|
+
|
|
437
|
+
Thank you for contributing to the ClosedLoop AI CLI! 🎉
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ClosedLoop Labs LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# ClosedLoop AI CLI
|
|
2
|
+
|
|
3
|
+
> Transform scattered customer product feedback into actionable strategic insights with AI-powered analysis
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/%40closedloop-ai%2Fcli)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](http://www.typescriptlang.org/)
|
|
8
|
+
[](https://nodejs.org/)
|
|
9
|
+
|
|
10
|
+
## 🎯 The Problem You're Solving
|
|
11
|
+
|
|
12
|
+
**Product teams are drowning in scattered product feedback** from multiple channels:
|
|
13
|
+
- Support tickets scattered across Zendesk, Intercom, and email
|
|
14
|
+
- Sales and customer success call insights buried in transcripts
|
|
15
|
+
- User surveys and feedback forms in different tools
|
|
16
|
+
- Social media mentions and app store reviews
|
|
17
|
+
- Internal team discussions in Slack
|
|
18
|
+
|
|
19
|
+
**The result?** Critical customer product feedback get lost, patterns go unnoticed, and product decisions are made without data.
|
|
20
|
+
|
|
21
|
+
## ✨ How ClosedLoop AI CLI Solves This
|
|
22
|
+
|
|
23
|
+
**Transform chaos into clarity** with autonomous AI that:
|
|
24
|
+
|
|
25
|
+
- 🔍 **Discovers Hidden Patterns** - AI finds insights humans would miss across all your feedback sources
|
|
26
|
+
- ⚡ **Real-Time Analysis** - Get instant insights as new customer product feedback comes in
|
|
27
|
+
- 📊 **Strategic Intelligence** - Convert customer voice into actionable product decisions
|
|
28
|
+
- 🎯 **Revenue Impact** - Quantify the business value of each customer feedback
|
|
29
|
+
- 🔄 **Source Agnostic** - Works with any data source through flexible APIs
|
|
30
|
+
|
|
31
|
+
## 🚀 Quick Start
|
|
32
|
+
|
|
33
|
+
### Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Install globally for CLI usage
|
|
37
|
+
npm install -g @closedloop-ai/cli
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Get Your API Key
|
|
41
|
+
|
|
42
|
+
1. Visit [https://closedloop.sh](https://closedloop.sh)
|
|
43
|
+
2. Sign up for a free account (100,000 credits every month included!)
|
|
44
|
+
3. Generate your API key
|
|
45
|
+
4. Configure the CLI:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cl config set --api-key your-api-key-here
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Submit Your First Customer Feedback
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Submit raw customer feedback for AI analysis
|
|
55
|
+
cl input "The new dashboard is confusing and hard to navigate. I can't find the settings menu and the layout is cluttered."
|
|
56
|
+
|
|
57
|
+
# Wait for AI to analyze and generate structured insights
|
|
58
|
+
cl input "Customer complaint about performance issues" --wait
|
|
59
|
+
|
|
60
|
+
# View all AI-generated customer product feedback
|
|
61
|
+
cl feedback
|
|
62
|
+
|
|
63
|
+
# Get detailed analysis of a specific insight
|
|
64
|
+
cl feedback 2ea8f556-052b-4f5c-bf86-833780b3d00d
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 🎯 Perfect For
|
|
68
|
+
|
|
69
|
+
### Customer Success Teams
|
|
70
|
+
- **Stop losing critical insights** buried in support tickets
|
|
71
|
+
- **Identify patterns** across customer conversations
|
|
72
|
+
- **Proactive customer success** with early warning signals
|
|
73
|
+
- **Data-driven customer health** scoring
|
|
74
|
+
|
|
75
|
+
### Product Managers
|
|
76
|
+
- **Prioritize features** based on real customer needs
|
|
77
|
+
- **Quantify business impact** of product decisions
|
|
78
|
+
- **Track feature adoption** and customer satisfaction
|
|
79
|
+
- **Competitive intelligence** from customer feedback
|
|
80
|
+
|
|
81
|
+
### Business Analysts
|
|
82
|
+
- **Strategic insights** from customer behavior patterns
|
|
83
|
+
- **Revenue impact** analysis of customer feedback
|
|
84
|
+
- **Market intelligence** and trend analysis
|
|
85
|
+
- **ROI calculations** for product investments
|
|
86
|
+
|
|
87
|
+
## 📖 CLI Commands
|
|
88
|
+
|
|
89
|
+
### Submit Customer Feedback
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Basic submission
|
|
93
|
+
cl input "The app crashes when I try to upload large files"
|
|
94
|
+
|
|
95
|
+
# With metadata for better analysis
|
|
96
|
+
cl input "Great product, love the new features!" \
|
|
97
|
+
--title "Positive Feedback" \
|
|
98
|
+
--customer "customer-456" \
|
|
99
|
+
--name "Jane Smith" \
|
|
100
|
+
--email "jane@example.com" \
|
|
101
|
+
--url "https://support.example.com/ticket/789"
|
|
102
|
+
|
|
103
|
+
# Wait for AI analysis to complete
|
|
104
|
+
cl input "Customer complaint about performance" --wait
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### View AI-Generated Customer Product Feedback
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# List all structured insights
|
|
111
|
+
cl feedback
|
|
112
|
+
|
|
113
|
+
# View specific insight details
|
|
114
|
+
cl feedback <insight-id>
|
|
115
|
+
|
|
116
|
+
# Get JSON output for scripting
|
|
117
|
+
cl feedback --json | jq '.data[0].title'
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Manage Your Data
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# List all customer feedback submitted
|
|
124
|
+
cl input
|
|
125
|
+
|
|
126
|
+
# View specific feedback details
|
|
127
|
+
cl input <feedback-id>
|
|
128
|
+
|
|
129
|
+
# Check processing status
|
|
130
|
+
cl input <feedback-id> --status
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## 🔧 Configuration
|
|
134
|
+
|
|
135
|
+
The CLI stores configuration in `~/.closedloop/config.json`:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"apiKey": "your-api-key-here"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Environment Variables
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
export CLOSEDLOOP_API_KEY="your-api-key-here"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 💡 Real-World Examples
|
|
150
|
+
|
|
151
|
+
### Customer Success Team
|
|
152
|
+
```bash
|
|
153
|
+
# Process support ticket feedback
|
|
154
|
+
cl input "Customer can't find the export feature in the new UI" \
|
|
155
|
+
--title "Export Feature Missing" \
|
|
156
|
+
--customer "enterprise-123" \
|
|
157
|
+
--source "zendesk-ticket-456"
|
|
158
|
+
|
|
159
|
+
# Get AI insights on customer satisfaction trends
|
|
160
|
+
cl feedback --severity high
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Product Manager
|
|
164
|
+
```bash
|
|
165
|
+
# Submit user research findings
|
|
166
|
+
cl input "Users want better mobile experience - 80% of complaints are mobile-related" \
|
|
167
|
+
--title "Mobile UX Research" \
|
|
168
|
+
--customer "research-participant-789"
|
|
169
|
+
|
|
170
|
+
# Analyze feature request patterns
|
|
171
|
+
cl feedback --category "feature-request"
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Business Analyst
|
|
175
|
+
```bash
|
|
176
|
+
# Process survey responses
|
|
177
|
+
cl input "NPS score dropped 15 points this quarter due to performance issues" \
|
|
178
|
+
--title "Q3 NPS Analysis" \
|
|
179
|
+
--customer "survey-respondent-101"
|
|
180
|
+
|
|
181
|
+
# Get strategic insights for leadership
|
|
182
|
+
cl feedback --priority high
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## 📚 Documentation
|
|
186
|
+
|
|
187
|
+
- **[Complete CLI Commands Reference](docs/CLI_COMMANDS.md)** - All commands, parameters, and examples
|
|
188
|
+
- **[Contributing Guide](CONTRIBUTING.md)** - Development and contribution guidelines
|
|
189
|
+
|
|
190
|
+
## 🎯 Why This Matters
|
|
191
|
+
|
|
192
|
+
### Before ClosedLoop AI CLI
|
|
193
|
+
- ❌ **Scattered feedback** across 5+ different tools
|
|
194
|
+
- ❌ **Manual analysis** taking 20+ hours per week
|
|
195
|
+
- ❌ **Missed patterns** and critical insights
|
|
196
|
+
- ❌ **Reactive decisions** based on incomplete data
|
|
197
|
+
- ❌ **Lost revenue** from unaddressed customer needs
|
|
198
|
+
|
|
199
|
+
### After ClosedLoop AI CLI
|
|
200
|
+
- ✅ **Unified intelligence** from all feedback sources
|
|
201
|
+
- ✅ **Automated analysis** with AI pattern recognition
|
|
202
|
+
- ✅ **Proactive insights** delivered in real-time
|
|
203
|
+
- ✅ **Data-driven decisions** with quantified business impact
|
|
204
|
+
- ✅ **Increased revenue** from better customer understanding
|
|
205
|
+
|
|
206
|
+
## 📊 Business Impact
|
|
207
|
+
|
|
208
|
+
- **80% faster** analysis time (from 20 hours to 4 hours per week)
|
|
209
|
+
- **40% faster** feature prioritization decisions
|
|
210
|
+
- **25% increase** in customer satisfaction scores
|
|
211
|
+
- **35% increase** in feature adoption rates
|
|
212
|
+
- **50% reduction** in failed feature launches
|
|
213
|
+
|
|
214
|
+
## 🧪 Development
|
|
215
|
+
|
|
216
|
+
### Prerequisites
|
|
217
|
+
|
|
218
|
+
- Node.js 16+
|
|
219
|
+
- npm or yarn
|
|
220
|
+
- TypeScript 5+
|
|
221
|
+
|
|
222
|
+
### Setup
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Clone the repository
|
|
226
|
+
git clone https://github.com/closed-loop-ai/mcp-client.git
|
|
227
|
+
cd mcp-client
|
|
228
|
+
|
|
229
|
+
# Install dependencies
|
|
230
|
+
npm install
|
|
231
|
+
|
|
232
|
+
# Build the CLI
|
|
233
|
+
npm run build:cli
|
|
234
|
+
|
|
235
|
+
# Run tests
|
|
236
|
+
npm test
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## 🤝 Contributing
|
|
240
|
+
|
|
241
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
242
|
+
|
|
243
|
+
## 📄 License
|
|
244
|
+
|
|
245
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
246
|
+
|
|
247
|
+
## 🔗 Links
|
|
248
|
+
|
|
249
|
+
- **Platform**: [https://closedloop.sh](https://closedloop.sh)
|
|
250
|
+
- **Documentation**: [https://docs.closedloop.sh](https://docs.closedloop.sh)
|
|
251
|
+
- **GitHub Issues**: [https://github.com/closed-loop-ai/closedloop-cli/issues](https://github.com/closed-loop-ai/closedloop-cli/issues)
|
|
252
|
+
- **NPM Package**: [https://www.npmjs.com/package/@closedloop-ai/cli](https://www.npmjs.com/package/@closedloop-ai/cli)
|
|
253
|
+
|
|
254
|
+
## 🆘 Support
|
|
255
|
+
|
|
256
|
+
- **Documentation**: Check our [docs](https://docs.closedloop.sh)
|
|
257
|
+
- **Issues**: Report bugs on [GitHub Issues](https://github.com/closed-loop-ai/closedloop-cli/issues)
|
|
258
|
+
- **Discussions**: Join our [GitHub Discussions](https://github.com/closed-loop-ai/closedloop-cli/discussions)
|
|
259
|
+
- **Email**: support@closedloop.sh
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
**Made with ❤️ by ClosedLoop AI**
|
|
264
|
+
|
|
265
|
+
*Transform customer product feedback chaos into strategic product decisions with AI-powered insights.*
|