写代码:终端 / IDE / 云端 Agent 怎么选Coding agents: terminal vs IDE vs cloud
先定执行面(终端 / IDE / 云端),再比权限模型、后台续跑与仓库上下文;给每个候选写明适用条件与一句「什么情况下选另一个」。
Fix the execution surface first (terminal, IDE, cloud), then compare permission models, background continuation and repo context; each candidate gets its conditions and one line on when to pick another.
先定执行面,再挑产品Pick the surface first
写代码的 Agent 先分三类执行面,价格和模型都不是第一决策点:
| 执行面 | 代表 | 运行位置 | 适合的活 |
|---|---|---|---|
| 终端 | Claude Code CLI、Codex CLI、Gemini CLI | 你的 shell 与仓库 | 已有仓库、要脚本化、要看清每条命令 |
| IDE | Cursor、GitHub Copilot、Antigravity | 编辑器进程或厂商云 | 边写边看、要补全与内联 diff |
| 云端 | Devin、Cursor 云端 Agent | 厂商工作区 | 工单批量委派、合上笔记本还要继续跑 |
先问一句:改动是在你机器上跑,还是交给厂商云跑? 这一步会直接排除一半候选。
First distinguish three execution surfaces for a coding agent. Price and model choice come after deciding where work runs:
| Surface | Examples | Execution location | Work to consider |
|---|---|---|---|
| Terminal | Claude Code CLI, Codex CLI, Gemini CLI | Your shell and repository | Existing repositories, scripting, inspectable commands |
| IDE | Cursor, GitHub Copilot, Antigravity | Editor process or vendor cloud | Editing with completion and inline diffs |
| Cloud | Devin, Cursor Cloud Agents | Vendor workspace | Delegated issues and work continuing after the laptop closes |
Ask whether changes run on your machine or in a vendor cloud. This can eliminate unsuitable candidates before other comparisons.
六项对照Six dimensions
| 维度 | Claude Code CLI | Codex CLI | Gemini CLI | Cursor | Devin | Antigravity |
|---|---|---|---|---|---|---|
| 执行面 | 终端 | 终端 | 终端 | IDE + 云端 | 云端工作区 | 桌面 / CLI / IDE / SDK |
| 权限控制 | 权限粒度可配置(官方文档与 CHANGELOG 记录) | 命令执行需确认,app server 架构 | 非交互脚本模式,适合 CI | 编辑器内确认 + 云端 | 云端沙箱,工单派单 | 官方三档命令执行策略 |
| 后台续跑 | 本地进程 | 线程续接 | 脚本模式 | 合上笔记本仍继续(官方 2026 架构更新) | 原生异步 | harness 常驻 |
| 模型选择 | Anthropic 模型线 | OpenAI 模型线 | Gemini 模型线 | 多模型可切 | 厂商托管 | Gemini 线 |
| 许可/源代码 | 源码可见,All rights reserved | 仓库可见 | Apache-2.0 | 闭源 | 闭源 | 闭源 |
| 价格档位 | 订阅或 API,档位见官方定价页 | ChatGPT 档位或 API key | 免费配额 + 付费 API | Hobby / Pro / Teams / Enterprise | 团队报价 | 随 Google AI 计划 |
价格不写数字(本站纪律 D9);档位名与配额以各官方定价页为准。
| Dimension | Claude Code CLI | Codex CLI | Gemini CLI | Cursor | Devin | Antigravity |
|---|---|---|---|---|---|---|
| Surface | Terminal | Terminal | Terminal | IDE and cloud | Cloud workspace | Desktop / CLI / IDE / SDK |
| Permissions | Configurable granularity, documented in docs and CHANGELOG | Execution approvals; app-server architecture | Non-interactive scripting for CI | Editor approvals and cloud controls | Cloud sandbox, issue assignment | Three documented command-execution policies |
| Continuation | Local process | Thread continuation | Script mode | Cloud work can continue after the laptop closes | Asynchronous work | Persistent harness |
| Model line in snapshot | Anthropic | OpenAI | Gemini | Multiple models | Vendor-managed | Gemini |
| Licence/source | Source-visible, All rights reserved | Repository available | Apache-2.0 | Closed-source | Closed-source | Closed-source |
| Pricing basis | Subscription or API; official pricing tiers | ChatGPT tier or API key | Free quota and paid API | Hobby / Pro / Teams / Enterprise | Team quotation | Google AI plan |
No prices are collected here. Current tier names and quotas must be checked on each official pricing page.
每个候选的适用条件When each fits
Claude Code CLI:适合已有仓库、想把每一步命令摊在终端里看的人;使用前需核对命令、文件与工具的授权范围。能力边界是模型线固定在 Anthropic,要多模型得另配。什么情况下选另一个:要 IDE 内联补全就选 Cursor 或 Copilot;要完全开源可改的 CLI 就选 Gemini CLI。
Codex CLI:适合 OpenAI 生态、要线程续接与脚本化的人;Rust 实现、app server 是它的架构特征。什么情况下选另一个:团队已经押注 Anthropic,就选 Claude Code CLI。
Gemini CLI:Apache-2.0、npx 免安装、支持 MCP 与非交互脚本,适合 CI 与教学。什么情况下选另一个:需要按权限控制与变更记录对照时,再查 Claude Code CLI 的具体配置。
Cursor:适合要 IDE 体验、又要云端 Agent 续跑的人;官方区分云端 VM 与自托管机器的工具执行;自托管执行不等于模型请求、日志与全部数据都不出网,仍需核对网络设置与条款。什么情况下选另一个:只要终端、不想装编辑器,就选三家 CLI 之一。
Devin:适合把工单批量丢给云端、拿草稿 PR 再接管的人;Slack / Linear / Jira 可直接派单。什么情况下选另一个:改动必须在你本机、不能出网,就选终端或 IDE。
Antigravity:适合要在桌面指挥中心、CLI、IDE 扩展与 Python SDK 之间共用一套 harness 的团队;官方给了三档命令执行策略。什么情况下选另一个:只需要编辑器内工作流,可对照 Cursor 的 IDE 形态。
Claude Code CLI: a candidate for working in an existing repository with commands visible in a terminal. Check authorisation for commands, files and tools. Its default model line in this snapshot is Anthropic; other model requirements need separate configuration checks. Consider Cursor or Copilot for IDE completion, or Gemini CLI for an Apache-2.0 CLI you can modify.
Codex CLI: a candidate for the OpenAI ecosystem, thread continuation and scripting. Rust implementation and the app server are recorded architectural features. Consider Claude Code CLI when the team's requirements are tied to Anthropic.
Gemini CLI: Apache-2.0, launchable through npx, with MCP and non-interactive scripting for CI and teaching. For a permission-control comparison, examine Claude Code CLI's specific settings and change records.
Cursor: a candidate for an IDE workflow alongside cloud continuation. Official documentation distinguishes cloud VMs from tool execution on self-hosted machines. Self-hosted execution does not establish that model requests, logs and all other data stay offline; inspect network settings and terms separately. Consider a CLI when you only need a terminal.
Devin: a candidate for delegating issues to a cloud workspace and reviewing draft PRs afterwards, with Slack / Linear / Jira integrations. If work must run locally without outbound data, investigate the actual local execution and data path of terminal or IDE options.
Antigravity: a candidate for sharing a harness across desktop, CLI, IDE extension and Python SDK, with three documented command policies in this snapshot. If you only need an editor workflow, compare Cursor's IDE form.
核验事实Dated facts
- Gemini CLI 采用 Apache-2.0,支持
npx启动与 MCP(仓库 README,2026-10 快照)。 - Cursor 云端 Agent 在独立云端 VM 中运行,不依赖本机持续联网;官方另提供自托管机器执行路线。执行位置不能单独证明全链路不出网(官方 Cloud Agents 文档,2026-11-04 局部复核)。
- Antigravity 的命令执行策略为官方显式三档(2026-10-13 release notes 核验)。
- Claude Code CLI 有独立 CHANGELOG 与 Atom feed;源码可见但许可证为 All rights reserved(仓库页)。
- Codex CLI 为 Rust 实现,架构以 app server 与线程续接为核心(仓库与 releases)。
上表区分原有核验快照与第 2 项的局部复核日;版本发布日以官方 releases 为准,局部复核不代表全文重新核验。
- Gemini CLI is Apache-2.0-licensed and supports
npxstartup and MCP (repository README; October 2026 snapshot). - Cursor Cloud Agents run in isolated cloud VMs without requiring the local machine to stay online; a separate self-hosted machine execution path is documented. Execution location alone does not prove end-to-end offline processing (official Cloud Agents documentation; this item rechecked 2026-11-04).
- Antigravity explicitly documents three command-execution policies (release notes checked 2026-10-13).
- Claude Code CLI has a separate CHANGELOG and Atom feed; source is visible but the licence is All rights reserved (repository snapshot).
- Codex CLI is implemented in Rust, with app-server architecture and thread continuation recorded in its repository and releases.
These entries distinguish earlier verification snapshots from the scoped recheck of item 2. Use official releases for publication dates; a scoped recheck is not a new full-guide verification.
常见误判Common misreads
- 把「能跑终端」当成「能安全跑终端」:权限模型不同,默认确认与白名单是两回事。
- 把「云端续跑」当成「不用看」:草稿 PR 仍要人审,云端只省等待时间。
- 把「开源 CLI」当成「模型也开源」:CLI 的许可证与模型权重许可是两份文件。
- 把「支持 MCP」当成「工具即插即用」:server 的权限与数据范围仍要逐条看。
- Terminal execution does not establish safe execution. Default confirmations and allowlists are different permission designs.
- Cloud continuation does not remove review; a draft PR still needs inspection.
- An open-source CLI does not establish model-weight rights; their licences are separate.
- MCP support does not make tools ready for unrestricted use. Inspect each server's permissions and data scope.
出处Sources
| 来源Source | 链接URL |
|---|---|
| Anthropic · Claude Code 仓库与 CHANGELOG(源码可见、All rights reserved;2026-10 快照)Anthropic: Claude Code repository and CHANGELOG (source-visible, All rights reserved; October 2026 snapshot) | https://github.com/anthropics/claude-codehttps://github.com/anthropics/claude-code |
| OpenAI · Codex CLI 仓库与 releases(Rust 实现、app server;2026-10 快照)OpenAI: Codex CLI repository and releases (Rust, app server; October 2026 snapshot) | https://github.com/openai/codexhttps://github.com/openai/codex |
| Google · Gemini CLI 仓库(Apache-2.0、npx 启动、MCP;2026-10 快照)Google: Gemini CLI repository (Apache-2.0, npx, MCP; October 2026 snapshot) | https://github.com/google-gemini/gemini-clihttps://github.com/google-gemini/gemini-cli |
| Cursor · 官方文档(云端 Agent 的执行位置与网络控制;2026-11-04 局部复核)Cursor: official documentation (Cloud Agent execution location and network controls; scoped recheck 2026-11-04) | https://cursor.com/docshttps://cursor.com/docs |
| Devin · 官方文档(云端工作区、工单到草稿 PR)Devin: official documentation (cloud workspaces and issues to draft PRs) | https://docs.devin.aihttps://docs.devin.ai/ |
| Google Antigravity · 官方站(桌面/CLI/IDE/SDK 四面共用 harness,2026-10-13 核验)Google Antigravity: official site (shared harness across desktop, CLI, IDE and SDK; checked 2026-10-13) | https://antigravity.googlehttps://antigravity.google/ |
资料快照日期:2026-11-03;单项复核范围与日期见对应正文或来源记录。产品功能与条款可能变化,使用前请核对原始来源。Source snapshot: 2026-11-03; item-specific rechecks and their scope are recorded in the text or source notes. Features and terms may change; check the original sources before use.
这页出现在主题:This page appears in: 用 AI 写代码Write code with AI · 用 AI 做游戏Make games with AI · 把 AI 用对Use AI well