@mutagent/cli 0.1.195 → 0.1.196

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/README.md CHANGED
@@ -24,179 +24,85 @@
24
24
  </p>
25
25
 
26
26
  <p align="center">
27
- <strong>Optimize Prompts. Manage Agents. Integrate Any Framework.</strong>
27
+ <strong>Authenticate. Configure providers. Install MutagenT lifecycle tools.</strong>
28
28
  </p>
29
29
 
30
30
  ---
31
31
 
32
32
  ## What is MutagenT CLI?
33
33
 
34
- MutagenT CLI is the command-line interface for the **MutagenT AI platform** a next-generation prompt optimization and observability system designed for AI-native development workflows.
34
+ MutagenT CLI is the command-line client for the **MutagenT AI platform**. It is the
35
+ entry point that AI coding agents and developers use to authenticate, set up a
36
+ project, manage BYOK LLM providers, check account usage, and install MutagenT's
37
+ lifecycle tooling (diagnostics, evaluator, and — when available — helix).
38
+
39
+ Every command is **AI-first**: run any command with `--json` for machine-readable
40
+ output, and install the bundled Claude Code skill so coding agents know how to
41
+ drive the CLI without human hand-holding.
35
42
 
36
43
  ### Key Features
37
44
 
38
- - **Prompt-Centric**: Datasets, evaluations, and optimizations are all scoped to prompts
39
- - **Native Tracing**: Built-in trace observability without external dependencies
40
- - **AI-First Design**: Every command supports `--json` with `_links` for programmatic usage
41
- - **Framework Integrations**: One-command setup for Mastra, LangChain, LangGraph, Vercel AI SDK, Claude Code
42
- - **Bun-Native**: Built for speed with Bun runtime (Node.js 18+ compatible)
43
- - **Post-Onboarding Flow**: Guided paths after login for integration or optimization
44
- - **Codebase Exploration**: `mutagent explore` scans your code for prompts, datasets, and markers
45
- - **Optimization Scorecard**: Before/after comparison with apply/reject flow
46
- - **State Tracking**: `.mutagent/mutation-context.md` tracks your entire workflow locally
45
+ - **AI-First Design**: Every command supports `--json` with `_directive` + `_links` for programmatic use by coding agents
46
+ - **One-Command Auth**: `mutagent login` handles signup, onboarding, and CLI authorization via browser OAuth (or an API key for CI)
47
+ - **BYOK Providers**: Configure and test your own LLM provider keys (`mutagent providers`)
48
+ - **Lifecycle Meta-Installer**: `mutagent install <diagnostics|evaluator|helix>` pulls MutagenT packages (login-gated)
49
+ - **Claude Code Integration**: Install the CLI skill (`mutagent skills install`) and session-telemetry hooks (`mutagent hooks install`)
50
+ - **Built-in Feedback**: `mutagent feedback send` reports bugs and product feedback, optionally with your coding-agent session transcript
51
+ - **Bun-Native**: Built for speed with the Bun runtime (Node.js 22+ compatible)
47
52
 
48
53
  ---
49
54
 
50
55
  ## Interaction Flow Map
51
56
 
52
- This is the complete map of all user-facing routes through the CLI. Use this as a reference for UX decisions.
57
+ The active command surface and the typical routes through it.
53
58
 
54
59
  ```mermaid
55
60
  flowchart TD
56
61
  INSTALL["npm i -g @mutagent/cli"] --> AUTH_CHOICE{How to authenticate?}
57
62
 
58
- AUTH_CHOICE -->|Interactive| AUTH_LOGIN["mutagent auth login"]
59
- AUTH_CHOICE -->|Browser OAuth| AUTH_BROWSER["mutagent auth login --browser"]
60
- AUTH_CHOICE -->|API Key| AUTH_KEY["mutagent auth login --api-key mg_..."]
61
- AUTH_CHOICE -->|Env Var| AUTH_ENV["export MUTAGENT_API_KEY=mg_..."]
63
+ AUTH_CHOICE -->|Interactive / browser OAuth| LOGIN["mutagent login"]
64
+ AUTH_CHOICE -->|Force browser| LOGIN_B["mutagent login --browser"]
65
+ AUTH_CHOICE -->|CI / env var| ENV["export MUTAGENT_API_KEY=mt_...<br/>mutagent login --json"]
62
66
 
63
- AUTH_LOGIN --> ONBOARD
64
- AUTH_BROWSER --> ONBOARD
65
- AUTH_KEY --> ONBOARD
66
- AUTH_ENV --> MANUAL
67
+ LOGIN --> INIT["mutagent init<br/>(.mutagentrc.json)"]
68
+ LOGIN_B --> INIT
69
+ ENV --> INIT
67
70
 
68
- subgraph ONBOARD ["Post-Onboarding Menu (interactive only)"]
69
- direction TB
70
- MENU["What would you like to do?"]
71
- PATH_A["A: Guided Integration"]
72
- PATH_B["B: Quick Optimization"]
73
- PATH_C["C: Exit — manual mode"]
74
- MENU --> PATH_A
75
- MENU --> PATH_B
76
- MENU --> PATH_C
77
- end
71
+ INIT --> SETUP
78
72
 
79
- PATH_C --> MANUAL
80
- PATH_A --> EXPLORE_A["mutagent explore (auto-scan)"]
81
- PATH_B --> EXPLORE_B["mutagent explore (auto-scan)"]
82
-
83
- EXPLORE_A --> FW_SELECT["Select framework"]
84
- FW_SELECT --> INTEGRATE["mutagent integrate <framework>"]
85
- INTEGRATE --> VERIFY["mutagent integrate <fw> --verify"]
86
- VERIFY --> MANUAL
87
-
88
- EXPLORE_B --> PROMPT_CREATE
89
- PROMPT_CREATE --> EVAL_CREATE
90
- EVAL_CREATE --> DS_ADD
91
- DS_ADD --> OPT_START
92
- OPT_START --> OPT_STATUS
93
- OPT_STATUS --> OPT_RESULTS
94
- OPT_RESULTS --> SCORECARD["Scorecard: Apply / Reject"]
95
- SCORECARD -->|Apply| PROMPT_UPDATED["Prompt updated (platform + local)"]
96
- SCORECARD -->|Reject| MANUAL
97
-
98
- subgraph MANUAL ["Manual CLI Usage"]
73
+ subgraph SETUP ["Project Setup & Discovery"]
99
74
  direction TB
100
75
 
101
76
  subgraph AUTH_CMDS ["Auth & Config"]
102
77
  AUTH_STATUS["mutagent auth status"]
103
78
  AUTH_LOGOUT["mutagent auth logout"]
104
79
  CONFIG_LIST["mutagent config list"]
105
- CONFIG_GET["mutagent config get <key>"]
106
80
  CONFIG_SET_WS["mutagent config set workspace <id>"]
107
81
  CONFIG_SET_ORG["mutagent config set org <id>"]
108
82
  end
109
83
 
110
- subgraph DISCOVER ["Discovery"]
111
- EXPLORE["mutagent explore"]
112
- EXPLORE_PATH["mutagent explore --path ./src"]
113
- EXPLORE_MARKERS["mutagent explore --markers-only"]
114
- SKILLS["mutagent skills install"]
115
- end
116
-
117
- subgraph PROMPT_CMDS ["Prompt CRUD"]
118
- PROMPT_LIST["mutagent prompts list"]
119
- PROMPT_GET["mutagent prompts get <id>"]
120
- PROMPT_CREATE["mutagent prompts create"]
121
- PROMPT_UPDATE["mutagent prompts update <id>"]
122
- PROMPT_DELETE["mutagent prompts delete <id>"]
123
- end
124
-
125
- subgraph DATASET_CMDS ["Dataset Management"]
126
- DS_LIST["mutagent prompts dataset list <pid>"]
127
- DS_ADD["mutagent prompts dataset add <pid>"]
128
- DS_DELETE["mutagent prompts dataset delete <pid> <did>"]
129
- end
130
-
131
- subgraph EVAL_CMDS ["Evaluations"]
132
- EVAL_LIST["mutagent prompts evaluation list <pid>"]
133
- EVAL_CREATE["mutagent prompts evaluation create <pid>"]
134
- EVAL_GUIDED["mutagent prompts evaluation create <pid> --guided"]
135
- EVAL_RESULTS["mutagent prompts evaluation results <rid>"]
136
- end
137
-
138
- subgraph OPT_CMDS ["Optimization"]
139
- OPT_START["mutagent prompts optimize start <pid>"]
140
- OPT_STATUS["mutagent prompts optimize status <jid>"]
141
- OPT_RESULTS["mutagent prompts optimize results <jid>"]
142
- end
143
-
144
- subgraph TRACE_CMDS ["Traces"]
145
- TRACE_LIST["mutagent traces list"]
146
- TRACE_GET["mutagent traces get <id>"]
147
- TRACE_ANALYZE["mutagent traces analyze <pid>"]
148
- TRACE_EXPORT["mutagent traces export"]
149
- end
150
-
151
- subgraph INTEGRATION_CMDS ["Integrations"]
152
- INT_LIST["mutagent integrate list"]
153
- INT_FW["mutagent integrate <framework>"]
154
- INT_VERIFY["mutagent integrate <fw> --verify"]
155
- end
156
-
157
- subgraph PLAYGROUND_CMDS ["Playground"]
158
- PG_RUN["mutagent playground run <pid>"]
159
- PG_STREAM["mutagent playground run <pid> --stream"]
160
- end
161
-
162
84
  subgraph PLATFORM_CMDS ["Platform (read-only)"]
163
85
  WS_LIST["mutagent workspaces list"]
164
86
  WS_GET["mutagent workspaces get <id>"]
87
+ USAGE["mutagent usage"]
88
+ end
89
+
90
+ subgraph PROVIDER_CMDS ["Providers (BYOK)"]
165
91
  PROV_LIST["mutagent providers list"]
166
- PROV_GET["mutagent providers get <id>"]
92
+ PROV_ADD["mutagent providers add"]
167
93
  PROV_TEST["mutagent providers test <id>"]
168
- AGENTS_LIST["mutagent agents list"]
169
- AGENTS_GET["mutagent agents get <id>"]
170
94
  end
171
- end
172
- ```
173
-
174
- ### Evaluate-Optimize Loop (Detail)
175
-
176
- ```mermaid
177
- flowchart LR
178
- CREATE["prompts create\n-d / --file / --raw"] --> DATASET["dataset add\n--file / -d"]
179
- DATASET --> EVAL["evaluation create\n--guided / --file / -d"]
180
- EVAL --> OPT["optimize start\n--dataset --max-iterations"]
181
- OPT --> STATUS["optimize status"]
182
- STATUS -->|poll| STATUS
183
- STATUS --> RESULTS["optimize results\n(scorecard)"]
184
- RESULTS -->|Apply| UPDATE["prompts update\n(new version)"]
185
- RESULTS -->|Reject| TWEAK["Adjust prompt/eval\nand re-run"]
186
- TWEAK --> OPT
187
- ```
188
95
 
189
- ### State Tracking Flow
96
+ subgraph AGENT_TOOLING ["Coding-Agent Tooling"]
97
+ SKILLS["mutagent skills install"]
98
+ HOOKS["mutagent hooks install"]
99
+ end
190
100
 
191
- ```mermaid
192
- flowchart LR
193
- EXPLORE["mutagent explore"] -->|writes| CTX[".mutagent/mutation-context.md"]
194
- CREATE["prompts create"] -->|updates| CTX
195
- UPLOAD["dataset add"] -->|updates| CTX
196
- EVAL["evaluation create"] -->|updates| CTX
197
- OPTIMIZE["optimize results --apply"] -->|updates| CTX
198
- MARKERS["MutagenT:START/END\ncomment markers"] -->|tracked by| CTX
199
- STATUS["auth status"] -->|reads| CTX
101
+ subgraph LIFECYCLE ["Lifecycle Tools & Feedback"]
102
+ INSTALL_PKG["mutagent install <diagnostics|evaluator|helix>"]
103
+ FEEDBACK["mutagent feedback send"]
104
+ end
105
+ end
200
106
  ```
201
107
 
202
108
  ---
@@ -253,63 +159,57 @@ mutagent auth login
253
159
  > `mutagent login` is the canonical command. `mutagent auth login` is preserved
254
160
  > as a back-compat alias; both behave identically.
255
161
 
256
- ### 2. Post-Onboarding (Interactive)
162
+ ### 2. Initialize Your Project
257
163
 
258
- After login, the CLI offers 3 paths:
164
+ ```bash
165
+ mutagent init # Interactive setup — writes .mutagentrc.json
166
+ mutagent init --non-interactive # CLI-only defaults, no prompts
259
167
 
260
- | Path | Description |
261
- |------|-------------|
262
- | **A: Guided Integration** | Auto-scans codebase, selects framework, generates integration code |
263
- | **B: Quick Optimization** | Auto-scans codebase, uploads prompt, creates eval, runs optimization |
264
- | **C: Exit** | Skip guidance, use CLI manually |
168
+ # Confirm state
169
+ mutagent auth status
170
+ ```
265
171
 
266
- ### 3. Explore Your Codebase
172
+ ### 3. Configure Providers (BYOK)
267
173
 
268
174
  ```bash
269
- mutagent explore # Scan current directory
270
- mutagent explore --path ./src # Scan specific path
271
- mutagent explore --markers-only # Find existing MutagenT markers only
175
+ mutagent providers list # List configured providers
176
+ mutagent providers list --models # Show available models per provider
177
+ mutagent providers add # Add a provider key (interactive)
178
+ mutagent providers test <provider-id> # Verify connectivity
272
179
  ```
273
180
 
274
- ### 4. Create & Optimize
181
+ ### 4. Install Lifecycle Tools
275
182
 
276
183
  ```bash
277
- # Create a prompt (inline JSON recommended for AI agents)
278
- mutagent prompts create -d '{"name":"summarizer","systemPrompt":"Summarize the text","humanPrompt":"{{text}}","outputSchema":{"type":"object","properties":{"summary":{"type":"string"}}}}'
279
-
280
- # Upload a dataset
281
- mutagent prompts dataset add <prompt-id> --file data.json --name "Training Data"
282
-
283
- # Create evaluation criteria (guided interactive mode)
284
- mutagent prompts evaluation create <prompt-id> --guided
285
-
286
- # Start optimization
287
- mutagent prompts optimize start <prompt-id> --dataset <dataset-id> --max-iterations 1
288
-
289
- # Review results (shows scorecard with apply/reject)
290
- mutagent prompts optimize results <job-id>
184
+ mutagent install diagnostics # Install diagnostics from npm (login-gated)
185
+ mutagent install evaluator # Install evaluator from npm
186
+ mutagent install evaluator --version 1.2.3 # Pin a version
187
+ mutagent install --help # helix (pending) | diagnostics | evaluator
291
188
  ```
292
189
 
293
- ### 5. Get Framework Integration
190
+ ### 5. Wire Up Your Coding Agent
294
191
 
295
192
  ```bash
296
- mutagent integrate mastra # Mastra
297
- mutagent integrate langchain # LangChain
298
- mutagent integrate langgraph # LangGraph
299
- mutagent integrate vercel-ai # Vercel AI SDK
300
- mutagent integrate openai # OpenAI SDK
301
- mutagent integrate claude-code # Claude Code
193
+ mutagent skills install # Install the MutagenT CLI skill for AI agents
194
+ mutagent hooks install # Install Claude Code session-telemetry hooks
302
195
  ```
303
196
 
304
197
  ---
305
198
 
306
199
  ## Commands Reference
307
200
 
201
+ The active command surface:
202
+
203
+ `login` · `auth` · `config` · `workspaces` · `providers` · `usage` · `init` · `skills` · `hooks` · `install` · `feedback`
204
+
205
+ Run `mutagent <command> --help` for the authoritative, current flag list — the CLI
206
+ is the source of truth for flags.
207
+
308
208
  ### Global Options
309
209
 
310
210
  | Option | Description |
311
211
  |--------|-------------|
312
- | `--json` | Output results as JSON with `_links` to web UI |
212
+ | `--json` | Output results as JSON with `_directive` + `_links` |
313
213
  | `--non-interactive` | Disable all interactive prompts (also: `CI=true`) |
314
214
  | `--api-key <key>` | Override API key for this command |
315
215
  | `--endpoint <url>` | Override API endpoint |
@@ -320,218 +220,154 @@ mutagent integrate claude-code # Claude Code
320
220
 
321
221
  | Variable | Description |
322
222
  |----------|-------------|
323
- | `MUTAGENT_API_KEY` | API key (skips login entirely) |
223
+ | `MUTAGENT_API_KEY` | API key (skips interactive login) |
324
224
  | `MUTAGENT_ENDPOINT` | Custom API endpoint |
325
225
  | `MUTAGENT_NON_INTERACTIVE=true` | Non-interactive mode |
326
226
  | `CI=true` | Enables non-interactive mode |
327
227
 
328
- ### Authentication & Configuration
228
+ ### Authentication (`login` / `auth`)
329
229
 
330
230
  ```bash
331
- mutagent auth login # Interactive login
332
- mutagent auth login --browser # Browser OAuth
333
- mutagent auth login --api-key KEY # API key login
334
- mutagent auth status # Check auth + onboarding state + resource counts
335
- mutagent auth logout # Clear credentials
231
+ mutagent login # Browser OAuth (recommended)
232
+ mutagent login --browser # Force browser flow
233
+ mutagent login --json # Non-interactive (uses MUTAGENT_API_KEY)
336
234
 
337
- mutagent config list # List all config values
338
- mutagent config get <key> # Get specific value
339
- mutagent config set workspace <id> # Set default workspace
340
- mutagent config set org <id> # Set default organization
235
+ mutagent auth login # Back-compat alias for `mutagent login`
236
+ mutagent auth status # Check auth + workspace + onboarding state
237
+ mutagent auth logout # Clear stored credentials
341
238
  ```
342
239
 
343
- ### Discovery & Skills
240
+ ### Configuration (`config`)
344
241
 
345
242
  ```bash
346
- # Explore codebase for prompts, datasets, MutagenT markers
347
- mutagent explore # Scan current directory
348
- mutagent explore --path ./src # Scan specific path
349
- mutagent explore --include "**/*.py" # Python projects only
350
- mutagent explore --markers-only # Only find MutagenT:START/END markers
351
- mutagent explore --json # JSON output
352
-
353
- # Install Claude Code skill
354
- mutagent skills install # Creates .claude/skills/mutagent-cli/SKILL.md
243
+ mutagent config list # List all config values
244
+ mutagent config get <key> # Get a value (apiKey, endpoint, format, timeout, defaultWorkspace, defaultOrg)
245
+ mutagent config set workspace <id> # Set default workspace
246
+ mutagent config set org <id> # Set default organization
355
247
  ```
356
248
 
357
- ### Prompts
249
+ ### Project Setup (`init`)
358
250
 
359
251
  ```bash
360
- # List / Get
361
- mutagent prompts list
362
- mutagent prompts get <id>
363
- mutagent prompts get <id> --with-datasets --with-evals
364
-
365
- # Create (multiple input methods, priority order)
366
- mutagent prompts create -d '{"name":"...","systemPrompt":"...","outputSchema":{...}}' # Inline JSON (recommended)
367
- mutagent prompts create --file prompt.json # From JSON file
368
- mutagent prompts create --name "my-prompt" --raw-file prompt.txt # From text file
369
- mutagent prompts create --name "my-prompt" --system "You are..." --human "{{input}}" # System + human
370
- mutagent prompts create --name "my-prompt" --raw "Summarize: {{text}}" # Raw text
371
- mutagent prompts create --name "chat" --messages '[{"role":"system","content":"..."}]' # Messages array
372
-
373
- # Update (same input methods as create)
374
- mutagent prompts update <id> -d '{"name":"new-name","systemPrompt":"Updated"}'
375
- mutagent prompts update <id> --name "new-name"
376
- mutagent prompts update <id> --file updated.json
377
-
378
- # Delete
379
- mutagent prompts delete <id>
380
- mutagent prompts delete <id> --force
252
+ mutagent init # Interactive wizard — writes .mutagentrc.json
253
+ mutagent init --non-interactive # Skip prompts (CLI-only defaults)
381
254
  ```
382
255
 
383
- > **outputSchema** is required for optimization. Include it in `--data`, `--file`, or use `--output-schema`. In interactive mode, you will be prompted if missing.
384
-
385
- ### Datasets
256
+ ### Workspaces (`workspaces`, read-only)
386
257
 
387
258
  ```bash
388
- mutagent prompts dataset list <prompt-id>
389
-
390
- # Add from file (JSON, JSONL, CSV)
391
- mutagent prompts dataset add <prompt-id> --file data.json --name "My Dataset"
392
-
393
- # Add inline JSON
394
- mutagent prompts dataset add <prompt-id> -d '[{"input":{...},"expectedOutput":{...}}]' --name "Inline Data"
395
-
396
- mutagent prompts dataset delete <prompt-id> <dataset-id>
259
+ mutagent workspaces list # List all workspaces
260
+ mutagent workspaces list --limit 20 --offset 0
261
+ mutagent workspaces get <id> # Workspace details
397
262
  ```
398
263
 
399
- ### Evaluations
264
+ ### Providers (`providers`, BYOK)
400
265
 
401
266
  ```bash
402
- mutagent prompts evaluation list <prompt-id>
403
-
404
- # Guided interactive mode (fetches outputSchema, helps build criteria)
405
- mutagent prompts evaluation create <prompt-id> --guided
267
+ mutagent providers list # List configured providers
268
+ mutagent providers list --models # Show available models per provider
269
+ mutagent providers get <id> # Provider details
270
+ mutagent providers test <id> # Test provider connectivity
406
271
 
407
- # Inline JSON
408
- mutagent prompts evaluation create <prompt-id> -d '{"name":"Accuracy","evalConfig":{"criteria":[...]}}'
409
-
410
- # From file with dataset association
411
- mutagent prompts evaluation create <prompt-id> --name "Quality" --file criteria.json --dataset <dataset-id>
412
-
413
- mutagent prompts evaluation results <run-id>
272
+ # Manage keys
273
+ mutagent providers add # Add a provider (interactive; --scope, --base-url, --set-default)
274
+ mutagent providers update <id> --name "New name" --active true
275
+ mutagent providers delete <id> --force
414
276
  ```
415
277
 
416
- > `-d` is `--data` (inline JSON). `--dataset` requires the full flag name (no shorthand).
417
-
418
- ### Optimization
278
+ ### Usage (`usage`)
419
279
 
420
280
  ```bash
421
- mutagent prompts optimize start <prompt-id> --dataset <dataset-id>
422
- mutagent prompts optimize start <prompt-id> --dataset <id> --max-iterations 5 --target-score 0.95
423
-
424
- mutagent prompts optimize status <job-id>
425
-
426
- # Results include scorecard with before/after comparison and apply/reject flow
427
- mutagent prompts optimize results <job-id>
281
+ mutagent usage # Show account usage + provider status
282
+ mutagent usage --json # Machine-readable
428
283
  ```
429
284
 
430
- ### Traces
285
+ ### Skills & Hooks (Claude Code)
431
286
 
432
287
  ```bash
433
- mutagent traces list
434
- mutagent traces list --prompt <prompt-id> --limit 10
435
- mutagent traces get <trace-id>
436
- mutagent traces analyze <prompt-id>
437
- mutagent traces export --format json --output traces.json
438
- mutagent traces export --format csv --prompt <prompt-id>
288
+ # Install the MutagenT CLI skill so coding agents know how to drive the CLI
289
+ mutagent skills install # Creates .claude/skills/mutagent-cli/SKILL.md
290
+
291
+ # Install session-telemetry hooks (safe merge into .claude/settings.local.json)
292
+ mutagent hooks install
293
+ mutagent hooks install --cwd ./path # Target a specific directory
439
294
  ```
440
295
 
441
- ### Framework Integration
296
+ ### Lifecycle Meta-Installer (`install`)
442
297
 
443
298
  ```bash
444
- mutagent integrate # Auto-detect framework
445
- mutagent integrate list # List supported frameworks
446
- mutagent integrate <framework> # Generate integration code
447
- mutagent integrate <fw> --verify # Verify integration setup
448
- mutagent integrate <fw> --output FILE # Save to file
449
- mutagent integrate <fw> --raw # Raw markdown output
299
+ mutagent install diagnostics # Install @mutagent/diagnostics from npm (login-gated)
300
+ mutagent install evaluator # Install @mutagent/evaluator from npm
301
+ mutagent install evaluator --version 1.2.3 # Pin a specific version
302
+ mutagent install helix # Self-hosted install (may return NOT_IMPLEMENTED — pending)
450
303
  ```
451
304
 
452
- | Framework | Package | Description |
453
- |-----------|---------|-------------|
454
- | `mastra` | `@mastra/core` | Modern AI agent framework |
455
- | `langchain` | `langchain` | Popular LLM framework |
456
- | `langgraph` | `@langchain/langgraph` | Agent workflow framework |
457
- | `vercel-ai` | `ai` | AI SDK for streaming chat |
458
- | `openai` | `openai` | Direct OpenAI SDK integration |
459
- | `claude-code` | MCP Server | Native Anthropic integration |
460
- | `generic` | `openai` | Any OpenAI-compatible API |
305
+ | Package | Source | Notes |
306
+ |---------|--------|-------|
307
+ | `diagnostics` | public npm | Installs today |
308
+ | `evaluator` | public npm | Installs today |
309
+ | `helix` | self-hosted | Pending may return `NOT_IMPLEMENTED` for now |
461
310
 
462
- ### Playground
311
+ ### Feedback (`feedback`)
463
312
 
464
313
  ```bash
465
- mutagent playground run <prompt-id> --input '{"topic": "AI"}'
466
- mutagent playground run <prompt-id> --input '{"topic": "AI"}' --stream
467
- mutagent playground run <prompt-id> --system "You are..." --human "Hello!"
468
- mutagent playground run <prompt-id> --messages '[{"role":"user","content":"Hi"}]'
469
- mutagent playground run <prompt-id> --input '{}' --model gpt-4o
470
- ```
314
+ # Report a bug or send product feedback (login-gated)
315
+ mutagent feedback send "describe what went wrong" --category cli
471
316
 
472
- ### Platform (Read-Only)
317
+ # Lifecycle-stage feedback
318
+ mutagent feedback send "eval gate unclear" --category stage:evaluate
473
319
 
474
- ```bash
475
- # Workspaces
476
- mutagent workspaces list
477
- mutagent workspaces get <id>
478
-
479
- # Providers
480
- mutagent providers list
481
- mutagent providers get <id>
482
- mutagent providers test <id>
483
-
484
- # Agents
485
- mutagent agents list
486
- mutagent agents get <id>
487
- mutagent agents create --name "Agent" --slug agent --system-prompt "..."
488
- mutagent agents update <id> --status paused
489
- mutagent agents delete <id>
320
+ # Link to a session and attach your coding-agent transcript
321
+ mutagent feedback send "the CLI crashed on init" \
322
+ --category cli --session <session-id> --attach-transcript
490
323
  ```
491
324
 
325
+ | Flag | Description |
326
+ |------|-------------|
327
+ | `<feedback>` | Feedback body / content (required, ≤10000 chars) |
328
+ | `--title <string>` | Optional 5–8 word summary of the session timeline |
329
+ | `--category <value>` | `cli` (default) · `helix` · `stage:<spec\|build\|evaluate\|diagnose\|optimize>` |
330
+ | `--session <id>` | Link feedback to a session id (server `sessionId`) |
331
+ | `--attach-transcript [path]` | Attach the coding-agent session JSONL (bare = auto-detect newest) |
332
+
492
333
  ---
493
334
 
494
335
  ## AI-First Usage
495
336
 
496
- Every command supports `--json` for machine-readable output with `_links` to the web dashboard:
337
+ Every command supports `--json` for machine-readable output with `_directive`
338
+ (next-step guidance for agents) and `_links` (dashboard/API URLs):
497
339
 
498
340
  ```bash
499
341
  # Zero-config with env var
500
- export MUTAGENT_API_KEY="mg_live_xxxx"
342
+ export MUTAGENT_API_KEY="mt_live_xxxx"
501
343
 
502
- # Discover commands
344
+ # Discover the surface
503
345
  mutagent --help
346
+ mutagent --version --json
504
347
 
505
- # JSON output with deep links
506
- mutagent prompts list --json
507
- mutagent prompts get <id> --json
508
-
509
- # Inline JSON for create/update (recommended for AI agents)
510
- mutagent prompts create -d '{"name":"my-prompt","systemPrompt":"...","outputSchema":{...}}'
348
+ # JSON output
349
+ mutagent workspaces list --json
350
+ mutagent providers list --models --json
351
+ mutagent usage --json
511
352
 
512
353
  # Non-interactive mode
513
- mutagent prompts list --non-interactive
354
+ mutagent init --non-interactive
514
355
 
515
- # Generate integration code (raw markdown)
516
- mutagent integrate langchain --raw
517
-
518
- # Install skill for Claude Code
356
+ # Install the skill so agents can self-serve
519
357
  mutagent skills install
520
358
  ```
521
359
 
522
- ### JSON Output Format
360
+ ### JSON Directive & Links
523
361
 
524
- ```json
525
- {
526
- "data": { "id": 42, "name": "my-prompt", "..." : "..." },
527
- "_links": {
528
- "dashboard": "https://app.mutagent.io/prompts/dashboard?prompt=42",
529
- "api": "/api/prompts/42",
530
- "datasets": "https://app.mutagent.io/prompts/dashboard?prompt=42&tab=datasets",
531
- "evaluations": "https://app.mutagent.io/prompts/dashboard?prompt=42&tab=evaluations"
532
- }
533
- }
534
- ```
362
+ `--json` responses may include:
363
+
364
+ | Field | Meaning |
365
+ |-------|---------|
366
+ | `_directive.renderedCard` | Pre-formatted status card — agents **must** echo it verbatim in chat |
367
+ | `_directive.instruction` | Self-contained next step for the agent |
368
+ | `_directive.next` | Array of suggested follow-up commands |
369
+ | `_links` | Dashboard / API URLs |
370
+ | `_compat` | Compat metadata: `cliVersion`, `skillVersion`, `skillMinCliVersion` |
535
371
 
536
372
  ### Exit Codes
537
373
 
@@ -547,43 +383,19 @@ mutagent skills install
547
383
 
548
384
  ---
549
385
 
550
- ## State Tracking
551
-
552
- The CLI maintains local state to track your MutagenT workflow:
553
-
554
- | Artifact | Location | Purpose |
555
- |----------|----------|---------|
556
- | **Mutation context** | `.mutagent/mutation-context.md` | Tracks discovered prompts, uploaded resources, optimization history |
557
- | **Comment markers** | Source files | `MutagenT:START` / `MutagenT:END` markers identifying managed prompts |
558
- | **Auth status** | `mutagent auth status` | Shows onboarding state, context file status, resource counts |
559
- | **Claude Code skill** | `.claude/skills/mutagent-cli/SKILL.md` | Teaches AI agents how to use MutagenT CLI |
560
-
561
- ```bash
562
- # Scan codebase and populate context
563
- mutagent explore
564
-
565
- # Check your current state
566
- mutagent auth status
567
-
568
- # Install Claude Code skill
569
- mutagent skills install
570
- ```
571
-
572
- ---
573
-
574
386
  ## Configuration
575
387
 
576
388
  ### Environment Variables
577
389
 
578
390
  ```bash
579
- MUTAGENT_API_KEY=mg_live_xxxxxxxx
391
+ MUTAGENT_API_KEY=mt_live_xxxxxxxx
580
392
  MUTAGENT_ENDPOINT=https://api.mutagent.io
581
393
  MUTAGENT_APP_URL=https://app.mutagent.io
582
394
  ```
583
395
 
584
396
  ### RC Files
585
397
 
586
- Create `.mutagentrc.json`:
398
+ `mutagent init` writes `.mutagentrc.json`. Example:
587
399
 
588
400
  ```json
589
401
  {
@@ -601,28 +413,8 @@ mutagent config set org <id> # Required for org-scoped API keys
601
413
 
602
414
  ### Global Config
603
415
 
604
- Stored in `~/.config/mutagent/credentials.json` (created by `mutagent auth login`).
605
-
606
- ---
607
-
608
- ## Migration from Langfuse
609
-
610
- ```typescript
611
- // Before (Langfuse)
612
- import { Langfuse } from 'langfuse';
613
- const langfuse = new Langfuse({
614
- publicKey: process.env.LANGFUSE_PUBLIC_KEY,
615
- secretKey: process.env.LANGFUSE_SECRET_KEY,
616
- });
617
-
618
- // After (MutagenT)
619
- import { initTracing } from '@mutagent/sdk/tracing';
620
- initTracing({ apiKey: process.env.MUTAGENT_API_KEY! });
621
-
622
- // Framework-specific: use integration packages
623
- import { MutagentCallbackHandler } from '@mutagent/langchain';
624
- const handler = new MutagentCallbackHandler();
625
- ```
416
+ Credentials are stored in `~/.config/mutagent/credentials.json` (created by
417
+ `mutagent login`).
626
418
 
627
419
  ---
628
420
 
@@ -631,7 +423,7 @@ const handler = new MutagentCallbackHandler();
631
423
  ### Prerequisites
632
424
 
633
425
  - [Bun](https://bun.sh) >= 1.0.0
634
- - Node.js >= 18.0.0 (fallback)
426
+ - Node.js >= 22.0.0 (fallback)
635
427
 
636
428
  ### Setup
637
429
 
@@ -646,11 +438,11 @@ bun install
646
438
  ```bash
647
439
  bun run dev # Run in development mode
648
440
  bun run build # Build
649
- bun run typecheck # Type check
441
+ bun run type-check # Type check
650
442
  bun run lint # Lint
651
443
  bun run lint:fix # Lint with auto-fix
652
- bun run test # Run all tests (574+ tests)
653
- bun run verify # Full verification (lint + typecheck + build + test)
444
+ bun run test # Run all tests
445
+ bun run verify # Full verification (lint + type-check + build)
654
446
  ```
655
447
 
656
448
  ---
@@ -660,8 +452,6 @@ bun run verify # Full verification (lint + typecheck + build + test)
660
452
  - **[@mutagent/sdk](https://www.npmjs.com/package/@mutagent/sdk)** — TypeScript SDK for programmatic access
661
453
  - **[docs.mutagent.io](https://docs.mutagent.io)** — Full platform documentation
662
454
  - **[CLI Commands Reference](https://docs.mutagent.io/cli/commands)** — All commands with flags
663
- - **[Integration Guides](https://docs.mutagent.io/integrations/overview)** — Mastra, LangChain, LangGraph, Vercel AI
664
- - **[Tracing Setup](https://docs.mutagent.io/tracing/setup)** — OTel integration walkthrough
665
455
  - **[mutagent.io](https://mutagent.io)** — Homepage
666
456
 
667
457
  ---