Frontal 已上线。阅读公告

TypeScript SDK

Embed the Codex coding agent in a Node.js application with a typed client.

The TypeScript SDK wraps the codex CLI from @openai/codex. It starts the CLI and exchanges JSONL events over stdin/stdout. It requires Node.js 18+.

Start and continue a thread

Stream events

run() buffers until the turn finishes. Use runStreamed() for progress, tool calls, file changes, and usage:

Resume a thread

Threads persist in ~/.codex/sessions. Save the thread ID and resume it later:

Structured output and images

Pass a JSON Schema for machine-readable output:

Attach local images with structured input entries:

Configuration

Codex accepts env, config, and configOverrides. A thread can set workingDirectory and skipGitRepoCheck. The SDK inherits the Node.js process environment by default; supply env when the child process must receive a restricted environment. See the SDK README for the complete options and item types.

更新于 2026年8月31日

© 2026 Frontal Labs, Inc. 或其关联公司。

我们默认在不使用 Cookie 的情况下统计网站流量。若您接受,我们将跨会话记住您的访问,从而让分析更准确。