Skip to main content

Overview

This example demonstrates how to use the OpenAI Codex CLI integration to execute simple prompts. The AgentCtrl facade provides a clean API for invoking the codex exec command with full event observability. Key concepts:
  • AgentCtrl::codex(): Factory for Codex agent builder
  • withSandbox(): Configure sandbox mode for file/network access
  • AgentCtrlConsoleLogger: Shows execution lifecycle with color-coded labels

Example

Expected Output

Key Points

  • Simple execution: One method call handles the entire interaction
  • Full observability: Console logger shows request building, sandbox, and response parsing
  • Sandbox control: Use withSandbox() for file/network access control