Kitaru

cli_output

Shared CLI output helpers for text and JSON modes.

funcnormalize_output_format(raw) -> CLIOutputFormat

Normalize and validate a CLI output format string.

paramrawstr

Returns

kitaru.cli_output.CLIOutputFormat
funcemit_command_envelope(envelope, *, output) -> None

Emit a structured command result in the requested format.

paramenvelopeCommandEnvelope
paramoutputCLIOutputFormat

Returns

None
funcemit_json_error(command, message, *, error_type=None) -> None

Emit a structured JSON error envelope to stderr.

paramcommandstr
parammessagestr
paramerror_typestr | None
= None

Returns

None
funcexit_with_error(command, message, *, output, error_type=None) -> NoReturn

Emit a format-aware error and exit non-zero.

paramcommandstr
parammessagestr
paramoutputCLIOutputFormat
paramerror_typestr | None
= None

Returns

typing.NoReturn