Run a task with the local Codex CLI
codex_runRun coding tasks via natural language in an isolated workspace using the local Codex CLI, returning output and files or a job ID for async retrieval.
Instructions
Hand a natural-language task to the local Codex CLI coding agent. Codex can write and run code, install packages and call APIs inside an isolated workspace folder, then this returns its output plus any files it created. If Codex takes longer than wait_sec, this returns status: running and a job_id instead; call codex_job_result with it to collect the result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Override the Codex model for this run. | |
| prompt | Yes | The task for Codex, written as you would to a developer. | |
| wait_sec | No | Seconds to wait for the result before returning a job_id instead. Default 45, maximum 50, which keeps the call under common 60-second client timeouts. | |
| workspace | No | Relative workspace folder name under the workspace root. Reuse the same name to continue working on the same files. Defaults to a new timestamped folder. | |
| timeout_sec | No | Seconds before Codex is killed. Default 300. |