Skip to main content

stream_exec

Function stream_exec 

Source
pub async fn stream_exec<F>(
    codex: &Codex,
    cmd: &ExecCommand,
    handler: F,
) -> Result<()>
where F: FnMut(JsonLineEvent),
Expand description

Stream JSONL events from codex exec <prompt>, invoking handler for each parsed JsonLineEvent.

The child’s stderr is drained concurrently and returned in the error if the process exits with a non-zero status.