@nicolasmondain/cli-agent 2.1.0 → 2.1.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.

Potentially problematic release.


This version of @nicolasmondain/cli-agent might be problematic. Click here for more details.

package/README.md CHANGED
@@ -16,36 +16,41 @@ AI agents can execute scripts, but they face challenges:
16
16
 
17
17
  ### The Solution
18
18
 
19
- cli-agent provides a **semantic catalog** of commands:
20
-
21
- ```
22
- ┌─────────────────────────────────────────────────────────────┐
23
- "Create a feature folder called user-profile" │ Natural Language
24
- └─────────────────────────────────────────────────────────────┘
25
-
26
-
27
- ┌─────────────────────────────────────────────────────────────┐
28
- │ .cli-agent.json
29
- │ { │
30
- "commands": [{ │
31
- │ "name": "feature-folder", │
32
- │ "description": "Generate a new feature folder...", │ Semantic Catalog
33
- │ "arguments": [{ "name": "name", ... }] │
34
- │ }] │
35
- │ } │
36
- └─────────────────────────────────────────────────────────────┘
37
-
38
-
39
- ┌─────────────────────────────────────────────────────────────┐
40
- │ cli-agent feature-folder user-profile --format json │ CLI Command
41
- └─────────────────────────────────────────────────────────────┘
42
-
43
-
44
- ┌─────────────────────────────────────────────────────────────┐
45
- │ {"success": true, "data": {"path": "./src/features/..."}} │ Structured Output
46
- └─────────────────────────────────────────────────────────────┘
19
+ cli-agent provides a **semantic catalog** of commands that enables AI agents to understand and orchestrate multiple commands from a single natural language request:
20
+
21
+ ```mermaid
22
+ flowchart TD
23
+ A["User: 'Set up my project with linting and tests'"] --> B[".cli-agent.json\nSemantic Catalog"]
24
+ B --> C["cli-agent list --format json"]
25
+ C --> D["Agent identifies matching commands"]
26
+ D --> E["cli-agent init my-project --format json"]
27
+ D --> F["cli-agent add-linting --format json"]
28
+ D --> G["cli-agent add-testing --format json"]
29
+ E --> H["Structured JSON output"]
30
+ F --> H
31
+ G --> H
32
+ H --> I["Agent reports combined results"]
47
33
  ```
48
34
 
35
+ ## How It Works
36
+
37
+ When you say: **"Set up my project with linting and tests"**
38
+
39
+ The AI agent:
40
+
41
+ 1. Reads `.cli-agent.json` (or runs `cli-agent list --format json`)
42
+ 2. Matches command descriptions to your intent:
43
+ - `init` → "Initialize a new project with standard structure"
44
+ - `add-linting` → "Add ESLint configuration to the project"
45
+ - `add-testing` → "Add Jest/Vitest testing setup"
46
+ 3. Executes each command sequentially:
47
+ ```bash
48
+ cli-agent init my-project --format json
49
+ cli-agent add-linting --format json
50
+ cli-agent add-testing --format json
51
+ ```
52
+ 4. Parses each JSON response and reports combined results
53
+
49
54
  ## Features
50
55
 
51
56
  - **Natural Language Mapping** — Command descriptions enable AI agents to match user intent to the right command
@@ -74,25 +79,42 @@ Create `.cli-agent.json` in your project root:
74
79
 
75
80
  ```json
76
81
  {
77
- "name": "my-cli",
78
- "description": "My project automation tools",
82
+ "name": "project-cli",
83
+ "description": "Project automation tools",
79
84
  "commands": [
80
85
  {
81
- "name": "feature-folder",
82
- "description": "Generate a new feature folder with component, hook, test, and type files",
83
- "script": "./scripts/generate-feature.js",
86
+ "name": "init",
87
+ "description": "Initialize a new project with standard folder structure and configuration files",
88
+ "script": "./scripts/init.js",
84
89
  "arguments": [
85
90
  {
86
91
  "name": "name",
87
- "description": "Feature name (e.g., 'user-profile', 'checkout')",
92
+ "description": "Project name",
88
93
  "required": true
89
94
  }
90
- ],
95
+ ]
96
+ },
97
+ {
98
+ "name": "add-linting",
99
+ "description": "Add ESLint and Prettier configuration to the project",
100
+ "script": "./scripts/add-linting.js",
91
101
  "options": [
92
102
  {
93
- "flags": "-p, --path <path>",
94
- "description": "Base path where to create the feature",
95
- "default": "./src/features"
103
+ "flags": "--typescript",
104
+ "description": "Include TypeScript ESLint rules"
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "name": "add-testing",
110
+ "description": "Add Jest or Vitest testing setup with example tests",
111
+ "script": "./scripts/add-testing.js",
112
+ "options": [
113
+ {
114
+ "flags": "-r, --runner <runner>",
115
+ "description": "Test runner to use",
116
+ "choices": ["jest", "vitest"],
117
+ "default": "vitest"
96
118
  }
97
119
  ]
98
120
  }
@@ -100,37 +122,36 @@ Create `.cli-agent.json` in your project root:
100
122
  }
101
123
  ```
102
124
 
103
- ### 2. Create your script
125
+ ### 2. Create your scripts
104
126
 
105
- Create `scripts/generate-feature.js`:
127
+ Create `scripts/init.js`:
106
128
 
107
129
  ```javascript
108
130
  export default async function(context) {
109
131
  const name = context.args.name;
110
- const path = context.options.path;
111
132
 
112
- // Your logic here...
133
+ // Your initialization logic here...
113
134
 
114
135
  return {
115
136
  success: true,
116
- message: `Created feature: ${name}`,
137
+ message: `Initialized project: ${name}`,
117
138
  data: {
118
139
  name,
119
- path: `${path}/${name}`,
120
- files: ['index.ts', 'component.tsx', 'hook.ts', 'types.ts']
140
+ path: `./${name}`,
141
+ files: ['package.json', 'tsconfig.json', 'src/index.ts']
121
142
  }
122
143
  };
123
144
  }
124
145
  ```
125
146
 
126
- ### 3. Run your command
147
+ ### 3. Run your commands
127
148
 
128
149
  ```bash
129
150
  # Human-friendly output
130
- cli-agent feature-folder user-profile
151
+ cli-agent init my-project
131
152
 
132
153
  # JSON output for AI agents
133
- cli-agent feature-folder user-profile --format json
154
+ cli-agent init my-project --format json
134
155
  ```
135
156
 
136
157
  ## Command Discovery
@@ -142,7 +163,7 @@ cli-agent feature-folder user-profile --format json
142
163
  cli-agent list
143
164
 
144
165
  # Show help for a specific command
145
- cli-agent feature-folder --help
166
+ cli-agent init --help
146
167
  ```
147
168
 
148
169
  ### For AI Agents
@@ -157,13 +178,19 @@ Output:
157
178
  {
158
179
  "success": true,
159
180
  "data": {
160
- "name": "my-cli",
181
+ "name": "project-cli",
161
182
  "commands": [
162
183
  {
163
- "name": "feature-folder",
164
- "description": "Generate a new feature folder with component, hook, test, and type files",
165
- "arguments": [{ "name": "name", "description": "Feature name", "required": true }],
166
- "options": [{ "flags": "-p, --path <path>", "description": "Base path", "default": "./src/features" }]
184
+ "name": "init",
185
+ "description": "Initialize a new project with standard folder structure and configuration files",
186
+ "arguments": [{ "name": "name", "description": "Project name", "required": true }],
187
+ "options": []
188
+ },
189
+ {
190
+ "name": "add-linting",
191
+ "description": "Add ESLint and Prettier configuration to the project",
192
+ "arguments": [],
193
+ "options": [{ "flags": "--typescript", "description": "Include TypeScript ESLint rules" }]
167
194
  }
168
195
  ]
169
196
  }
@@ -187,13 +214,12 @@ Output:
187
214
  {
188
215
  "tools": [
189
216
  {
190
- "name": "feature-folder",
191
- "description": "Generate a new feature folder with component, hook, test, and type files",
217
+ "name": "init",
218
+ "description": "Initialize a new project with standard folder structure and configuration files",
192
219
  "inputSchema": {
193
220
  "type": "object",
194
221
  "properties": {
195
- "name": { "type": "string", "description": "Feature name" },
196
- "path": { "type": "string", "description": "Base path", "default": "./src/features" }
222
+ "name": { "type": "string", "description": "Project name" }
197
223
  },
198
224
  "required": ["name"]
199
225
  }
@@ -253,14 +279,14 @@ Good descriptions are crucial for AI agents to match user intent:
253
279
 
254
280
  ```json
255
281
  {
256
- "name": "feature-folder",
257
- "description": "Generate a new feature folder with component, hook, test, and type files"
282
+ "name": "init",
283
+ "description": "Initialize a new project with standard folder structure and configuration files"
258
284
  }
259
285
  ```
260
286
 
261
287
  ```json
262
288
  {
263
- "name": "db:migrate",
289
+ "name": "db-migrate",
264
290
  "description": "Run database migrations to update schema to latest version"
265
291
  }
266
292
  ```
@@ -285,7 +311,7 @@ Scripts must export a default async function:
285
311
  */
286
312
  export default async function(context) {
287
313
  // context.args - positional arguments { name: 'value' }
288
- // context.options - command options { path: './src', verbose: true }
314
+ // context.options - command options { typescript: true, runner: 'vitest' }
289
315
  // context.cwd - current working directory
290
316
  // context.format - 'human' or 'json'
291
317
 
@@ -309,8 +335,8 @@ export default async function(context: ScriptContext): Promise<CommandResult> {
309
335
 
310
336
  return {
311
337
  success: true,
312
- message: `Hello, ${name}!`,
313
- data: { greeting: `Hello, ${name}!` }
338
+ message: `Initialized ${name}`,
339
+ data: { name }
314
340
  };
315
341
  }
316
342
  ```
@@ -330,13 +356,13 @@ Shell scripts receive context via environment variables:
330
356
  # CWD: CLI_AGENT_CWD
331
357
 
332
358
  NAME="${CLI_AGENT_ARG_NAME}"
333
- PATH_OPT="${CLI_AGENT_OPT_PATH:-./src/features}"
359
+ TYPESCRIPT="${CLI_AGENT_OPT_TYPESCRIPT:-false}"
334
360
 
335
361
  # Output JSON for structured response
336
362
  if [ "$CLI_AGENT_FORMAT" = "json" ]; then
337
- echo "{\"success\": true, \"data\": {\"name\": \"$NAME\", \"path\": \"$PATH_OPT\"}}"
363
+ echo "{\"success\": true, \"data\": {\"name\": \"$NAME\"}}"
338
364
  else
339
- echo "Created feature: $NAME at $PATH_OPT"
365
+ echo "Initialized project: $NAME"
340
366
  fi
341
367
  ```
342
368
 
@@ -358,6 +384,35 @@ All commands automatically have these options:
358
384
  | `list` | List all available commands |
359
385
  | `mcp:manifest` | Generate MCP tool manifest |
360
386
 
387
+ ## Multi-Command Orchestration
388
+
389
+ cli-agent is designed to be called multiple times by an AI agent. The agent orchestrates the execution flow based on user intent:
390
+
391
+ ```mermaid
392
+ sequenceDiagram
393
+ participant User
394
+ participant Agent
395
+ participant CLI as cli-agent
396
+
397
+ User->>Agent: "Set up my project with linting and tests"
398
+ Agent->>CLI: cli-agent list --format json
399
+ CLI-->>Agent: Command catalog (JSON)
400
+ Agent->>Agent: Match intent to commands
401
+ Agent->>CLI: cli-agent init my-project --format json
402
+ CLI-->>Agent: {"success": true, "data": {...}}
403
+ Agent->>CLI: cli-agent add-linting --format json
404
+ CLI-->>Agent: {"success": true, "data": {...}}
405
+ Agent->>CLI: cli-agent add-testing --format json
406
+ CLI-->>Agent: {"success": true, "data": {...}}
407
+ Agent->>User: "Project setup complete with linting and tests"
408
+ ```
409
+
410
+ The agent decides which commands to run and in what order. cli-agent provides:
411
+
412
+ - **Discovery**: Machine-readable command catalog
413
+ - **Execution**: Consistent invocation interface
414
+ - **Output**: Structured JSON for reliable parsing
415
+
361
416
  ## Using Utilities in Scripts
362
417
 
363
418
  cli-agent exports utility functions for use in your scripts:
@@ -396,85 +451,14 @@ export default async function(context) {
396
451
  }
397
452
  ```
398
453
 
399
- ## Example: Complete Feature Generator
400
-
401
- `.cli-agent.json`:
402
- ```json
403
- {
404
- "name": "project-cli",
405
- "commands": [
406
- {
407
- "name": "feature",
408
- "description": "Generate a new feature folder with React component, custom hook, tests, and TypeScript types",
409
- "script": "./scripts/generate-feature.js",
410
- "arguments": [
411
- { "name": "name", "description": "Feature name in kebab-case (e.g., 'user-profile')", "required": true }
412
- ],
413
- "options": [
414
- { "flags": "-p, --path <path>", "description": "Base path for features", "default": "./src/features" },
415
- { "flags": "--no-test", "description": "Skip test file generation" },
416
- { "flags": "--no-hook", "description": "Skip hook file generation" }
417
- ]
418
- }
419
- ]
420
- }
421
- ```
422
-
423
- `scripts/generate-feature.js`:
424
- ```javascript
425
- import { toKebabCase, toPascalCase, createDirectory, createFile, pathExists } from '@nicolasmondain/cli-agent';
426
- import { resolve } from 'node:path';
427
-
428
- export default async function(context) {
429
- const name = toKebabCase(context.args.name);
430
- const pascalName = toPascalCase(name);
431
- const basePath = context.options.path;
432
- const featurePath = resolve(context.cwd, basePath, name);
433
-
434
- if (await pathExists(featurePath)) {
435
- return { success: false, error: `Feature "${name}" already exists at ${featurePath}` };
436
- }
437
-
438
- const files = [];
439
-
440
- await createDirectory(featurePath);
441
-
442
- // Component
443
- await createFile(`${featurePath}/${pascalName}.tsx`, `export function ${pascalName}() {\n return <div>${pascalName}</div>;\n}\n`);
444
- files.push(`${pascalName}.tsx`);
445
-
446
- // Hook
447
- if (context.options.hook !== false) {
448
- await createFile(`${featurePath}/use${pascalName}.ts`, `export function use${pascalName}() {\n return {};\n}\n`);
449
- files.push(`use${pascalName}.ts`);
450
- }
451
-
452
- // Test
453
- if (context.options.test !== false) {
454
- await createFile(`${featurePath}/${pascalName}.test.tsx`, `import { ${pascalName} } from './${pascalName}';\n\ndescribe('${pascalName}', () => {\n it('renders', () => {});\n});\n`);
455
- files.push(`${pascalName}.test.tsx`);
456
- }
457
-
458
- // Index
459
- await createFile(`${featurePath}/index.ts`, `export * from './${pascalName}';\n`);
460
- files.push('index.ts');
461
-
462
- return {
463
- success: true,
464
- message: `Created feature "${name}" with ${files.length} files`,
465
- data: { name, path: featurePath, files }
466
- };
467
- }
468
- ```
469
-
470
454
  ## Project Structure
471
455
 
472
456
  ```
473
457
  your-project/
474
458
  ├── .cli-agent.json # CLI configuration
475
459
  ├── scripts/
476
- │ ├── generate-feature.js # JavaScript script
477
- │ ├── run-migrations.ts # TypeScript script
460
+ │ ├── init.js # JavaScript script
461
+ │ ├── add-linting.ts # TypeScript script
478
462
  │ └── deploy.sh # Shell script
479
463
  └── package.json
480
464
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-command.factory.d.ts","sourceRoot":"","sources":["../../src/command/dynamic-command.factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,4BAA4B,CAAC;AAShF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAgGT"}
1
+ {"version":3,"file":"dynamic-command.factory.d.ts","sourceRoot":"","sources":["../../src/command/dynamic-command.factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,4BAA4B,CAAC;AAShF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAiHT"}
@@ -45,12 +45,20 @@ export function createDynamicCommand(config, configDir) {
45
45
  }
46
46
  }
47
47
  }
48
- // Add standard options (always available for all commands)
49
- command
50
- .option("--format <format>", "Output format: human or json", "human")
51
- .option("--quiet", "Suppress all output except errors")
52
- .option("--verbose", "Show detailed output")
53
- .option("--debug", "Show debug information");
48
+ // Add standard options (only if not already defined in config)
49
+ const existingFlags = new Set((config.options ?? []).flatMap((opt) => opt.flags.split(",").map((f) => f.trim().split(/[\s<[]/)[0])));
50
+ if (!existingFlags.has("--format")) {
51
+ command.option("--format <format>", "Output format: human or json", "human");
52
+ }
53
+ if (!existingFlags.has("--quiet")) {
54
+ command.option("--quiet", "Suppress all output except errors");
55
+ }
56
+ if (!existingFlags.has("--verbose")) {
57
+ command.option("--verbose", "Show detailed output");
58
+ }
59
+ if (!existingFlags.has("--debug")) {
60
+ command.option("--debug", "Show debug information");
61
+ }
54
62
  // Add action handler
55
63
  command.action(async (...actionArgs) => {
56
64
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-command.factory.js","sourceRoot":"","sources":["../../src/command/dynamic-command.factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,aAAa,GAEd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGrE;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAqB,EACrB,SAAiB;IAEjB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzC,kBAAkB;IAClB,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED,2BAA2B;IAC3B,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,mBAAmB,CAAC,GA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ACrB,UAAqB;IAErB,MAAM,IAAI,GAA4B,EAAE,CAAC;IAEzC,mDAAmD;IACnD,MAAM,eAAe,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAY,CAAC;IAErE,wCAAwC;IACxC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,EAA6B,CAAC;IAElE,4EAA4E;IAC5E,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/C,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;YAC5C,IAAI,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;gBAClC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,OAAgC;IACvD,IAAI,OAAO,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAClC,IAAI,OAAO,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IACtC,IAAI,OAAO,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAClC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,MAAc;IACpC,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAC9C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicolasmondain/cli-agent",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Generic CLI wrapper for executing external scripts, designed for both human developers and AI agents (MCP compatible)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",