Ask a question to get started
Enter to send•Shift+Enter new line
Machine-readable JSON output helpers for CLI subcommands.
This module deliberately stays stdlib-only so it can be imported from CLI startup paths without pulling in unnecessary dependency trees.
Accepted internal output modes for CLI subcommands.
Add a --json flag to an argparse parser.
--json
Write a JSON envelope to stdout and flush.
The envelope is a single-line JSON object with a stable schema:
{"schema_version": 1, "command": "...", "data": ...}