ClaudeCliBackend.parse_result_envelope()
Parse the {is_error, result} JSON envelope from claude -p --output-format json.
Usage
ClaudeCliBackend.parse_result_envelope(
stdout,
*,
argv,
stderr,
)Parameters
stdout: bytes-
Raw stdout bytes holding the JSON envelope.
argv: list[str]-
The argv that produced the output, recorded on the raised error.
stderr: bytes- Raw stderr bytes, recorded on the raised error.
Returns
str-
The envelope’s
resultstring.
Raises
subprocess.CalledProcessError-
If the envelope’s
is_errorflag is set.