cli_output
Shared CLI output helpers for text and JSON modes.
funcnormalize_output_format(raw) -> CLIOutputFormatNormalize and validate a CLI output format string.
paramrawstrReturns
kitaru.cli_output.CLIOutputFormatfuncemit_command_envelope(envelope, *, output) -> NoneEmit a structured command result in the requested format.
paramenvelopeCommandEnvelopeparamoutputCLIOutputFormatReturns
Nonefuncemit_json_error(command, message, *, error_type=None) -> NoneEmit a structured JSON error envelope to stderr.
paramcommandstrparammessagestrparamerror_typestr | None= NoneReturns
Nonefuncexit_with_error(command, message, *, output, error_type=None) -> NoReturnEmit a format-aware error and exit non-zero.
paramcommandstrparammessagestrparamoutputCLIOutputFormatparamerror_typestr | None= NoneReturns
typing.NoReturn