zuke.tools.codex

← Python API reference

@zuke/codex 1.1.2: @zuke/codex — a typed [OpenAI Codex](https://developers.openai.com/codex/cli) CLI (codex) task wrapper for Zuke builds.

Symbols

#

CodexExecSettings

class
class CodexExecSettings(ToolSettings)

Settings for a non-interactive codex exec run — the build-friendly way to send a single prompt and capture the response.

  • prompt(text: str) -> Self

    The prompt to run non-interactively. Omit to read from stdin.

  • model(id: str) -> Self

    Pin the model, e.g. model("gpt-5-codex") (--model).

  • image(*paths: str) -> Self

    Attach an image to the prompt (--image). Repeatable.

  • config(key: str, value: str) -> Self

    Override a config value as key=value (--config). Repeatable.

  • sandbox(mode: Literal['read-only', 'workspace-write', 'danger-full-access']) -> Self

    Sandbox policy for model-generated commands (--sandbox).

  • cd(dir: str) -> Self

    Run as if codex was started in this directory (--cd).

  • ask_for_approval(policy: Literal['untrusted', 'on-failure', 'on-request', 'never']) -> Self

    Approval policy for the run (--ask-for-approval).

  • full_auto() -> Self

    Low-friction sandboxed automatic execution (--full-auto).

  • dangerously_bypass_approvals_and_sandbox() -> Self

    Skip all confirmation prompts and sandboxing (--dangerously-bypass-approvals-and-sandbox).

  • skip_git_repo_check() -> Self

    Allow running outside a Git repository (--skip-git-repo-check).

  • json() -> Self

    Emit events as newline-delimited JSON (--json).

  • output_last_message(file: str) -> Self

    Write the agent's final message to a file (--output-last-message).

  • output_schema(file: str) -> Self

    Constrain the final message to a JSON schema file (--output-schema).

  • color(mode: Literal['always', 'never', 'auto']) -> Self

    When to colourise output (--color).

  • profile(name: str) -> Self

    Use a named configuration profile (--profile).

  • oss() -> Self

    Use a local open-source model provider (--oss).

#

CodexMcpSettings

class
class CodexMcpSettings(SubcommandSettings)

Settings for a codex mcp … invocation (manage MCP servers): name the verb and operands with .command(...) and pass anything else with .flag(...).

#

CodexTasks

class
class CodexTasks

Typed task functions for the OpenAI Codex CLI.

  • static async exec(ctx: ServiceContext, configure: Callable[[CodexExecSettings], CodexExecSettings] | None=None) -> ExecResult

    Run a prompt non-interactively (codex exec).

  • static async mcp(ctx: ServiceContext, configure: Callable[[CodexMcpSettings], CodexMcpSettings] | None=None) -> ExecResult

    Manage MCP servers (codex mcp …).