Skip to main content

Codex CLI Integration

PraisonAI provides integration with OpenAI’s Codex CLI for non-interactive code execution, file modifications, and structured output.

Installation

Quick Start

Configuration Options

Examples

Basic Execution

Full Auto Mode

Enable file modifications:

Sandbox Modes

JSON Streaming Output

Structured Output with Schema

Streaming Output

As Agent Tool

Environment Variables

CLI Flags Used

The integration uses the following Codex CLI flags:

JSON Lines Output Format

When json_output=True, the output is a stream of JSON events:

Error Handling

Best Practices

  1. Use full_auto=True only when file modifications are needed
  2. Use structured output for CI/CD pipelines
  3. Set appropriate sandbox mode based on security requirements
  4. Use JSON output for programmatic processing
  5. Set timeouts appropriate for task complexity