Skills2026年3月29日·1 分钟阅读

OpenAI Codex & Cookbook — Official Collection

Official OpenAI resources: Codex CLI coding agent and the OpenAI Cookbook with prompting guides for GPT, Codex, and Realtime API.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Community
入口
OpenAI Codex & Cookbook Official Collection
直接安装命令
npx -y tokrepo@latest install 63156b9d-2358-477c-9a6f-212bb886bab8 --target codex

先 dry-run 确认安装计划,再运行此命令。

TL;DR
Official OpenAI resources: Codex CLI agent for coding plus the Cookbook for GPT prompting guides.
§01

What it is

This collection bundles two official OpenAI resources. The first is Codex, OpenAI's CLI-based coding agent that reads your codebase, proposes changes, and executes them in a sandboxed environment. The second is the OpenAI Cookbook, a repository of practical guides and examples for working with GPT models, the Realtime API, embeddings, and function calling.

These resources target developers who use OpenAI APIs and want reference implementations, prompt engineering patterns, and a coding agent that integrates directly into terminal workflows.

§02

How it saves time or tokens

The Cookbook provides tested prompt templates and code snippets that you can copy directly into your projects. Instead of experimenting with prompt formats from scratch, you start from working examples that OpenAI engineers have validated. This reduces trial-and-error token usage during prompt development.

Codex CLI acts as a coding agent in your terminal. It reads relevant files, generates diffs, and applies changes after your approval. This keeps you in the terminal without switching to a browser-based chat interface.

§03

How to use

  1. Install Codex CLI: npm install -g @openai/codex. Set your OPENAI_API_KEY environment variable.
  2. Run codex in your project directory. Describe what you want to change in natural language. Codex reads your codebase, generates a plan, and shows you the proposed diff.
  3. For the Cookbook, browse the GitHub repository or the docs site. Each guide is a standalone Jupyter notebook or Python script covering a specific use case.
§04

Example

# Using Codex CLI to add error handling
$ codex 'Add retry logic with exponential backoff to the API client in src/api.ts'

# Codex reads src/api.ts, generates a diff:
# + import { retry } from './utils/retry';
# + const response = await retry(() => fetch(url), { maxRetries: 3 });

# You review and approve the changes

Codex operates in a sandbox by default, so it cannot make destructive changes without your explicit approval.

§05

Related on TokRepo

§06

Common pitfalls

  • Codex CLI requires an OpenAI API key with access to the latest models. Costs depend on which model you configure and how much context your codebase requires.
  • Cookbook examples target specific API versions. Some older notebooks may reference deprecated endpoints. Always check the last-updated date on each guide.
  • Codex sandbox mode restricts file system and network access. If you need the agent to run tests or install packages, you must explicitly grant those permissions.

常见问题

Is Codex CLI free to use?+

Codex CLI itself is free and open source. However, it calls OpenAI API endpoints, which are billed per token. Your costs depend on the model you use and the size of context windows required for your codebase.

Can Codex CLI work with Claude or other models?+

Codex CLI is built specifically for OpenAI models. It uses OpenAI's API format and features. For Claude-based coding agents, alternatives like Claude Code or Cline serve a similar role.

What topics does the OpenAI Cookbook cover?+

The Cookbook covers prompt engineering, function calling, embeddings and vector search, fine-tuning, the Realtime API for voice, vision with GPT-4o, structured outputs, and batch processing. Each topic has runnable code examples.

How does Codex CLI differ from GitHub Copilot?+

Codex CLI is a terminal-based agent that reads your full codebase and makes multi-file changes. GitHub Copilot is an IDE-integrated autocomplete tool that suggests code inline. Codex operates at the project level while Copilot works at the line level.

Can I contribute to the OpenAI Cookbook?+

Yes. The Cookbook is open source on GitHub and accepts community contributions. OpenAI provides contribution guidelines for adding new examples or updating existing ones.

引用来源 (3)
🙏

来源与感谢

Created by OpenAI. Licensed under Apache 2.0 / MIT.

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产