orizu 0.3.5 → 0.3.6

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
@@ -35,12 +35,16 @@ Install the CLI globally with your package manager:
35
35
  | pnpm | `pnpm add -g orizu` |
36
36
  | Bun | `bun add -g orizu` |
37
37
 
38
- Install the companion coding agent skill using [Skills.sh](https://skills.sh).
38
+ Install the companion coding-agent skill from the CLI package:
39
39
 
40
40
  ```bash
41
- npx skills add raveeshbhalla/orizu-cli --skill orizu-cli
41
+ orizu install-skill --target agent-user --yes
42
42
  ```
43
43
 
44
+ The npm package ships the skill alongside the CLI. Use `orizu install-skill --help`
45
+ to see all supported targets, including Codex project, Claude user/project, and
46
+ `AGENTS.md` installs.
47
+
44
48
  ## Authentication
45
49
 
46
50
  **Sign in**
@@ -71,6 +75,17 @@ orizu logout
71
75
  <th>Task</th>
72
76
  <th>Command</th>
73
77
  </tr>
78
+ <tr>
79
+ <td colspan="2"><strong>Agent setup</strong></td>
80
+ </tr>
81
+ <tr>
82
+ <td>Install the bundled agent skill</td>
83
+ <td><code>orizu install-skill --target agent-user --yes</code></td>
84
+ </tr>
85
+ <tr>
86
+ <td>Inspect CLI capabilities as JSON</td>
87
+ <td><code>orizu capabilities --json</code></td>
88
+ </tr>
74
89
  <tr>
75
90
  <td colspan="2"><strong>Teams</strong></td>
76
91
  </tr>
@@ -203,10 +218,13 @@ orizu logout
203
218
  --dataset &lt;datasetId&gt; \
204
219
  --app &lt;appId&gt; \
205
220
  --title "Support QA Round 1" \
206
- --assignees &lt;userIdOrEmail1,userIdOrEmail2&gt; \
207
221
  --labels-per-item 2</code></pre>
208
222
  </td>
209
223
  </tr>
224
+ <tr>
225
+ <td>Publish a draft task</td>
226
+ <td><code>orizu tasks publish --task &lt;taskId&gt; --assignees &lt;userId1,userId2&gt;</code></td>
227
+ </tr>
210
228
  <tr>
211
229
  <td>Check task status</td>
212
230
  <td><code>orizu tasks status --task &lt;taskId&gt;</code></td>
@@ -215,6 +233,10 @@ orizu logout
215
233
  <td>Pause a task</td>
216
234
  <td><code>orizu tasks pause --task &lt;taskId&gt;</code></td>
217
235
  </tr>
236
+ <tr>
237
+ <td>Upload a task report</td>
238
+ <td><code>orizu tasks report set --task &lt;taskId&gt; --report-file ./report.md</code></td>
239
+ </tr>
218
240
  <tr>
219
241
  <td>Resume a task</td>
220
242
  <td><code>orizu tasks unpause --task &lt;taskId&gt;</code></td>
package/dist/help.js ADDED
@@ -0,0 +1,611 @@
1
+ const GLOBAL_OPTIONS = [
2
+ ['--local', 'Use http://localhost:3000.'],
3
+ ['--server <url>', 'Use a specific server origin, for example https://preview.example.com.'],
4
+ ['--version, -v', 'Print the orizu CLI version.'],
5
+ ['--help, -h', 'Show help for the root command, a group, or a specific command.'],
6
+ ];
7
+ const GROUPS = [
8
+ { name: 'Auth', summary: 'Sign in, sign out, and inspect the active CLI identity.' },
9
+ { name: 'Agent setup', summary: 'Install the bundled Orizu coding-agent skill and inspect the CLI surface.' },
10
+ { name: 'Teams', summary: 'Manage teams and team memberships.' },
11
+ { name: 'Projects', summary: 'Manage projects inside teams.' },
12
+ { name: 'Prompts and judges', summary: 'Work with versioned prompt and judge artifacts.' },
13
+ { name: 'Scorers and runners', summary: 'Register scorers, push runnable artifacts, execute runners, and submit scores.' },
14
+ { name: 'Optimizations', summary: 'Start, run, export, and finalize optimization runs.' },
15
+ { name: 'Apps', summary: 'Create, preview, update, inspect, and export review apps.' },
16
+ { name: 'Tasks', summary: 'Create review tasks, mutate task status, assign reviewers, and export labels.' },
17
+ { name: 'Datasets', summary: 'Upload, version, split, mutate, export, lock, clone, and delete datasets.' },
18
+ ];
19
+ export const COMMAND_DOCS = [
20
+ {
21
+ path: ['login'],
22
+ usage: 'orizu login [--no-prompt-if-logged-in]',
23
+ summary: 'Open the browser login flow and store CLI credentials for the selected server.',
24
+ group: 'Auth',
25
+ options: [
26
+ { name: '--no-prompt-if-logged-in', help: 'Return immediately when credentials already exist.' },
27
+ ],
28
+ examples: ['orizu login', 'orizu --local login'],
29
+ },
30
+ {
31
+ path: ['logout'],
32
+ usage: 'orizu logout',
33
+ summary: 'Clear local credentials and best-effort revoke the active CLI token remotely.',
34
+ group: 'Auth',
35
+ },
36
+ {
37
+ path: ['whoami'],
38
+ usage: 'orizu whoami',
39
+ summary: 'Print the authenticated user and active server.',
40
+ group: 'Auth',
41
+ },
42
+ {
43
+ path: ['env'],
44
+ usage: 'orizu env [--project <team/project>] [--project-id <projectId>]',
45
+ summary: 'Print environment values for local runners and agent workflows.',
46
+ group: 'Auth',
47
+ },
48
+ {
49
+ path: ['log'],
50
+ usage: 'orizu log <event_type> --run-id <id> --sequence <n> --payload @event.json',
51
+ summary: 'Submit an optimization event payload.',
52
+ group: 'Optimizations',
53
+ },
54
+ {
55
+ path: ['install-skill'],
56
+ usage: 'orizu install-skill [--target <target>]... [--yes] [--dry-run]',
57
+ summary: 'Install the bundled Orizu CLI skill locally for coding agents.',
58
+ group: 'Agent setup',
59
+ aliases: [['skills', 'install']],
60
+ options: [
61
+ {
62
+ name: '--target <target>',
63
+ help: 'Install destination. Repeat for multiple targets.',
64
+ repeatable: true,
65
+ choices: ['agent-user', 'codex-project', 'claude-user', 'claude-project', 'agents-md'],
66
+ },
67
+ { name: '--yes', help: 'Replace an existing managed skill or AGENTS.md section without prompting.' },
68
+ { name: '--dry-run', help: 'Show planned writes without changing files.' },
69
+ ],
70
+ examples: [
71
+ 'orizu install-skill --target agent-user --yes',
72
+ 'orizu install-skill --target codex-project --target agents-md',
73
+ 'orizu skills install --target claude-user --dry-run',
74
+ ],
75
+ },
76
+ {
77
+ path: ['capabilities'],
78
+ usage: 'orizu capabilities [--json]',
79
+ summary: 'List the CLI command surface in human-readable or JSON form.',
80
+ group: 'Agent setup',
81
+ options: [
82
+ { name: '--json', help: 'Emit a machine-readable command manifest.' },
83
+ ],
84
+ examples: ['orizu capabilities --json', 'orizu --json capabilities'],
85
+ },
86
+ {
87
+ path: ['teams', 'list'],
88
+ usage: 'orizu teams list',
89
+ summary: 'List teams available to the authenticated user.',
90
+ group: 'Teams',
91
+ },
92
+ {
93
+ path: ['teams', 'create'],
94
+ usage: 'orizu teams create [--name <name>]',
95
+ summary: 'Create a team. Prompts for a name in an interactive terminal if omitted.',
96
+ group: 'Teams',
97
+ },
98
+ {
99
+ path: ['teams', 'members', 'list'],
100
+ usage: 'orizu teams members list [--team <teamSlug>]',
101
+ summary: 'List team members with member IDs, canonical user IDs, emails, and roles.',
102
+ group: 'Teams',
103
+ },
104
+ {
105
+ path: ['teams', 'members', 'add'],
106
+ usage: 'orizu teams members add --email <email> [--team <teamSlug>]',
107
+ summary: 'Invite or add a team member by email.',
108
+ group: 'Teams',
109
+ },
110
+ {
111
+ path: ['teams', 'members', 'remove'],
112
+ usage: 'orizu teams members remove --email <email> [--team <teamSlug>]',
113
+ summary: 'Remove a team member by email.',
114
+ group: 'Teams',
115
+ },
116
+ {
117
+ path: ['teams', 'members', 'role'],
118
+ usage: 'orizu teams members role --team <teamSlug> --email <email> --role <admin|member>',
119
+ summary: 'Change a member role.',
120
+ group: 'Teams',
121
+ },
122
+ {
123
+ path: ['projects', 'list'],
124
+ usage: 'orizu projects list [--team <teamSlug>]',
125
+ summary: 'List projects, optionally scoped to one team.',
126
+ group: 'Projects',
127
+ },
128
+ {
129
+ path: ['projects', 'create'],
130
+ usage: 'orizu projects create --name <name> [--team <teamSlug>]',
131
+ summary: 'Create a project inside a team.',
132
+ group: 'Projects',
133
+ },
134
+ {
135
+ path: ['prompts', 'list'],
136
+ usage: 'orizu prompts list --project <team/project>',
137
+ summary: 'List prompt artifacts in a project.',
138
+ group: 'Prompts and judges',
139
+ },
140
+ {
141
+ path: ['prompts', 'comments'],
142
+ usage: 'orizu prompts comments <prompt-id-or-name> --project <team/project> [--label <label> | --version <id>] [--json]',
143
+ summary: 'List prompt comment threads with open/resolved status and replies.',
144
+ group: 'Prompts and judges',
145
+ },
146
+ {
147
+ path: ['prompts', 'pull'],
148
+ usage: 'orizu prompts pull <prompt-id-or-name> --project <team/project> --out <dir> [--label <label> | --version <id>] [--json]',
149
+ summary: 'Pull a prompt artifact version to a local directory.',
150
+ group: 'Prompts and judges',
151
+ },
152
+ {
153
+ path: ['prompts', 'push'],
154
+ usage: 'orizu prompts push <dir> [--runner-version <id>] [--project <team/project>] [--parent <version-id>] [--json]',
155
+ summary: 'Push a local prompt artifact directory as a new version.',
156
+ group: 'Prompts and judges',
157
+ },
158
+ {
159
+ path: ['prompts', 'labels', 'set'],
160
+ usage: 'orizu prompts labels set <prompt-name> <label> --version <version-id> [--project <team/project>] [--json]',
161
+ summary: 'Move or set a prompt label to a version.',
162
+ group: 'Prompts and judges',
163
+ },
164
+ {
165
+ path: ['prompts', 'scorers', 'set-headline'],
166
+ usage: 'orizu prompts scorers set-headline <prompt-id> --scorer-version <id> [--dataset-version <id> --split-set <id> --split <name>] [--project <team/project>] [--json]',
167
+ summary: 'Bind the headline scorer for a prompt.',
168
+ group: 'Scorers and runners',
169
+ },
170
+ {
171
+ path: ['prompts', 'scorers', 'add'],
172
+ usage: 'orizu prompts scorers add <prompt-id> --scorer-version <id> [--dataset-version <id> --split-set <id> --split <name>] [--project <team/project>] [--json]',
173
+ summary: 'Track an additional scorer for a prompt.',
174
+ group: 'Scorers and runners',
175
+ },
176
+ {
177
+ path: ['judges', 'list'],
178
+ usage: 'orizu judges list --project <team/project>',
179
+ summary: 'List judge prompt artifacts in a project.',
180
+ group: 'Prompts and judges',
181
+ },
182
+ {
183
+ path: ['judges', 'pull'],
184
+ usage: 'orizu judges pull <judge-id-or-name> --project <team/project> --out <dir> [--label <label> | --version <id>] [--json]',
185
+ summary: 'Pull a judge artifact version to a local directory.',
186
+ group: 'Prompts and judges',
187
+ },
188
+ {
189
+ path: ['judges', 'push'],
190
+ usage: 'orizu judges push <dir> [--runner-version <id>] [--project <team/project>] [--parent <version-id>] [--json]',
191
+ summary: 'Push a local judge artifact directory as a new version.',
192
+ group: 'Prompts and judges',
193
+ },
194
+ {
195
+ path: ['scorers', 'list'],
196
+ usage: 'orizu scorers list --project <team/project>',
197
+ summary: 'List scorers in a project.',
198
+ group: 'Scorers and runners',
199
+ },
200
+ {
201
+ path: ['scorers', 'register'],
202
+ usage: 'orizu scorers register --project <team/project> --name <name> --manifest <manifest.json> [--prompt-version <id>] [--runner-version <id>] [--label <label>] [--json]',
203
+ summary: 'Register a scorer from a local manifest.',
204
+ group: 'Scorers and runners',
205
+ },
206
+ {
207
+ path: ['scorers', 'detail'],
208
+ usage: 'orizu scorers detail <scorer-id-or-name> --project <team/project> [--json]',
209
+ summary: 'Show scorer details.',
210
+ group: 'Scorers and runners',
211
+ },
212
+ {
213
+ path: ['scorers', 'labels', 'set'],
214
+ usage: 'orizu scorers labels set <scorer-name> <label> --version <scorer-version-id> [--project <team/project>] [--json]',
215
+ summary: 'Move or set a scorer label to a version.',
216
+ group: 'Scorers and runners',
217
+ },
218
+ {
219
+ path: ['scorers', 'exec'],
220
+ usage: 'orizu scorers exec --scorer-version <id> (--subject-version <prompt-version-id> | --optimization-run <id> --candidate <id>) --dataset-version <id> --split-set <id> --split <name> [--subject-results <jsonl>] [--dependency-score-run <alias=id>] [--dependency-results <alias=path>] [--no-submit] [--out <score.json>] [--project <team/project>] [--json]',
221
+ summary: 'Execute a scorer locally for a prompt version or optimization candidate.',
222
+ group: 'Scorers and runners',
223
+ },
224
+ {
225
+ path: ['scores', 'submit'],
226
+ usage: 'orizu scores submit <results.jsonl|results.json> --scorer-version <id> (--subject-version <prompt-version-id> | --optimization-run <id> --candidate <id>) [--aggregate] [--dataset-version <id> --split-set <id> --split <name>] [--project <team/project>] [--json]',
227
+ summary: 'Submit score results for a scorer against a prompt version or optimization candidate.',
228
+ group: 'Scorers and runners',
229
+ },
230
+ {
231
+ path: ['runners', 'push'],
232
+ usage: 'orizu runners push <dir> [--project <team/project>] [--name <name>] [--label <label>] [--json]',
233
+ summary: 'Push a local runner artifact directory.',
234
+ group: 'Scorers and runners',
235
+ },
236
+ {
237
+ path: ['runners', 'exec'],
238
+ usage: 'orizu runners exec (--prompt <prompt-version-id> | --prompt-version <id> --runner-version <id> | --scorer-version <id>) --dataset-version <id> --split-set <id-or-name> --split <name> [--runner-dir <dir>] --out <results.jsonl|results.jsonl.gz>',
239
+ summary: 'Execute a runner locally against a dataset split and write row results.',
240
+ group: 'Scorers and runners',
241
+ },
242
+ {
243
+ path: ['optimizers', 'push'],
244
+ usage: 'orizu optimizers push <dir> [--project <team/project>] [--name <name>] [--label <label>] [--json]',
245
+ summary: 'Push a local optimizer artifact directory.',
246
+ group: 'Optimizations',
247
+ },
248
+ {
249
+ path: ['runs', 'submit'],
250
+ usage: 'orizu runs submit <results.jsonl|results.jsonl.gz> --prompt-version <id> --runner-version <id> --dataset-version <id> --split-set <id> --split <name> [--project <team/project>]',
251
+ summary: 'Submit local prompt-run results.',
252
+ group: 'Scorers and runners',
253
+ },
254
+ {
255
+ path: ['optimizations', 'start'],
256
+ usage: 'orizu optimizations start --project <team/project> --optimizer-version <id> --prompt-version <id[,id]> --selection-scorer <id> [--reflection-scorer <id>] [--pareto-scorer <id>] [--best-scorer <id>] --dataset-version <id> --split-set <id> [--train-split <name>] [--validation-split <name>] [--metadata <json|@file>] [--json]',
257
+ summary: 'Create an optimization run record.',
258
+ group: 'Optimizations',
259
+ },
260
+ {
261
+ path: ['optimizations', 'run-gepa'],
262
+ usage: 'orizu optimizations run-gepa --project <team/project> --optimizer-version-id <id> --candidate-version-id <id> --runner-version-id <id> --candidate-runner-dir <dir> --scorer-version-id <id> --scorer-runner-version-id <id> --scorer-runner-dir <dir> --dataset-version-id <id> --split-set-id <id> [--train-split train] [--val-split validation] [--log-dir logs]',
263
+ summary: 'Run the bundled GEPA-style optimizer locally and stream events.',
264
+ group: 'Optimizations',
265
+ },
266
+ {
267
+ path: ['optimizations', 'export'],
268
+ usage: 'orizu optimizations export <run-id> [--out <path>] [--json]',
269
+ summary: 'Export an optimization run to JSON.',
270
+ group: 'Optimizations',
271
+ },
272
+ {
273
+ path: ['optimizations', 'pause'],
274
+ usage: 'orizu optimizations pause <run-id> [--reason <text>] [--json]',
275
+ summary: 'Pause an optimization run.',
276
+ group: 'Optimizations',
277
+ },
278
+ {
279
+ path: ['optimizations', 'resume'],
280
+ usage: 'orizu optimizations resume <run-id> [--json]',
281
+ summary: 'Resume an optimization run.',
282
+ group: 'Optimizations',
283
+ },
284
+ {
285
+ path: ['optimizations', 'finish'],
286
+ usage: 'orizu optimizations finish <run-id> [--best-score <n>] [--best-candidate <id>] [--result-prompt-version <id>] [--report <markdown|@file> | --report-file <path>] [--metadata <json|@file>] [--json]',
287
+ summary: 'Mark an optimization run finished and attach final metadata/report data.',
288
+ group: 'Optimizations',
289
+ },
290
+ {
291
+ path: ['optimizations', 'fail'],
292
+ usage: 'orizu optimizations fail <run-id> [--reason <text>] [--report <markdown|@file> | --report-file <path>] [--metadata <json|@file>] [--json]',
293
+ summary: 'Mark an optimization run failed.',
294
+ group: 'Optimizations',
295
+ },
296
+ {
297
+ path: ['optimizations', 'cancel'],
298
+ usage: 'orizu optimizations cancel <run-id> [--reason <text>] [--report <markdown|@file> | --report-file <path>] [--metadata <json|@file>] [--json]',
299
+ summary: 'Cancel an optimization run.',
300
+ group: 'Optimizations',
301
+ },
302
+ {
303
+ path: ['apps', 'list'],
304
+ usage: 'orizu apps list [--project <team/project>]',
305
+ summary: 'List review apps in a project.',
306
+ group: 'Apps',
307
+ },
308
+ {
309
+ path: ['apps', 'create'],
310
+ usage: 'orizu apps create --project <team/project> --name <name> --dataset <datasetId> --file <path> --input-schema <json-path> --output-schema <json-path> [--component <name>]',
311
+ summary: 'Create a review app from a local component and schema files.',
312
+ group: 'Apps',
313
+ examples: [
314
+ 'orizu apps create --project core/evals --name "Support Labeler" --dataset <datasetId> --file ./App.tsx --input-schema ./input.json --output-schema ./output.json',
315
+ ],
316
+ },
317
+ {
318
+ path: ['apps', 'preview'],
319
+ usage: 'orizu apps preview --file <path> --input-schema <json-path> --output-schema <json-path> --sample-row <json-path> [--screenshot <png-path>] [--headed] [--keep-open] [--component <name>]',
320
+ summary: 'Render a local review app in the bundled preview runtime.',
321
+ group: 'Apps',
322
+ },
323
+ {
324
+ path: ['apps', 'update'],
325
+ usage: 'orizu apps update [--app <appId>] [--project <team/project>] --file <path> --input-schema <json-path> --output-schema <json-path> [--component <name>]',
326
+ summary: 'Create a new app version from local source and schemas.',
327
+ group: 'Apps',
328
+ },
329
+ {
330
+ path: ['apps', 'link-dataset'],
331
+ usage: 'orizu apps link-dataset --dataset <datasetId> [--app <appId>] [--project <team/project>] [--version <n>]',
332
+ summary: 'Link an app or app version to a dataset.',
333
+ group: 'Apps',
334
+ },
335
+ {
336
+ path: ['apps', 'detail'],
337
+ usage: 'orizu apps detail --app <appId> [--project <team/project>] [--json]',
338
+ summary: 'Show app detail.',
339
+ group: 'Apps',
340
+ },
341
+ {
342
+ path: ['apps', 'export'],
343
+ usage: 'orizu apps export [--app <appId>] [--project <team/project>] [--version <n>] [--out <path>]',
344
+ summary: 'Export app source for the selected app version.',
345
+ group: 'Apps',
346
+ },
347
+ {
348
+ path: ['tasks', 'list'],
349
+ usage: 'orizu tasks list [--project <team/project>]',
350
+ summary: 'List review tasks, optionally scoped to a project.',
351
+ group: 'Tasks',
352
+ },
353
+ {
354
+ path: ['tasks', 'create'],
355
+ usage: 'orizu tasks create --project <team/project> --dataset <datasetId> --app <appId> --title <title> [--assignees <userIdOrEmail1,userIdOrEmail2>] [--publish] [--version <n>] [--instructions <text>] [--labels-per-item <n>] [--json]',
356
+ summary: 'Create a draft review task by default, or publish immediately with --publish and assignees.',
357
+ group: 'Tasks',
358
+ },
359
+ {
360
+ path: ['tasks', 'publish'],
361
+ usage: 'orizu tasks publish --task <taskId> --assignees <userId1,userId2> [--json]',
362
+ summary: 'Publish an approved draft task and assign reviewers.',
363
+ group: 'Tasks',
364
+ },
365
+ {
366
+ path: ['tasks', 'assign'],
367
+ usage: 'orizu tasks assign --task <taskId> --assignees <userId1,userId2>',
368
+ summary: 'Assign a task to canonical user IDs.',
369
+ group: 'Tasks',
370
+ },
371
+ {
372
+ path: ['tasks', 'status'],
373
+ usage: 'orizu tasks status --task <taskId> [--json]',
374
+ summary: 'Show task assignment counts and progress.',
375
+ group: 'Tasks',
376
+ },
377
+ {
378
+ path: ['tasks', 'report', 'set'],
379
+ usage: 'orizu tasks report set --task <taskId> (--report <markdown|@file> | --report-file <path>) [--json]',
380
+ summary: 'Upload or replace a Markdown report for a paused or completed task.',
381
+ group: 'Tasks',
382
+ aliases: [['tasks', 'report', 'upload']],
383
+ options: [
384
+ { name: '--task <taskId>', help: 'Task ID to attach the report to.', required: true },
385
+ { name: '--report <markdown|@file>', help: 'Inline Markdown or an @file reference.' },
386
+ { name: '--report-file <path>', help: 'Markdown file to upload.' },
387
+ { name: '--json', help: 'Emit the updated report payload.' },
388
+ ],
389
+ examples: [
390
+ 'orizu tasks report set --task <taskId> --report-file ./report.md',
391
+ 'orizu tasks report upload --task <taskId> --report @./report.md',
392
+ ],
393
+ },
394
+ {
395
+ path: ['tasks', 'pause'],
396
+ usage: 'orizu tasks pause --task <taskId>',
397
+ summary: 'Pause a task.',
398
+ group: 'Tasks',
399
+ },
400
+ {
401
+ path: ['tasks', 'unpause'],
402
+ usage: 'orizu tasks unpause --task <taskId>',
403
+ summary: 'Resume a paused task.',
404
+ group: 'Tasks',
405
+ },
406
+ {
407
+ path: ['tasks', 'export'],
408
+ usage: 'orizu tasks export [--task <taskId>] [--format <csv|json|jsonl>] [--out <path>]',
409
+ summary: 'Export task results.',
410
+ group: 'Tasks',
411
+ },
412
+ {
413
+ path: ['datasets', 'upload'],
414
+ usage: 'orizu datasets upload --file <path> [--project <team/project>] [--name <name>] [--readme-file <README.md> | --readme-text <markdown>]',
415
+ summary: 'Upload a dataset from CSV, JSON, or JSONL.',
416
+ group: 'Datasets',
417
+ },
418
+ {
419
+ path: ['datasets', 'push'],
420
+ usage: 'orizu datasets push <path> [--project <team/project>] [--name <name>] [--readme-file <README.md> | --readme-text <markdown>] [--json]',
421
+ summary: 'Upload a dataset with a path-first, automation-friendly command shape.',
422
+ group: 'Datasets',
423
+ },
424
+ {
425
+ path: ['datasets', 'readme', 'set'],
426
+ usage: 'orizu datasets readme set <datasetId|dataset-name> [--project <team/project>] (--readme-file <README.md> | --readme-text <markdown>) [--json]',
427
+ summary: 'Set or replace dataset README markdown.',
428
+ group: 'Datasets',
429
+ },
430
+ {
431
+ path: ['datasets', 'versions', 'create'],
432
+ usage: 'orizu datasets versions create <datasetId|dataset-name> [--project <team/project>] [--label <label>] [--readme-file <README.md> | --readme-text <markdown>] [--json]',
433
+ summary: 'Create a dataset version.',
434
+ group: 'Datasets',
435
+ },
436
+ {
437
+ path: ['datasets', 'splits', 'create'],
438
+ usage: 'orizu datasets splits create <datasetVersionId> [--from-file <split.json>] [--json]',
439
+ summary: 'Create a split set for a dataset version.',
440
+ group: 'Datasets',
441
+ },
442
+ {
443
+ path: ['datasets', 'download'],
444
+ usage: 'orizu datasets download [--dataset <datasetId|datasetUrl>] [--project <team/project>] [--format <csv|json|jsonl>] [--out <path>]',
445
+ summary: 'Download a dataset.',
446
+ group: 'Datasets',
447
+ },
448
+ {
449
+ path: ['datasets', 'append'],
450
+ usage: 'orizu datasets append [--dataset <datasetId|datasetUrl>] [--project <team/project>] --file <path>',
451
+ summary: 'Append rows to an unlocked dataset.',
452
+ group: 'Datasets',
453
+ },
454
+ {
455
+ path: ['datasets', 'edit-rows'],
456
+ usage: 'orizu datasets edit-rows [--dataset <datasetId|datasetUrl>] [--project <team/project>] --file <path>',
457
+ summary: 'Edit rows by canonical row ID.',
458
+ group: 'Datasets',
459
+ },
460
+ {
461
+ path: ['datasets', 'delete-rows'],
462
+ usage: 'orizu datasets delete-rows [--dataset <datasetId|datasetUrl>] [--project <team/project>] --row-ids <id1,id2>',
463
+ summary: 'Delete specific rows by canonical row ID.',
464
+ group: 'Datasets',
465
+ },
466
+ {
467
+ path: ['datasets', 'delete'],
468
+ usage: 'orizu datasets delete [--dataset <datasetId|datasetUrl>] [--project <team/project>]',
469
+ summary: 'Delete a whole dataset after interactive ID confirmation.',
470
+ group: 'Datasets',
471
+ },
472
+ {
473
+ path: ['datasets', 'lock'],
474
+ usage: 'orizu datasets lock [--dataset <datasetId|datasetUrl>] [--project <team/project>] [--reason <text>]',
475
+ summary: 'Lock a dataset against row mutations.',
476
+ group: 'Datasets',
477
+ },
478
+ {
479
+ path: ['datasets', 'clone'],
480
+ usage: 'orizu datasets clone [--dataset <datasetId|datasetUrl>] [--project <team/project>] [--name <name>]',
481
+ summary: 'Clone a dataset.',
482
+ group: 'Datasets',
483
+ },
484
+ ];
485
+ function groupByName(name) {
486
+ return GROUPS.find(group => group.name === name);
487
+ }
488
+ function commandKey(path) {
489
+ return path.join(' ');
490
+ }
491
+ export function findCommandDoc(args) {
492
+ const key = commandKey(args);
493
+ return COMMAND_DOCS.find(doc => commandKey(doc.path) === key ||
494
+ doc.aliases?.some(alias => commandKey(alias) === key));
495
+ }
496
+ export function commandDocsWithPrefix(args) {
497
+ if (args.length === 0) {
498
+ return COMMAND_DOCS;
499
+ }
500
+ return COMMAND_DOCS.filter(doc => args.every((part, index) => doc.path[index] === part) &&
501
+ doc.path.length > args.length);
502
+ }
503
+ function formatRows(rows, indent = ' ') {
504
+ const width = Math.max(...rows.map(row => row[0].length));
505
+ return rows.map(([left, right]) => `${indent}${left.padEnd(width)} ${right}`);
506
+ }
507
+ export function renderRootHelp() {
508
+ const lines = [
509
+ 'orizu',
510
+ '',
511
+ 'Usage:',
512
+ ' orizu [global options] <command> [options]',
513
+ ' orizu help <command>',
514
+ '',
515
+ 'Global options:',
516
+ ...formatRows(GLOBAL_OPTIONS),
517
+ '',
518
+ 'Commands:',
519
+ ];
520
+ for (const group of GROUPS) {
521
+ const docs = COMMAND_DOCS.filter(doc => doc.group === group.name);
522
+ if (docs.length === 0) {
523
+ continue;
524
+ }
525
+ lines.push(``, ` ${group.name}:`);
526
+ for (const doc of docs) {
527
+ lines.push(` ${doc.usage}`);
528
+ }
529
+ }
530
+ lines.push('', 'Examples:', ' orizu install-skill --target agent-user --yes', ' orizu apps preview --file ./App.tsx --input-schema ./input.json --output-schema ./output.json --sample-row ./row.json --screenshot ./preview.png', ' orizu tasks create --project core/evals --dataset <datasetId> --app <appId> --title "Review"', ' orizu tasks publish --task <taskId> --assignees <userId1,userId2>', '', 'More:', ' orizu <group> --help', ' orizu <command> --help', ' orizu capabilities --json', ' https://docs.orizu.ai');
531
+ return lines.join('\n');
532
+ }
533
+ export function renderGroupHelp(args) {
534
+ const docs = commandDocsWithPrefix(args);
535
+ const label = commandKey(args);
536
+ const group = docs.length > 0 ? groupByName(docs[0].group) : undefined;
537
+ const lines = [
538
+ `orizu ${label}`,
539
+ '',
540
+ group?.summary || `Commands under ${label}.`,
541
+ '',
542
+ 'Usage:',
543
+ ` orizu ${label} <command> [options]`,
544
+ '',
545
+ 'Commands:',
546
+ ...docs.map(doc => ` ${doc.usage}`),
547
+ '',
548
+ 'More:',
549
+ ` orizu ${label} <command> --help`,
550
+ ];
551
+ return lines.join('\n');
552
+ }
553
+ export function renderCommandHelp(doc) {
554
+ const lines = [
555
+ commandKey(doc.path),
556
+ '',
557
+ doc.summary,
558
+ '',
559
+ 'Usage:',
560
+ ` ${doc.usage}`,
561
+ ];
562
+ if (doc.aliases?.length) {
563
+ lines.push('', 'Aliases:', ...doc.aliases.map(alias => ` orizu ${commandKey(alias)}`));
564
+ }
565
+ if (doc.options?.length) {
566
+ lines.push('', 'Options:');
567
+ for (const option of doc.options) {
568
+ const suffix = option.choices?.length ? ` Choices: ${option.choices.join(', ')}.` : '';
569
+ lines.push(` ${option.name}${option.required ? ' (required)' : ''}${option.repeatable ? ' (repeatable)' : ''}`);
570
+ lines.push(` ${option.help}${suffix}`);
571
+ }
572
+ }
573
+ if (doc.examples?.length) {
574
+ lines.push('', 'Examples:', ...doc.examples.map(example => ` ${example}`));
575
+ }
576
+ return lines.join('\n');
577
+ }
578
+ export function renderHelpForArgs(args) {
579
+ if (args.length === 0) {
580
+ return renderRootHelp();
581
+ }
582
+ const doc = findCommandDoc(args);
583
+ if (doc) {
584
+ return renderCommandHelp(doc);
585
+ }
586
+ const groupDocs = commandDocsWithPrefix(args);
587
+ if (groupDocs.length > 0) {
588
+ return renderGroupHelp(args);
589
+ }
590
+ return renderRootHelp();
591
+ }
592
+ export function getCapabilities(version) {
593
+ return {
594
+ name: 'orizu',
595
+ version,
596
+ commands: COMMAND_DOCS.map(doc => ({
597
+ name: commandKey(doc.path),
598
+ usage: doc.usage,
599
+ help: doc.summary,
600
+ group: doc.group,
601
+ aliases: doc.aliases?.map(commandKey) || [],
602
+ params: (doc.options || []).map(option => ({
603
+ name: option.name,
604
+ help: option.help,
605
+ required: Boolean(option.required),
606
+ repeatable: Boolean(option.repeatable),
607
+ choices: option.choices || undefined,
608
+ })),
609
+ })),
610
+ };
611
+ }