Scripts and CI
Use --json (or -j) for machine-readable output.
Start read-only
Section titled “Start read-only”aw doctor --jsonaw status --jsonaw list --jsonAdd mutations only after inspection works.
Parse the envelope
Section titled “Parse the envelope”- stdout contains exactly one JSON document followed by a newline.
- Check the process exit status and the envelope’s
okfield. - Branch on
error.code, notmessage. - Read needed fields and ignore unknown fields.
{ "ok": true, "command": "status", "schemaVersion": 1, "data": {}, "warnings": []}Do not parse human prose from stderr as an API.
Be explicit
Section titled “Be explicit”Use selectors for mutating or expensive work:
aw exec --only arashi-docs --json -- pnpm validatePass non-interactive options when a command might prompt, change the parent shell, or launch an application. JSON mode gives hooks immediate EOF. Use --no-hook-input for the same behavior outside JSON mode.
See the command reference for supported JSON modes, command data, warnings, and errors.