Expand description
Shared JSON output primitives for Foundry CLIs.
Structs§
- Json
Envelope - Stable top-level envelope for complete machine-readable command output.
- Json
Message - Structured diagnostic entry for JSON output.
- Stream
Record - One NDJSON record on a long-running command’s stream. The kind-specific
payloadis flattened into the same object alongside the spec fields (schema_id,command_id,kind,ts).
Enums§
- Json
Message Level - Severity level for a structured JSON diagnostic.
Constants§
- JSON_
SCHEMA_ VERSION - The current version of Foundry’s top-level JSON output envelope.
Functions§
- print_
json - Prints a value as one compact JSON line on stdout and flushes.
- print_
json_ object - Prints a serializable object: envelope-wrapped in
--jsonmode, pretty-printed otherwise. - print_
json_ success - Prints a successful JSON envelope to stdout.
- print_
json_ success_ with_ warnings - Prints a successful JSON envelope with warnings to stdout.
- print_
json_ value_ or_ scalar - Prints command output that may already be JSON: parsed and envelope-wrapped in
--jsonmode, plain text otherwise. If the output is not valid JSON, it is wrapped as a scalar string. - print_
list - Prints a list of serializable items: JSON envelope wrapping an array in
--jsonmode, one item per line otherwise. - print_
scalar - Prints a scalar value: JSON envelope in
--jsonmode, plain text otherwise. - print_
stream_ record - Emits a single NDJSON record on stdout for a streaming command.
- print_
tokens - Prints ABI-decoded tokens: JSON envelope wrapping a value array in
--jsonmode, one formatted token per line otherwise.