掌握 App 核心功能
Codex App 是面向桌面端的 Codex 工作台。它适合同时推进多个 Codex threads,并内置 worktree、automations 和 G
Codex App 是面向桌面端的 Codex 工作台。它适合同时推进多个 Codex threads,并内置 worktree、automations 和 Git 功能。
大多数 Codex App 功能同时支持 macOS 和 Windows。少数平台差异会在对应章节说明。
官方介绍视频:
https://www.youtube.com/watch?v=HFM3se4lNiw
Multitask across projects
你可以用一个 Codex App window 同时处理多个 projects。每个 codebase 添加为一个 project,需要时在不同 project 之间切换。
如果你用过 Codex CLI,App 里的 project 可以理解成“在某个指定目录里启动一次 session”。
如果一个 repository 里有两个或更多 apps / packages,建议把它们拆成不同的 App projects。这样 sandbox 只会包含这个 project 需要的文件,不会把整个大仓库都纳入同一个工作边界。
官方截图:
- light:https://developers.openai.com/images/codex/app/multitask-light.webp
- dark:https://developers.openai.com/images/codex/app/multitask-dark.webp
Skills support
Codex App 支持和 CLI、IDE Extension 相同的 agent skills。你也可以在 sidebar 点击 Skills,查看并探索团队在不同 projects 中创建的新 skills。
官方截图:
- light:https://developers.openai.com/images/codex/app/skill-selector-light.webp
- dark:https://developers.openai.com/images/codex/app/skill-selector-dark.webp
Automations
你可以把 skills 和 automations 结合起来,处理重复任务。例如:
- 评估 telemetry 里的 errors,并提交 fixes。
- 基于最近的 codebase changes 创建报告。
- 定时检查某类项目状态。
如果某项长期工作需要一直留在同一个 thread 里,使用 thread automation。
官方截图:
- light:https://developers.openai.com/images/codex/app/create-automation-light.webp
- dark:https://developers.openai.com/images/codex/app/create-automation-dark.webp
Modes
每个 thread 都会在某个 mode 下运行。创建 thread 时可以选择:
| Mode | 用途 |
|---|---|
| Local | 直接在当前 project directory 中工作。 |
| Worktree | 在 Git worktree 中隔离修改。详见 Worktrees。 |
| Cloud | 在已经配置好的 cloud environment 中远程运行。 |
Local 和 Worktree threads 都会在你的电脑上运行。
完整术语和概念解释见 concepts section。
官方截图:
- light:https://developers.openai.com/images/codex/app/modes-light.webp
- dark:https://developers.openai.com/images/codex/app/modes-dark.webp
Built-in Git tools
Codex App 在应用内提供常用 Git 功能。
diff pane 会显示当前 local project 或 worktree checkout 里的 Git diff。你也可以给 Codex 添加 inline comments,让它处理具体反馈;还可以 stage 或 revert 某个 chunk,或者整个文件。
对于 local 和 worktree tasks,你可以直接在 Codex App 里 commit、push,并创建 pull requests。
更复杂的 Git 操作适合使用 integrated terminal。
官方截图:
- light:https://developers.openai.com/images/codex/app/git-commit-light.webp
- dark:https://developers.openai.com/images/codex/app/git-commit-dark.webp
Worktree support
创建新 thread 时,可以选择 Local 或 Worktree。
| 选项 | 行为 |
|---|---|
| Local | 直接在当前 project 中工作。 |
| Worktree | 创建新的 Git worktree,让修改和常规 project 目录隔离。 |
当你想尝试新想法,又不想碰当前工作区,或者想让 Codex 在同一个 project 里并行处理多个独立任务时,选择 Worktree。
Automations 在 Git repositories 中会使用专用 background worktrees;对于 non-version-controlled projects,则直接在 project directory 中运行。
更多说明见:
https://developers.openai.com/codex/app/worktrees
官方截图:
- light:https://developers.openai.com/images/codex/app/worktree-light.webp
- dark:https://developers.openai.com/images/codex/app/worktree-dark.webp
Integrated terminal
每个 thread 都内置一个 terminal,作用域限定在当前 project 或 worktree。你可以点击 App 右上角 terminal icon 打开,也可以按 Cmd+J。
这个 terminal 适合在不离开 App 的情况下做验证、跑脚本和执行 Git 操作。Codex 也能读取当前 terminal output,因此可以检查 development server 是否仍在运行,或者在处理问题时引用失败的 build 输出。
常见任务包括:
git statusgit pull --rebasepnpm test或npm testpnpm run lint或类似项目命令
如果你经常运行某个任务,可以在 local environment 里定义一个 action,这样 Codex App window 顶部会出现对应 shortcut button。
注意:Cmd+K 会打开 Codex App 的 command palette,不会清空 terminal。清空 terminal 要用 Ctrl+L。
官方截图:
- light:https://developers.openai.com/images/codex/app/integrated-terminal-light.webp
- dark:https://developers.openai.com/images/codex/app/integrated-terminal-dark.webp
Native Windows sandbox
在 Windows 上,Codex 可以直接在 PowerShell 中原生运行,并使用 native Windows sandbox,不强制依赖 WSL 或 virtual machine。这样你可以保留 Windows-native workflows,同时让权限边界保持受控。
Windows setup 和 sandboxing 说明:
https://developers.openai.com/codex/app/windows
官方截图:
https://developers.openai.com/images/codex/windows/windows-sandbox-setup.webp
Voice dictation
你可以用语音给 Codex 下 prompt。composer 可见时,按住 Ctrl+M 并开始说话,Codex 会把语音转成文字。你可以编辑转写后的 prompt,也可以直接发送,让 Codex 开始工作。
官方截图:
- light:https://developers.openai.com/images/codex/app/voice-dictation-light.webp
- dark:https://developers.openai.com/images/codex/app/voice-dictation-dark.webp
Floating pop-out window
你可以把当前 active conversation thread 弹出为独立 window,并移动到正在工作的地方。
这个功能尤其适合 front-end work:你可以把 thread 放在 browser、editor 或 design preview 旁边,一边迭代一边看 Codex 状态。
需要它一直可见时,可以开启 stay on top。
官方截图:
- light:https://developers.openai.com/images/codex/app/popover-light.webp
- dark:https://developers.openai.com/images/codex/app/popover-dark.webp
In-app browser
In-app browser 可以用来 preview、review 和 comment:
- local development servers
- file-backed previews
- 不需要 sign-in 的 public pages
它适合你迭代 web app 时快速查看页面和标注反馈。
边界要注意:in-app browser 不支持 authentication flows、signed-in pages、你的常规 browser profile、cookies、extensions,也不能使用已有 tabs。
你可以用 browser comments 标记页面上的具体 elements 或 areas,然后让 Codex 根据这些反馈修改。
如果你希望 Codex 直接操作页面,可以在 local development servers 和 file-backed pages 上使用 browser use。Browser plugin、allowed websites 和 blocked websites 都可以在 settings 中管理。
官方截图:
- light:https://developers.openai.com/images/codex/app/in-app-browser-light.webp
- dark:https://developers.openai.com/images/codex/app/in-app-browser-dark.webp
Computer use
Computer use 能让 Codex 通过“看、点击、输入”来操作 macOS app。
适合的场景包括:
- 测试 desktop apps。
- 检查 browser 或 simulator flows。
- 处理 plugins 无法覆盖的数据源。
- 修改 app settings。
- 复现只能通过 GUI 触发的 bugs。
因为 computer use 会影响 project workspace 之外的 app 和 system state,任务要保持窄边界,并在继续前认真 review permission prompts。
该功能 launch 时不面向 European Economic Area、United Kingdom 或 Switzerland 提供。
官方截图:
- light:https://developers.openai.com/images/codex/app/computer-use-approval-light.webp
- dark:https://developers.openai.com/images/codex/app/computer-use-approval-dark.webp
Work with non-code artifacts
当 task 产出 non-code artifacts 时,sidebar 可以 preview PDF files、spreadsheets、documents 和 presentations。
给 Codex 输入时,要明确:
- source data
- expected file type
- structure
- 你关心的 review criteria
对于 spreadsheets 和 presentations,要说明 sheets、columns、charts、slide sections,以及你要检查的事项。也可以让 Codex 说明它把输出保存在哪里,以及它如何检查结果。
用 task sidebar 跟踪正在运行的 thread。它可以展示 agent plan、sources、generated artifacts 和 task summary,帮助你 steer 工作、检查生成文件,并判断是否需要再跑一轮。
官方截图:
- light:https://developers.openai.com/images/codex/app/artifact-viewer-light.webp
- dark:https://developers.openai.com/images/codex/app/artifact-viewer-dark.webp
Sync with the IDE extension
如果你的 editor 安装了 Codex IDE Extension,并且 Codex App 与 IDE Extension 位于同一个 project,它们会自动同步。
同步后,Codex App composer 中会出现 IDE context 选项。开启 "Auto context" 时,Codex App 会跟踪你正在查看的 files,因此你可以间接引用它们,例如:
What's this file about?你也可以在 IDE Extension 中看到 Codex App 正在运行的 threads,反过来也一样。
如果不确定 App 是否带上了 context,可以关闭它,用同一个问题再问一次,对比结果。
线程自动化
Automations 也可以挂在单个 thread 上。这类 thread automations 是 recurring wake-up calls,会保留 thread context,让 Codex 能定期检查长期任务、轮询某个信息源,或者继续 follow-up loop。
适合用在 heartbeat-style automations,也就是需要按计划持续回到同一个 conversation 的任务。
当下一次运行依赖当前 conversation 时,用 thread automation。需要让 Codex 为一个或多个 projects 启动全新的 recurring task 时,使用 standalone 或 project automation。
Approvals and sandboxing
approval 和 sandbox settings 会限制 Codex 能做什么。
| 设置 | 控制内容 |
|---|---|
| Approvals | Codex 什么时候要在运行 command 前暂停并请求 permission。 |
| Sandbox | Codex 能访问哪些 directories,以及是否能访问 network。 |
看到 “approve once” 或 “approve for this session” 这类 prompts 时,你是在给 tool execution 授予不同 scope 的权限。如果不确定,批准最窄的选项,然后继续迭代。
默认情况下,Codex 会把工作 scope 限定在当前 project。大多数情况下,这是正确边界。
如果任务必须跨多个 repositories 或 directories,优先打开多个 projects,或者使用 worktrees。不要直接让 Codex 在 project root 之外自由游走。
如果 workspace 支持 automatic review,可以在 permissions selector 中选择它。它保留同样的 sandbox boundary,但会把 eligible approval requests 交给 configured review policy,而不是一直等你。
高层概览见 sandboxing。配置细节见 agent approvals & security documentation。
MCP support
Codex App、CLI 和 IDE Extension 共享 Model Context Protocol (MCP) settings。
如果你已经在其中一个入口配置了 MCP servers,其他入口会自动采用同一配置。要配置新 servers,打开 App settings 的 MCP section,启用 recommended servers,或把自定义 server 添加到 configuration。
Web search
Codex 自带 first-party web search tool。
在 Codex App 的 local tasks 中,Codex 默认启用 web search,并从 web search cache 提供结果。这个 cache 是 OpenAI 维护的网页结果索引。
如果你把 sandbox 配置为 full access,web search 默认使用 live results。如何关闭 web search,或切换到获取最新数据的 live results,见 Config basics。
图片生成
你可以直接在 thread 中让 Codex 生成或编辑图片。
适合的场景包括:
- UI assets
- banners
- backgrounds
- illustrations
- sprite sheets
- coding 时需要一起创建、可直接使用的真实 UI assets
如果你希望 Codex transform 或 extend 已有 asset,可以添加 reference image。
你可以用自然语言描述,也可以在 prompt 里显式调用 image generation skill:
$imagegen内置图片生成使用 gpt-image-2,计入 general Codex usage limits。根据 image quality 和 size,它平均会比不生成图片的类似 turns 更快消耗 included limits,约 3-5x。
用量细节见 Pricing。prompting 技巧和模型细节见 image generation guide。
如果要做更大批量的 image generation,把 OPENAI_API_KEY 设置到 environment variables,然后让 Codex 通过 API 生成图片,这样按 API pricing 计费。
Image input
你可以把图片拖到 prompt composer 中,作为 context。拖放图片时按住 Shift,可以把 image 添加到 context。
你也可以要求 Codex 查看系统上的图片。给 Codex 使用截图工具后,它可以查看你正在处理的 app,并验证自己的工作。
Chats
Chats 是不依赖特定 project folder 或 Git repository 的 threads。它适合 research、triage、planning、plugin-heavy workflows,以及其他需要 Codex 使用 connected tools、但不编辑 codebase 的 conversation。
Chats 使用 Codex-managed threads directory 作为工作位置。默认位置是:
~/.codex/threads记忆
Memories 可用时,能让 Codex 把过去 tasks 中有用的 context 带到未来 threads。它最适合保存稳定偏好、project conventions、重复 work patterns,以及否则每次都要重说的 known pitfalls。
通知
默认情况下,当 task 完成,或 App 在后台时需要 approval,Codex App 会发送 notifications。
在 Codex App settings 中,你可以选择从不发送 notifications,或者即使 App 正在前台也始终发送。
Keep your computer awake
由于有些 tasks 会运行一段时间,你可以在 App settings 中启用 "Prevent sleep while running",让 Codex App 阻止电脑进入睡眠。
See also
- Settings:https://developers.openai.com/codex/app/settings
- Automations:https://developers.openai.com/codex/app/automations
- In-app browser:https://developers.openai.com/codex/app/browser
- Computer use:https://developers.openai.com/codex/app/computer-use
- Review pane:https://developers.openai.com/codex/app/review
- Local environments:https://developers.openai.com/codex/app/local-environments
- Worktrees:https://developers.openai.com/codex/app/worktrees