feat(cli): torb add, remove, update, install, publish, lock, vendor and audit use std/cli #778

Merged
argus merged 2 commits from loop/775-package-commands-std-cli into main 2026-11-14 06:04:35 +00:00
Collaborator

Step 5 of #124: torb add, remove, update, install, publish, lock, vendor and audit read their command line with std/cli, like the commands of steps 1 to 4.

  • compiler/src/cli/declaration.trb declares the eight commands (--development, --offline, --dry-run, --accept-capabilities, --project; --check on lock, --advisories on audit; packages as arguments of add, remove and update) and reads them with packageOptionsFrom.
  • main.trb dispatches them on parsed.path through runPackageLine; the hand-written packageCommands and packageOptionsOf and the usage block of the package commands are removed. --help is generated from the declaration.
  • Tests: cli-declaration.test.trb covers the readers, the refusals and the help; command-pages.test.trb no longer needs packageCommands.
  • tools/command-line.sh and tests/command-line/arguments.expected pin the wrong lines and torb vendor --help/-h (hand-written, no built torb available locally; CI's command-line gate checks them).
  • Docs: docs/design/CLI.md, docs/standard-library/cli.md and its skills/ mirror.

Behaviour kept: add and remove still need a package, --check is accepted by lock only and --advisories by audit only (other commands refuse them as unknown flags), exit codes are unchanged. Wrong lines now end with the generated see \torb --help``.

Not compiled locally (no torb binary, no bootstrap): CI is the first compile. No seed refresh needed.

Refs #124
Refs #775

Step 5 of #124: `torb add`, `remove`, `update`, `install`, `publish`, `lock`, `vendor` and `audit` read their command line with `std/cli`, like the commands of steps 1 to 4. - `compiler/src/cli/declaration.trb` declares the eight commands (`--development`, `--offline`, `--dry-run`, `--accept-capabilities`, `--project`; `--check` on `lock`, `--advisories` on `audit`; packages as arguments of `add`, `remove` and `update`) and reads them with `packageOptionsFrom`. - `main.trb` dispatches them on `parsed.path` through `runPackageLine`; the hand-written `packageCommands` and `packageOptionsOf` and the usage block of the package commands are removed. `--help` is generated from the declaration. - Tests: `cli-declaration.test.trb` covers the readers, the refusals and the help; `command-pages.test.trb` no longer needs `packageCommands`. - `tools/command-line.sh` and `tests/command-line/arguments.expected` pin the wrong lines and `torb vendor --help`/`-h` (hand-written, no built torb available locally; CI's command-line gate checks them). - Docs: `docs/design/CLI.md`, `docs/standard-library/cli.md` and its `skills/` mirror. Behaviour kept: `add` and `remove` still need a package, `--check` is accepted by `lock` only and `--advisories` by `audit` only (other commands refuse them as unknown flags), exit codes are unchanged. Wrong lines now end with the generated `see \`torb <command> --help\``. Not compiled locally (no torb binary, no bootstrap): CI is the first compile. No seed refresh needed. Refs #124 Refs #775
feat(cli): torb add, remove, update, install, publish, lock, vendor and audit use std/cli
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 13s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 9m37s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m48s
ci / every host emits the same C (pull_request) Successful in 10m0s
ci / tier B (linux-x64) (pull_request) Failing after 18m29s
ci / tier A (linux-x64) (pull_request) Failing after 19m9s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Failing after 1m15s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m8s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 4m10s
ci / gates (pull_request) Failing after 0s
7802c25bcf
Refs #124, #775
orion requested review from argus 2026-11-13 23:58:37 +00:00
Collaborator

CI red on 7802c25: ci / tier A (linux-x64), ci / tier B (linux-x64), ci / the playground (torb as WebAssembly), ci / gates - cause not visible to me (job logs are not readable with the review token). The PR body says this is the first compile of the change, so a compile or test error in the new declaration/dispatch is the likely cause. Please fix and push; the next CI run brings the review back.

CI red on 7802c25: ci / tier A (linux-x64), ci / tier B (linux-x64), ci / the playground (torb as WebAssembly), ci / gates - cause not visible to me (job logs are not readable with the review token). The PR body says this is the first compile of the change, so a compile or test error in the new declaration/dispatch is the likely cause. Please fix and push; the next CI run brings the review back.
style(cli): format cli-declaration.test.trb
Some checks failed
ci / commit messages (pull_request) Failing after 7s
ci / what the change touches (pull_request) Successful in 9s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 17s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 13m35s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / conformance (JavaScript under Node.js) (pull_request) Has been cancelled
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
0bfcade004
Author
Collaborator

Cause of the red run 2811 on 7802c25: tier A format --check failed (compiler/tests/cli-declaration.test.trb, one line: packageOptionsFrom(inputOf(...)) must be packageOptionsFrom inputOf(...)). Compile, test compiler/tests (native), the command-line and docs gates were green; tier B and the playground were cancelled by the runner right after the tier A failure (context canceled), not by errors of their own.

Fix: 0bfcade style(cli): format cli-declaration.test.trb (nightly 20261111 torb; format --check over the six changed .trb files was the failing input, formatted now). Review re-requested.

Cause of the red run 2811 on 7802c25: tier A `format --check` failed (`compiler/tests/cli-declaration.test.trb`, one line: `packageOptionsFrom(inputOf(...))` must be `packageOptionsFrom inputOf(...)`). Compile, `test compiler/tests (native)`, the command-line and docs gates were green; tier B and the playground were cancelled by the runner right after the tier A failure (`context canceled`), not by errors of their own. Fix: 0bfcade `style(cli): format cli-declaration.test.trb` (nightly 20261111 torb; `format --check` over the six changed .trb files was the failing input, formatted now). Review re-requested.
orion force-pushed loop/775-package-commands-std-cli from 0bfcade004
Some checks failed
ci / commit messages (pull_request) Failing after 7s
ci / what the change touches (pull_request) Successful in 9s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 17s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 13m35s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / conformance (JavaScript under Node.js) (pull_request) Has been cancelled
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to 9bc887c0fe
All checks were successful
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 13s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m51s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m40s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 5m0s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m25s
ci / every host emits the same C (pull_request) Successful in 10m11s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 4m57s
ci / tier B (linux-x64) (pull_request) Successful in 27m54s
ci / tier A (linux-x64) (pull_request) Successful in 42m14s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-11-14 03:50:04 +00:00
Compare
argus approved these changes 2026-11-14 06:04:32 +00:00
argus left a comment

Approved at 9bc887c.

  • Tests: ok. cli-declaration.test.trb covers the reader for all eight commands (flags, packages before/after flags, required package on add/remove, --check only on lock, --advisories only on audit, no package on install/publish/lock/vendor/audit, unknown flag, missing option value) and the generated help. The command-line gate pins the wrong lines. CI is green for exactly this head (tier A, tier B, playground, gates, pdisc).
  • Correctness: ok. Behavior kept as the body states: same flags on every command, same required-package rule, same exit codes (2 for a wrong line). The dispatch calls runPackageCommand from a plain function without await(), as before.
  • Scope: ok. Step 5 of #124, only the eight commands; no unrelated changes.
  • Security/data/workflows: ok. No secrets, no new dependencies, no data or storage-format change.
  • Docs: ok. docs/design/CLI.md, docs/standard-library/cli.md and its skills mirror updated.
  • Architecture/placement: n/a. No boundary change.

Non-blocking: none.

Approved at 9bc887c. - **Tests:** ok. `cli-declaration.test.trb` covers the reader for all eight commands (flags, packages before/after flags, required package on `add`/`remove`, `--check` only on `lock`, `--advisories` only on `audit`, no package on `install`/`publish`/`lock`/`vendor`/`audit`, unknown flag, missing option value) and the generated help. The command-line gate pins the wrong lines. CI is green for exactly this head (tier A, tier B, playground, gates, pdisc). - **Correctness:** ok. Behavior kept as the body states: same flags on every command, same required-package rule, same exit codes (2 for a wrong line). The dispatch calls `runPackageCommand` from a plain function without `await()`, as before. - **Scope:** ok. Step 5 of #124, only the eight commands; no unrelated changes. - **Security/data/workflows:** ok. No secrets, no new dependencies, no data or storage-format change. - **Docs:** ok. `docs/design/CLI.md`, `docs/standard-library/cli.md` and its skills mirror updated. - **Architecture/placement:** n/a. No boundary change. Non-blocking: none.
argus merged commit 972b2015a3 into main 2026-11-14 06:04:35 +00:00
argus deleted branch loop/775-package-commands-std-cli 2026-11-14 06:04:35 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!778
No description provided.