Buckets:
37 GB
4,042,753 files
Updated about 1 month ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| src | 1 items | ||
| tests | 1 items | ||
| CHANGELOG.md | 1.94 kB xet | fe79c9c5 | |
| README.md | 4.79 kB xet | 38b93cd3 | |
| deno.json | 412 Bytes xet | 1c0288a5 | |
| mod.ts | 624 Bytes xet | 76bed03a |
@zuke/codex
Typed OpenAI Codex CLI (codex) task
wrapper for Zuke builds, in a
fluent settings-lambda API. The flagship task is exec — a non-interactive
(codex exec) invocation for builds and CI — alongside an mcp command
builder. Arguments stay a discrete argv array, so command construction is
injection-free.
import { CodexTasks } from "@zuke/codex";
// Headless prompt: capture machine-readable output.
const out = await CodexTasks.exec((s) =>
s.prompt("Summarise the staged diff in one line")
.model("gpt-5-codex")
.sandbox("read-only")
.json()
.outputLastMessage("last.txt")
);
console.log(out.stdout);
// Manage MCP servers with a flexible command builder.
await CodexTasks.mcp((s) => s.command("add", "fs").flag("yes"));
Authenticate through the shared .env(...) chainer (e.g. OPENAI_API_KEY),
backed by a parameter().secret() build input so Zuke masks it in CI output:
await CodexTasks.exec((s) =>
s.prompt("Review the diff").env({ OPENAI_API_KEY: this.apiKey.value })
);
API
Full typed API — generated from deno doc
`@zuke/codex` — a typed OpenAI Codex (https://developers.openai.com/codex/cli)
CLI (`codex`) task wrapper for Zuke builds.
Drive a prompt non-interactively with `exec` and manage MCP servers with the
`mcp` builder — both in the settings-lambda style shared by every Zuke tool
wrapper.
```ts
import { CodexTasks } from "@zuke/codex";
await CodexTasks.exec((s) =>
s.prompt("Draft a release note for the staged diff").sandbox("read-only")
);
```
@module
const CodexTasks: CodexTasksApi
Typed task functions for the OpenAI Codex CLI.
class CodexExecSettings extends ToolSettings
Settings for a non-interactive `codex exec` run — the build-friendly way to
send a single prompt and capture the response.
override protected defaultTool(): string
The executable this settings class drives (`codex`).
prompt(text: string): this
The prompt to run non-interactively. Omit to read from stdin.
model(id: string): this
Pin the model, e.g. `model("gpt-5-codex")` (`--model`).
image(...paths: string[]): this
Attach an image to the prompt (`--image`). Repeatable.
config(key: string, value: string): this
Override a config value as `key=value` (`--config`). Repeatable.
sandbox(mode: CodexSandboxMode): this
Sandbox policy for model-generated commands (`--sandbox`).
cd(dir: string): this
Run as if `codex` was started in this directory (`--cd`).
askForApproval(policy: CodexApprovalPolicy): this
Approval policy for the run (`--ask-for-approval`).
fullAuto(): this
Low-friction sandboxed automatic execution (`--full-auto`).
dangerouslyBypassApprovalsAndSandbox(): this
Skip all confirmation prompts and sandboxing (`--dangerously-bypass-approvals-and-sandbox`).
skipGitRepoCheck(): this
Allow running outside a Git repository (`--skip-git-repo-check`).
json(): this
Emit events as newline-delimited JSON (`--json`).
outputLastMessage(file: string): this
Write the agent's final message to a file (`--output-last-message`).
outputSchema(file: string): this
Constrain the final message to a JSON schema file (`--output-schema`).
color(mode: CodexColor): this
When to colourise output (`--color`).
profile(name: string): this
Use a named configuration profile (`--profile`).
oss(): this
Use a local open-source model provider (`--oss`).
override protected buildArgs(): string[]
Assemble the `codex exec` argv.
class CodexMcpSettings extends SubcommandSettings
Settings for a `codex mcp …` invocation (manage MCP servers): name the verb
and operands with `.command(...)` and pass anything else with `.flag(...)`.
override protected defaultTool(): string
The executable this settings class drives (`codex`).
override protected leadingTokens(): string[]
The fixed `mcp` group token that leads the argv.
interface CodexTasksApi
The shape of {@link CodexTasks}.
exec(configure?: Configure<CodexExecSettings>): Promise<CommandOutput>
Run a prompt non-interactively (`codex exec`).
mcp(configure?: Configure<CodexMcpSettings>): Promise<CommandOutput>
Manage MCP servers (`codex mcp …`).
type CodexApprovalPolicy = "untrusted" | "on-failure" | "on-request" | "never"
Approval policy for a run (`--ask-for-approval`).
type CodexColor = "always" | "never" | "auto"
When to colourise output (`--color`).
type CodexSandboxMode = "read-only" | "workspace-write" | "danger-full-access"
Sandbox policy for model-generated commands (`--sandbox`).
- Total size
- 37 GB
- Files
- 4,042,753
- Last updated
- Oct 24
- Pre-warmed CDN
- US EU US EU