四面 · 一个 agent,四处开工Four Fronts · One Agent, Working Everywhere.
CLI 在终端和脚本里,IDE 扩展在编辑器里,ChatGPT 应用在桌面、网页和手机上,云端在 OpenAI 的容器里 —— 四个面,一台引擎:config.toml、AGENTS.md、skills、MCP 走到哪跟到哪。2026 年 7 月起,Codex app 并入 ChatGPT 桌面应用,本地、worktree、云端在同一个窗口里切换,Handoff 把一场对话连代码一起搬来搬去。这一章把四面各自的主场讲清楚:活跟人走 —— 要陪跑的去编辑器,要批量的上云,要进脚本的走 CLI。The CLI lives in your terminal and scripts, the IDE extension in your editor, the ChatGPT app on desktop, web, and phone, and the cloud in OpenAI's containers — four fronts, one engine: config.toml, AGENTS.md, skills, and MCP follow you everywhere. Since July 2026 the Codex app is part of the ChatGPT desktop app: local, worktree, and cloud runs switch inside one window, and Handoff moves a conversation, code included, between them. This chapter pins down each front's home turf: work follows the person — pair-work goes to the editor, batches go to the cloud, scripts go to the CLI.
9 分钟 · 初稿 2026.079 Min · Drafted 2026.07
第 1 章把 Codex 说成「四面开工的 agent」。这一章把四个面各自的主场讲清楚,再说清一件容易被忽略的事:它们不是四个各管各的工具,是同一台引擎的四个入口 —— 你写的一份 AGENTS.md、配的一次 config、接的一个 MCP,四面通用。选对面,不是学四套东西,是同一件活挑最省的那个入口。Chapter 1 called Codex an agent on four fronts. This chapter pins down each front's home turf, and one thing easily missed: they aren't four separate tools but four entrances to one engine — the AGENTS.md you write, the config you set, the MCP you wire in all carry across. Choosing a front isn't learning four things; it's picking the cheapest entrance for the same job.
— I
四个面,各有主场Four Fronts, Each with Its Home Turf.
官方的分法很干脆:日常用 ChatGPT 就开桌面应用或网页;想在终端或编辑器里用 Codex,就装 CLI 或 IDE 扩展。1注 1Note 1OpenAI Codex 文档 · Quickstart —— 用 ChatGPT 的日常界面选桌面应用或网页;开发者想在终端或编辑器里用 Codex,则用 Codex CLI 或 Codex IDE 扩展。四个入口连着同一台引擎。截至 2026-07-17。OpenAI Codex Docs · Quickstart — for everyday ChatGPT use, choose the desktop app or the web; developers who want Codex in a terminal or editor use the Codex CLI or the Codex IDE extension. Four entrances, one engine. As of 2026-07-17.但「用哪个」不该按身份分,该按这件活是什么形状分。四个面各自最擅长的:The official split is crisp: for everyday ChatGPT, open the desktop app or the web; to use Codex in a terminal or editor, install the CLI or IDE extension.1注 1Note 1OpenAI Codex 文档 · Quickstart —— 用 ChatGPT 的日常界面选桌面应用或网页;开发者想在终端或编辑器里用 Codex,则用 Codex CLI 或 Codex IDE 扩展。四个入口连着同一台引擎。截至 2026-07-17。OpenAI Codex Docs · Quickstart — for everyday ChatGPT use, choose the desktop app or the web; developers who want Codex in a terminal or editor use the Codex CLI or the Codex IDE extension. Four entrances, one engine. As of 2026-07-17. But 'which one' shouldn't be decided by who you are — it should be decided by the shape of the job. What each front does best:
面Front
它最擅长Best at
代价 / 边界Cost / boundary
IDE 扩展IDE extension
陪你改,盯每一步 diffPairing, watching every diff
你得在场You must be present
CLICLI
进脚本、进管道、进 CIInto scripts, pipes, CI
要自己搭上下游You wire the up/downstream
ChatGPT 应用ChatGPT app
桌面 / 网页 / 手机,一处切本地与云Desktop / web / phone, switching local and cloud
重活仍要挑对环境Heavy work still needs the right environment
云端Cloud
批量、并行、不用你守着Batched, parallel, unwatched
要先配环境,回来才是 PRConfigure the environment first; PRs come back
2026 年 7 月起 ChatGPT 应用这一面变重了:原本独立的 Codex app 并进了 ChatGPT 桌面应用,Codex 保留自己的编码体验,和 Chat、Work 并排;新版带 diff 内联编辑、侧栏里的 PR 复审、多仓库项目。2注 2Note 2OpenAI Codex 文档 · What's new(2026-07-06–10)—— 7 月 9 日 Codex app 并入 ChatGPT 桌面应用(macOS / Windows),Codex 保留独立的编码体验,和 Chat、Work 并排;新增 diff 内联编辑、侧栏里的 PR 复审、由 GPT-5.6 驱动的更快 Computer Use、多仓库项目。桌面版对所有 ChatGPT 档位开放,含 Free。截至 2026-07-17。OpenAI Codex Docs · What's new (2026-07-06–10) — on July 9 the Codex app merged into the ChatGPT desktop app (macOS / Windows), keeping a dedicated coding experience beside Chat and Work; it adds inline editing in diffs, pull-request review in the side panel, faster Computer Use powered by GPT-5.6, and multi-repository projects. The desktop app is available on every ChatGPT plan, including Free. As of 2026-07-17.手机也在这一面里 —— ChatGPT 应用的 Remote 能连回你桌面上的 host,在路上派活、看 diff、留行内评论。2注 2Note 2OpenAI Codex 文档 · What's new(2026-07-06–10)—— 7 月 9 日 Codex app 并入 ChatGPT 桌面应用(macOS / Windows),Codex 保留独立的编码体验,和 Chat、Work 并排;新增 diff 内联编辑、侧栏里的 PR 复审、由 GPT-5.6 驱动的更快 Computer Use、多仓库项目。桌面版对所有 ChatGPT 档位开放,含 Free。截至 2026-07-17。OpenAI Codex Docs · What's new (2026-07-06–10) — on July 9 the Codex app merged into the ChatGPT desktop app (macOS / Windows), keeping a dedicated coding experience beside Chat and Work; it adds inline editing in diffs, pull-request review in the side panel, faster Computer Use powered by GPT-5.6, and multi-repository projects. The desktop app is available on every ChatGPT plan, including Free. As of 2026-07-17.Since July 2026 the ChatGPT-app front got heavier: the once-standalone Codex app merged into the ChatGPT desktop app, keeping its own coding experience beside Chat and Work; the new version brings inline editing in diffs, PR review in the side panel, and multi-repo projects.2注 2Note 2OpenAI Codex 文档 · What's new(2026-07-06–10)—— 7 月 9 日 Codex app 并入 ChatGPT 桌面应用(macOS / Windows),Codex 保留独立的编码体验,和 Chat、Work 并排;新增 diff 内联编辑、侧栏里的 PR 复审、由 GPT-5.6 驱动的更快 Computer Use、多仓库项目。桌面版对所有 ChatGPT 档位开放,含 Free。截至 2026-07-17。OpenAI Codex Docs · What's new (2026-07-06–10) — on July 9 the Codex app merged into the ChatGPT desktop app (macOS / Windows), keeping a dedicated coding experience beside Chat and Work; it adds inline editing in diffs, pull-request review in the side panel, faster Computer Use powered by GPT-5.6, and multi-repository projects. The desktop app is available on every ChatGPT plan, including Free. As of 2026-07-17. Phones live on this front too — the ChatGPT app's Remote connects back to a host on your desktop, so you dispatch work, read diffs, and leave inline comments on the go.2注 2Note 2OpenAI Codex 文档 · What's new(2026-07-06–10)—— 7 月 9 日 Codex app 并入 ChatGPT 桌面应用(macOS / Windows),Codex 保留独立的编码体验,和 Chat、Work 并排;新增 diff 内联编辑、侧栏里的 PR 复审、由 GPT-5.6 驱动的更快 Computer Use、多仓库项目。桌面版对所有 ChatGPT 档位开放,含 Free。截至 2026-07-17。OpenAI Codex Docs · What's new (2026-07-06–10) — on July 9 the Codex app merged into the ChatGPT desktop app (macOS / Windows), keeping a dedicated coding experience beside Chat and Work; it adds inline editing in diffs, pull-request review in the side panel, faster Computer Use powered by GPT-5.6, and multi-repository projects. The desktop app is available on every ChatGPT plan, including Free. As of 2026-07-17.
— II
一台引擎:配置走到哪跟到哪One Engine: Configuration Follows You Everywhere.
四个面驱动的是同一台引擎的同一套定制,这是最省心也最容易被忽略的一点。定制分几层协同:AGENTS.md 写持久的项目指令(第 5 章),config.toml 写本地默认 —— 模型、沙箱、审批、MCP,skills 打包可复用的流程,MCP 接外部工具。3注 3Note 3OpenAI Codex 文档 · Config basics / Customization —— Codex 的定制来自几层协同:AGENTS.md 是持久的项目指令、config.toml 是本地默认(模型、沙箱、审批、MCP)、skills 是可复用工作流、MCP 接外部工具。config-basic 原话:「The CLI and IDE extension share the same configuration layers.」配好后在两端之间切换无需重做。截至 2026-07-17。OpenAI Codex Docs · Config basics / Customization — Codex's customization comes from a few layers working together: AGENTS.md for persistent project instructions, config.toml for local defaults (model, sandbox, approvals, MCP), skills for reusable workflows, and MCP for external tools. config-basic verbatim: 'The CLI and IDE extension share the same configuration layers.' Switch between the two without redoing setup. As of 2026-07-17.其中 config.toml 这套配置层在 CLI 与 IDE 扩展间共用 —— 你在 CLI 里配好的一个 MCP 服务器,切到编辑器里照样在,配好一次不用重做。3注 3Note 3OpenAI Codex 文档 · Config basics / Customization —— Codex 的定制来自几层协同:AGENTS.md 是持久的项目指令、config.toml 是本地默认(模型、沙箱、审批、MCP)、skills 是可复用工作流、MCP 接外部工具。config-basic 原话:「The CLI and IDE extension share the same configuration layers.」配好后在两端之间切换无需重做。截至 2026-07-17。OpenAI Codex Docs · Config basics / Customization — Codex's customization comes from a few layers working together: AGENTS.md for persistent project instructions, config.toml for local defaults (model, sandbox, approvals, MCP), skills for reusable workflows, and MCP for external tools. config-basic verbatim: 'The CLI and IDE extension share the same configuration layers.' Switch between the two without redoing setup. As of 2026-07-17.All four fronts drive the same customization on one engine — the most reassuring and most overlooked point. Customization comes in cooperating layers: AGENTS.md holds persistent project instructions (chapter 5), config.toml holds local defaults — model, sandbox, approvals, MCP — skills package reusable procedures, and MCP wires in external tools.3注 3Note 3OpenAI Codex 文档 · Config basics / Customization —— Codex 的定制来自几层协同:AGENTS.md 是持久的项目指令、config.toml 是本地默认(模型、沙箱、审批、MCP)、skills 是可复用工作流、MCP 接外部工具。config-basic 原话:「The CLI and IDE extension share the same configuration layers.」配好后在两端之间切换无需重做。截至 2026-07-17。OpenAI Codex Docs · Config basics / Customization — Codex's customization comes from a few layers working together: AGENTS.md for persistent project instructions, config.toml for local defaults (model, sandbox, approvals, MCP), skills for reusable workflows, and MCP for external tools. config-basic verbatim: 'The CLI and IDE extension share the same configuration layers.' Switch between the two without redoing setup. As of 2026-07-17. Of these, the config.toml layers are shared between the CLI and the IDE extension — an MCP server you set up in the CLI is still there when you switch to the editor; configure once, no redo.3注 3Note 3OpenAI Codex 文档 · Config basics / Customization —— Codex 的定制来自几层协同:AGENTS.md 是持久的项目指令、config.toml 是本地默认(模型、沙箱、审批、MCP)、skills 是可复用工作流、MCP 接外部工具。config-basic 原话:「The CLI and IDE extension share the same configuration layers.」配好后在两端之间切换无需重做。截至 2026-07-17。OpenAI Codex Docs · Config basics / Customization — Codex's customization comes from a few layers working together: AGENTS.md for persistent project instructions, config.toml for local defaults (model, sandbox, approvals, MCP), skills for reusable workflows, and MCP for external tools. config-basic verbatim: 'The CLI and IDE extension share the same configuration layers.' Switch between the two without redoing setup. As of 2026-07-17.这条「一台引擎」的性质,决定了这本书的读法:后面讲 AGENTS.md(第 5 章)、MCP(第 6 章)、沙箱与审批(第 4 章),讲的都是引擎级的东西,四个面同时受益。你不是在学四个工具,是在配一台机器,然后决定从哪个面驱动它。This 'one engine' nature sets how to read this book: the later chapters on AGENTS.md (chapter 5), MCP (chapter 6), and sandbox and approvals (chapter 4) all describe engine-level things that benefit all four fronts at once. You aren't learning four tools; you're configuring one machine, then deciding which front to drive it from.
— III
本地、worktree、云端:一个窗口,三种去处Local, Worktree, Cloud: One Window, Three Destinations.
在 ChatGPT 桌面应用里开一个 Codex 对话,先选它在哪跑:Local 直接在你当前项目目录里改;Worktree 在一个 Git worktree 里隔离改动;Cloud 在配好的云端环境里远程跑 —— Local 和 Worktree 都在你这台电脑上。4注 4Note 4OpenAI Codex 文档 · Codex environments —— 在 ChatGPT 桌面应用里开始一个 Codex 对话时选它在哪跑:Local(直接在你当前项目目录)、Worktree(在 Git worktree 里隔离改动)、Cloud(在配置好的云端环境里远程跑);Local 与 Worktree 都在你的电脑上运行。截至 2026-07-17。OpenAI Codex Docs · Codex environments — when you start a Codex chat in the ChatGPT desktop app, choose where it runs: Local (directly in your current project directory), Worktree (isolate changes in a Git worktree), or Cloud (remotely in a configured cloud environment); both Local and Worktree run on your computer. As of 2026-07-17.这三种去处是「四面」在一个窗口里的落地:同一个 agent,你决定它的活留在前台、挪到后台、还是送上云。Open a Codex chat in the ChatGPT desktop app and first choose where it runs: Local edits directly in your current project directory; Worktree isolates changes in a Git worktree; Cloud runs remotely in a configured cloud environment — Local and Worktree both run on your computer.4注 4Note 4OpenAI Codex 文档 · Codex environments —— 在 ChatGPT 桌面应用里开始一个 Codex 对话时选它在哪跑:Local(直接在你当前项目目录)、Worktree(在 Git worktree 里隔离改动)、Cloud(在配置好的云端环境里远程跑);Local 与 Worktree 都在你的电脑上运行。截至 2026-07-17。OpenAI Codex Docs · Codex environments — when you start a Codex chat in the ChatGPT desktop app, choose where it runs: Local (directly in your current project directory), Worktree (isolate changes in a Git worktree), or Cloud (remotely in a configured cloud environment); both Local and Worktree run on your computer. As of 2026-07-17. These three destinations are 'four fronts' made concrete in one window: one agent, and you decide whether its work stays in the foreground, moves to the background, or goes up to the cloud.worktree 是这里的关键零件:它基于 git worktree,让 Codex 在同一个项目里并行跑多个互不干扰的对话 —— 各自一份检出,共享 .git 元数据,所以你能同时铺开好几件活而不打架。5注 5Note 5OpenAI Codex 文档 · Worktrees —— worktree 让 Codex 在同一个项目里并行跑多个互不干扰的对话(基于 git worktree,各自一份检出、共享 .git 元数据);Handoff 把一场对话连同 Git 状态在 Local 与 Worktree 之间安全搬移,由 Codex 处理底层的 Git 操作。仅在 ChatGPT 桌面应用的 Codex 里可用。截至 2026-07-17。OpenAI Codex Docs · Worktrees — worktrees let Codex run multiple independent, non-interfering chats in one project (built on git worktree — each its own checkout, sharing the .git metadata); Handoff moves a chat and its Git state safely between Local and Worktree, with Codex handling the underlying Git operations. Available only in Codex in the ChatGPT desktop app. As of 2026-07-17.搬动用 Handoff:把一场对话连同它的 Git 状态在 Local 与 Worktree 之间安全移动,底层那些容易出错的 Git 操作由 Codex 替你处理。5注 5Note 5OpenAI Codex 文档 · Worktrees —— worktree 让 Codex 在同一个项目里并行跑多个互不干扰的对话(基于 git worktree,各自一份检出、共享 .git 元数据);Handoff 把一场对话连同 Git 状态在 Local 与 Worktree 之间安全搬移,由 Codex 处理底层的 Git 操作。仅在 ChatGPT 桌面应用的 Codex 里可用。截至 2026-07-17。OpenAI Codex Docs · Worktrees — worktrees let Codex run multiple independent, non-interfering chats in one project (built on git worktree — each its own checkout, sharing the .git metadata); Handoff moves a chat and its Git state safely between Local and Worktree, with Codex handling the underlying Git operations. Available only in Codex in the ChatGPT desktop app. As of 2026-07-17.前台想专心时把活挪进 worktree 后台跑,要亲手验时再 Handoff 回 Local —— 这正是「不守着做完」在本地的样子,云端只是把它推到极限(第 7 章)。Worktrees are the key part here: built on git worktree, they let Codex run several independent, non-interfering chats in one project — each its own checkout, sharing the .git metadata, so you can fan out several jobs at once without collisions.5注 5Note 5OpenAI Codex 文档 · Worktrees —— worktree 让 Codex 在同一个项目里并行跑多个互不干扰的对话(基于 git worktree,各自一份检出、共享 .git 元数据);Handoff 把一场对话连同 Git 状态在 Local 与 Worktree 之间安全搬移,由 Codex 处理底层的 Git 操作。仅在 ChatGPT 桌面应用的 Codex 里可用。截至 2026-07-17。OpenAI Codex Docs · Worktrees — worktrees let Codex run multiple independent, non-interfering chats in one project (built on git worktree — each its own checkout, sharing the .git metadata); Handoff moves a chat and its Git state safely between Local and Worktree, with Codex handling the underlying Git operations. Available only in Codex in the ChatGPT desktop app. As of 2026-07-17. Moving between them uses Handoff: it shifts a chat and its Git state safely between Local and Worktree, with Codex handling the error-prone Git operations for you.5注 5Note 5OpenAI Codex 文档 · Worktrees —— worktree 让 Codex 在同一个项目里并行跑多个互不干扰的对话(基于 git worktree,各自一份检出、共享 .git 元数据);Handoff 把一场对话连同 Git 状态在 Local 与 Worktree 之间安全搬移,由 Codex 处理底层的 Git 操作。仅在 ChatGPT 桌面应用的 Codex 里可用。截至 2026-07-17。OpenAI Codex Docs · Worktrees — worktrees let Codex run multiple independent, non-interfering chats in one project (built on git worktree — each its own checkout, sharing the .git metadata); Handoff moves a chat and its Git state safely between Local and Worktree, with Codex handling the underlying Git operations. Available only in Codex in the ChatGPT desktop app. As of 2026-07-17. When you want the foreground clear, push work into a worktree in the background; when you need to verify by hand, Handoff it back to Local — this is 'finished without watching' in local form, and the cloud only pushes it to the limit (chapter 7).动手 · 把同一件活在两个面上各跑一次:Hands-on · run the same job on two fronts once each:
挑一件中等改动,先在编辑器 / Local 里陪着跑一遍,感受「盯每一步」的成本。Pick a medium change, run it once in the editor / Local while watching, and feel the cost of tracking every step.
同一类活,下次开一个 worktree 让它后台跑,你去干别的,回来只看 diff —— 对比你省下的时间。Next time, open a worktree for the same kind of work, let it run in the background while you do something else, and read only the diff — compare the time saved.
确认一次:你在一个面里配的 AGENTS.md 或 MCP,切到另一个面还在。共用一台引擎不是口号。Confirm once: an AGENTS.md or MCP you set on one front is still there on another. One shared engine isn't a slogan.
不是四个工具,
是一台引擎的四个入口.
Not four tools —
four entrances to one engine.
Aklman Library
— 讨论Discussion
讨论Discussion.
评论区初始化中…Initializing comments…
01 / 01
没有匹配结果No matches.
换个关键词,或按 Esc 回到页面Try another keyword, or press Esc to return