Preview with --dry-run
Mutating commands take --dry-run and print the change they would make, with secrets masked.
$ ./hello widget create gamma --dry-run DRY RUN: would POST /widgets body: name = gamma token = *** no changes were made
A Go framework and spec for CLIs used in terminals, scripts, and CI.
Each command has text output for people, stable --json for programs, --dry-run before changes, confirmation before destructive actions, stable exit codes, and help text with examples.
$ go install github.com/vincentsch/rungrad/cmd/[email protected]
Conformance against rungrad-spec/1
100% weighted
15/15 applicable rules passed, 22 total rules
Captured from rungrad v0.2.1 and the starter that rungrad new generates.
--dry-runMutating commands take --dry-run and print the change they would make, with secrets masked.
$ ./hello widget create gamma --dry-run DRY RUN: would POST /widgets body: name = gamma token = *** no changes were made
A command renders its result for people or as stable --json for programs. Both forms come from the same value.
$ ./hello widget list ID Name 1 alpha 2 beta $ ./hello widget list --json [ { "id": "1", "name": "alpha" }, ...
Scripts and agents branch on the exit code instead of parsing text. Destructive commands refuse to act without confirmation.
$ ./hello widget delete alpha --no-prompt Error: destructive action requires --confirm exit code 1 $ ./hello widget delete alpha --confirm Deleted widget alpha exit code 0
rungrad also covers name-to-ID resolution, a hidden manifest for tools that inspect a CLI, and helpers for generated command docs. The spec stands on its own: a CLI written in any language can follow it and be checked with rungrad score. Conformance and the spec