| name | run-codex |
| description | Run real Codex with a prompt to test and verify code during development. Use when debugging event handling, understanding Codex responses, or validating implementation changes against real behavior. |
| license | MIT |
| compatibility | Requires Node.js, tsx, and @openai/codex package installed. Codex authentication required. |
Run Real Codex Test
This skill runs real Codex with a prompt and captures all events for analysis during development.
When to Use
- Testing new event handlers
- Debugging event processing issues
- Understanding Codex response format and event order
- Validating implementation changes against real Codex behavior
- Seeing actual token usage, rate limits, and other metadata
How to Run
Execute the test script using npm:
npm run codex-test -- -p "Your prompt here"
Options
| Option | Short | Description | Default |
|---|
--prompt | -p | Prompt to send to Codex (required) | - |
--cwd | -c | Working directory for the session | Current dir |
--output | -o | Output format: all, codex, acp, summary | all |
--json | - | Output events as JSON | false |
--help | -h | Show help message | - |
Examples
npm run codex-test -- -p "What files are in this directory?"
npm run codex-test -- -p "Read the README" -c /path/to/project
npm run codex-test -- -p "Hello" -o codex
npm run codex-test -- -p "Hello" -o summary
npm run codex-test -- -p "Hello" --json | jq '.method'
Output
The script outputs events in real-time as they arrive:
-
Codex Events ([CODEX]): Raw events from Codex app server
thread/started, turn/started, turn/completed
item/started, item/completed, item/agentMessage/delta
thread/tokenUsage/updated, account/rateLimits/updated
-
ACP Events ([ACP]): Events sent to ACP connection
sessionUpdate with various update types
-
Summary: Aggregated statistics
- Stop reason, duration, event counts
- Token usage breakdown (input, cached, output, reasoning, total)
- Event type frequency
-
PromptResponse: Full response object including _meta.quota.token_count