@hagicode/cli 0.3.0 → 0.4.0

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
@@ -110,11 +110,11 @@ $ echo $?
110
110
  hagi
111
111
  |-- project list | repositories | create | update | delete
112
112
  | `-- monospecs show | init | set | validate | reload | clone | remove-checkout
113
- |-- proposal list | create | optimize-description | generate | annotate | execute | archive | status | complete | send
113
+ |-- proposal list | create | optimize-description | generate | annotate | execute | archive | status | complete | send | get | messages
114
114
  |-- vault list | create | update | delete
115
115
  | `-- files list | preview
116
116
  |-- chat list | create | archive | delete | send
117
- |-- hagitask list | schema | create | send
117
+ |-- hagitask list | schema | create | send | get | messages
118
118
  |-- plan list | get | create | update | enable | disable | delete | run
119
119
  `-- skills local list | enable | disable | uninstall
120
120
  gallery search | detail | install
@@ -260,6 +260,17 @@ hagi proposal complete --session-id "$PROPOSAL_ID"
260
260
  hagi proposal archive --session-id "$PROPOSAL_ID"
261
261
  ```
262
262
 
263
+ ### Follow a Run
264
+
265
+ `proposal get` reads one session. With `--wait` it polls until the status settles, so the next lifecycle command runs at the right time. `proposal messages` reads the session's messages, newest first.
266
+
267
+ ```bash
268
+ hagi proposal get --session-id "$PROPOSAL_ID" --wait --json
269
+ hagi proposal messages --session-id "$PROPOSAL_ID" --last 1 --json
270
+ ```
271
+
272
+ The options are the same as `hagitask get`. WaitingForReply counts as settled, because a person must answer. Which stage each command starts is in [references/openspec-workflow.md](skills/hagi/references/openspec-workflow.md).
273
+
263
274
  ### Explicit Lifecycle Sequence
264
275
 
265
276
  The CLI keeps proposal lifecycle actions explicit and non-interactive. Each command maps to one backend action:
@@ -357,8 +368,8 @@ hagi hagitask list --json
357
368
  `hagitask schema` shows one task's target scope, commands, parameters, requirements and scenes. Each required parameter is marked `yes`. The `--json` output adds the input JSON Schema and an example request body:
358
369
 
359
370
  ```bash
360
- hagi hagitask schema --task-id compose-commit
361
- hagi hagitask schema --task-id compose-commit --json
371
+ hagi hagitask schema --task-id <task-id>
372
+ hagi hagitask schema --task-id <task-id> --json
362
373
  ```
363
374
 
364
375
  Write the input file. Its keys are the parameter keys the schema lists under `inputs`, plus the `targets` and `targetScopes` keys when the schema's scope lists targets. For example, `input.json` for a task with one required input:
@@ -375,17 +386,28 @@ Create the session from that task and input. The new id is read from `session.se
375
386
 
376
387
  ```bash
377
388
  HAGITASK_ID=$(hagi hagitask create \
378
- --title "Auto compose commit" \
389
+ --title "Auto task" \
379
390
  --project-id "$PROJECT_ID" \
380
- --task-id compose-commit \
391
+ --task-id <task-id> \
381
392
  --input input.json \
393
+ --json | json_field '.session.sessionId')
394
+ ```
395
+
396
+ Super Commit is a prompt, not a preset task. It has no schema and takes no `--input`. Start it with its prompt id, and pass the Git options it accepts:
397
+
398
+ ```bash
399
+ SUPER_COMMIT_ID=$(hagi hagitask create \
400
+ --title "Commit the CLI changes" \
401
+ --project-id "$PROJECT_ID" \
402
+ --prompt-id auto-compose-commit.en-US \
382
403
  --repository-path repos/cli \
383
- --need-push \
384
404
  --target-branch-mode new-custom \
385
405
  --target-branch-name feature/cli-completion \
386
406
  --json | json_field '.session.sessionId')
387
407
  ```
388
408
 
409
+ Start a Super Commit only when the user asked for it. Add `--need-push` only when the user asked for a push. See [references/super-commit.md](skills/hagi/references/super-commit.md) for the options, the branch modes, the result and the explicit-request rule.
410
+
389
411
  Use `--prompt-id` instead of `--task-id` for a prompt template with no structured input. `--input` needs `--task-id`. Input is read from a file, or from stdin with `--input -`. The CLI only checks that the input is a JSON object. The backend checks the keys and values. It rejects a key that the schema does not list, and a missing required value. Its error is printed unchanged, and no session is reported as created. `--hero-selection-mode` takes `first` (the default) or `random`.
390
412
 
391
413
  The backend must have a hero available for the task's script. Without one, `hagitask create` fails with a 400 whose error is `no-executable-hero`.
@@ -396,6 +418,15 @@ Send a follow-up message to the HagiTask session:
396
418
  hagi hagitask send --session-id "$HAGITASK_ID" --content "Retry with a smaller diff"
397
419
  ```
398
420
 
421
+ Read one HagiTask session, or wait until its status settles, and read its messages:
422
+
423
+ ```bash
424
+ hagi hagitask get --session-id "$SUPER_COMMIT_ID" --wait --timeout 900 --json
425
+ hagi hagitask messages --session-id "$SUPER_COMMIT_ID" --last 1 --json
426
+ ```
427
+
428
+ `hagitask get` reads one session. With `--wait` it polls every `--interval` seconds (default 5) until the status is no longer Optimizing, Openspecing, Executing or Archiving. `--timeout` (default 900) and `--grace` (default 10, `0` disables) are seconds, and `--timeout`, `--interval` and `--grace` need `--wait`. `--interval` must be less than `--timeout`. A timeout exits `31` and prints the last status. `hagitask messages --last <n>` reads the n newest messages; `--json` prints the list unchanged.
429
+
399
430
  **Migration from AutoTask:** `hagi hagitask create` and `hagi hagitask send` replace `hagi autotask create` and `hagi autotask send`. There is no `autotask` alias, so an `autotask` command now fails as an unknown command. Read the task schema with `hagitask schema` to find the input keys that replace the old flags.
400
431
 
401
432
  ## Plan Commands
@@ -553,6 +584,26 @@ hagi skills gallery search --query react --json
553
584
  hagi skills gallery detail --id vercel-react-best-practices --source vercel-labs/agent-skills
554
585
  ```
555
586
 
587
+ `gallery detail` also shows third-party audit ratings for the skill, supplied by skills.sh (providers such as `ath`, `socket` and `snyk`). In `--json` output every detail field is unchanged and an `audit` object is added. It lists one entry per provider that supplied data; `risk`, `alerts`, `score` and `analyzedAt` appear only when the backend has them:
588
+
589
+ ```json
590
+ {
591
+ "id": "vercel-react-best-practices",
592
+ "source": "vercel-labs/agent-skills",
593
+ "...": "all other detail fields",
594
+ "audit": {
595
+ "providers": [
596
+ { "provider": "ath", "risk": "low", "alerts": 0, "score": 92, "analyzedAt": "2026-10-30T08:00:00Z" },
597
+ { "provider": "socket", "risk": "medium", "alerts": 2 }
598
+ ]
599
+ }
600
+ }
601
+ ```
602
+
603
+ In human output the detail table is followed by one line per provider, for example `skills.sh audit (socket): risk=medium, alerts=2, score=--, analyzedAt=--`, where `--` marks a value the backend did not supply.
604
+
605
+ The audit is best-effort. If the audit call fails, times out or has no data, the detail still prints and the command exits `0`; in `--json` output `audit.providers` is then `[]`, never missing. The backend bounds the audit wait, and the CLI adds no timeout of its own. A failure of the detail call itself fails the command as before, and the audit never hides it. The audit does not change the install command preview or whether the skill is installable.
606
+
556
607
  Start a managed install of a gallery skill. This writes the skill into your local skill directories, so run it only when you intend to install it:
557
608
 
558
609
  ```bash
@@ -604,6 +655,7 @@ Stable non-zero exits used by the CLI. The HTTP numbers are the equivalents of t
604
655
  | `24` | HTTP 404 |
605
656
  | `29` | HTTP 409 |
606
657
  | `30` | Operation failed: the backend returned a refusal, for example `skills local enable` or `disable` on a name that is not a built-in skill, an invalid MonoSpecs configuration from `project monospecs validate`, or a failed clone from `project monospecs clone` or `set --clone` |
658
+ | `31` | Wait timed out: `--wait` on `proposal get` or `hagitask get` reached `--timeout` before the session settled. The last status is printed. Not a success, and not a backend error |
607
659
  | `40` | Other HTTP 4xx |
608
660
  | `50` | HTTP 5xx |
609
661
  | `60` | Transport or connection failure |