1.1 KiB
1.1 KiB
description, globs, trigger
| description | globs | trigger |
|---|---|---|
| CLI stdout/stderr stream contract and exit code conventions for seal-use commands | src/cli/**/*.ts | manual |
CLI Stream & Exit Code Protocol
When working on CLI command implementations under src/cli/:
-
Machine Channel (
stdout):- Data commands MUST output pure, parseable JSON on
stdout. - NEVER output human text, logs, spinners, or progress banners to
stdout(the Agent Harness parsesstdoutdirectly). - Documented exceptions for Markdown output:
seal-use --help/seal-use help <area>andseal-use doctor guide.
- Data commands MUST output pure, parseable JSON on
-
Diagnostics & Guidance Channel (
stderr):- Write runtime logs, warnings, probing status, and human tips to
stderr. - Format next-step guidance explicitly:
👉 Next action: seal-use ....
- Write runtime logs, warnings, probing status, and human tips to
-
Exit Code Contract:
- Successful operations MUST exit with
0. - Any validation error, upstream API failure, or block MUST result in non-zero exit code (e.g.
1). - DO NOT call
process.exit()deep in domain functions; throw structured errors and letsrc/cli/runner.tshandle stream routing and exit code assignment.
- Successful operations MUST exit with