zgba 站群
← All Tools
💻 AI Coding ★ 45k+ GitHub Stars Free Plan VS Code Fork

Cursor AI – The AI-First Code Editor– AI 优先的代码编辑器

Cursor is a next-generation code editor built on VS Code, with AI deeply integrated at every level—from single-line completions to autonomous multi-file refactoring. It's become the default tool for AI-powered development workflows. Cursor 是一款基于 VS Code 的下一代代码编辑器,从单行补全到自主多文件重构,AI 深度融入每一层。它已成为 AI 驱动开发工作流的默认工具。

Visit cursor.com ↗ GitHub ↗ ⚖️ Compare
Developer开发商
Anysphere
Founded 2022, SF-based2022 年成立,位于旧金山
Pricing价格
Free / $20/mo免费 / 每月 20 美元
Hobby free, Pro $20/mo爱好者版免费,Pro 每月 20 美元
Models支持模型
Claude 4, GPT-4o
+ cursor-small
Platform平台
Win / Mac / Linux
VS Code-based基于 VS Code

What Is Cursor AI?什么是 Cursor AI?

Cursor is an AI-native code editor created by Anysphere, built as a fork of Visual Studio Code. Unlike AI extensions that bolt AI onto an existing editor, Cursor redesigns the editing experience around AI from the ground up. The result is an editor where AI understands your entire codebase—not just the file you have open. Cursor 是 Anysphere 打造的 AI 原生代码编辑器,是 Visual Studio Code 的一个分支。与"在现有编辑器上加 AI 扩展"的做法不同,Cursor 从底层重新设计了以 AI 为核心的编辑体验。最终呈现的是一个 AI 理解你整个代码库——而不只是当前打开文件——的编辑器。

Since its public launch in 2023, Cursor has become one of the fastest-growing developer tools ever, with thousands of developers switching from VS Code and abandoning GitHub Copilot for its more powerful multi-file editing capabilities. 自 2023 年公开上线以来,Cursor 成为史上增长最快的开发者工具之一,数以千计的开发者从 VS Code 迁移而来、放弃 GitHub Copilot,正是看中它更强的多文件编辑能力。

Key Features核心特性

  • ⚡
    Tab CompletionsTab 补全 — Predictive multi-line code completions that learn from your codebase patterns. Often completes entire functions correctly on the first suggestion.学习你代码库模式的多行预测式补全,常常第一次建议就能正确补全整个函数。
  • 💬
    Cursor ChatCursor 对话 — Ask questions about your code in natural language. Chat has full access to your codebase context, not just the open file.用自然语言提问代码相关问题,对话可访问整个代码库上下文,而不仅是打开的文件。
  • 🎯
    Composer ModeComposer 模式 — Make large-scale changes across multiple files simultaneously. Describe what you want and Cursor edits all affected files in one operation.一次操作对多个文件做大规模改动。描述你的需求,Cursor 即可一次性修改所有相关文件。
  • 🤖
    Agent ModeAgent 模式 — Autonomous coding agent that can run terminal commands, create files, and iterate until a task is complete.自主编码智能体,可运行终端命令、创建文件并迭代直至任务完成。
  • 📋
    .cursorrules.cursorrules 指令 — Project-level AI instructions. Define coding standards, preferred patterns, and project context that persist across all AI interactions.项目级 AI 指令,定义编码规范、偏好模式与项目上下文,贯穿所有 AI 交互。
  • 🔒
    Privacy Mode隐私模式 — Disables code storage on Cursor's servers. Required for sensitive enterprise codebases.禁止代码存储到 Cursor 服务器,适用于敏感的企业代码库。

Pricing Plans价格方案

Hobby爱好者版
Free免费
forever永久免费
  • 2,000 completions/month每月 2,000 次补全
  • 50 slow premium requests50 次慢速高级请求
  • GPT-4o mini access可使用 GPT-4o mini
  • Basic Composer基础 Composer
Business企业版
$40
per user/month每用户 / 每月
  • Everything in Pro包含 Pro 全部权益
  • Team management团队管理
  • SSO / SAMLSSO / SAML 单点登录
  • Admin dashboard管理员面板
  • SOC 2 complianceSOC 2 合规

Use Cases典型使用场景

Solo Developers & Freelancers个人开发者与自由职业者

The free Hobby plan is sufficient for light use. Pro unlocks the full potential—most solo devs report that Cursor's Tab completions alone save 1-2 hours of coding time per day. Composer mode is particularly valuable for refactoring legacy code or bootstrapping new projects.轻量使用的话免费爱好者版就够了。Pro 版才能解锁全部潜力——多数独立开发者反馈,仅 Tab 补全每天就能省下 1-2 小时编码时间。Composer 模式对重构遗留代码或快速搭建新项目尤其有价值。

Startup Teams创业团队

Teams building fast use Agent mode to handle repetitive tasks: writing tests, updating documentation, migrating code to new APIs. The .cursorrules file lets the entire team share AI context and coding standards automatically.快速迭代的团队用 Agent 模式处理重复任务:写测试、更新文档、把代码迁移到新 API。.cursorrules 文件让全团队自动共享 AI 上下文与编码规范。

Enterprise Development企业级开发

The Business plan with Privacy Mode is used by engineering teams at major companies who need AI-assisted development without code leaving their security perimeter. SOC 2 compliance and SSO integration make enterprise adoption straightforward.大公司的工程团队使用带隐私模式的企业版,在代码不离开安全边界的前提下进行 AI 辅助开发。SOC 2 合规与 SSO 集成让企业落地变得简单直接。

Who Should Use Cursor? 谁适合使用 Cursor?

✓ Good Fit For适合以下场景

  • Developers who want AI pair-programming inside a full IDE — Cursor handles context windows up to 200K tokens per conversation希望在完整 IDE 内进行 AI 结对编程的开发者——Cursor 单次对话支持最高 200K token 上下文
  • Teams using Python, TypeScript, or Rust who want fast multi-line autocomplete and one-shot file edits使用 Python、TypeScript 或 Rust、需要快速多行自动补全和一次性文件编辑的团队
  • Engineers who want agent-style coding (Cursor Composer) that can edit multiple files in a single prompt希望用智能体式编码(Cursor Composer)在单条提示中编辑多个文件的工程师

✕ Not Ideal For不适合以下场景

  • Developers in strictly air-gapped environments — Cursor requires cloud API calls even for local models严格隔离环境中开发的开发者——即使本地模型,Cursor 也需要云端 API 调用
  • Teams already deep in JetBrains IDEs (IntelliJ, PyCharm) who don't want to switch editors深度使用 JetBrains IDE(IntelliJ、PyCharm)且不想更换编辑器的团队
  • Budget-conscious individuals: the Pro plan at $20/month adds up quickly for hobby projects预算敏感的个人用户:每月 20 美元的 Pro 版对业余项目来说成本累积较快

Pros & Cons优点与不足

Pros优点

  • Best multi-file AI editing available市面上最强的多文件 AI 编辑能力
  • 100% VS Code extension compatible100% 兼容 VS Code 扩展
  • Supports Claude 4 and GPT-4o支持 Claude 4 与 GPT-4o
  • Agent mode can complete full tasks autonomouslyAgent 模式可自主完成完整任务
  • Active development, frequent updates积极开发,更新频繁
  • Strong community and documentation社区与文档完善

Cons不足

  • Paid plan needed for heavy use重度使用需要付费套餐
  • Requires cloud inference (no offline AI)依赖云端推理(不支持离线 AI)
  • Privacy concerns for sensitive codebases敏感代码库存在隐私顾虑
  • Can be slow with very large codebases超大代码库时可能变慢
  • Occasional incorrect multi-file edits偶尔出现错误的多文件修改

Cursor vs GitHub CopilotCursor 对比 GitHub Copilot

The most common comparison. GitHub Copilot is an extension that works inside your existing editor (VS Code, JetBrains, Vim). Cursor is a complete editor replacement. The key differences: 这是最常见的对比。GitHub Copilot 是运行在现有编辑器(VS Code、JetBrains、Vim)里的扩展;Cursor 则是完整的编辑器替代品。核心区别如下:

  • Multi-file editing多文件编辑: Cursor's Composer can edit 10+ files at once. Copilot is limited to the current file context.Cursor 的 Composer 可一次编辑 10+ 个文件;Copilot 局限于当前文件上下文。
  • Codebase understanding代码库理解: Cursor indexes your entire repo. Copilot uses the open file plus a small window of recent files.Cursor 为整个仓库建索引;Copilot 只结合当前文件与少量最近文件。
  • Model choice模型选择: Cursor supports Claude 4, GPT-4o, and more. Copilot uses GPT-4o exclusively.Cursor 支持 Claude 4、GPT-4o 等多种模型;Copilot 仅用 GPT-4o。
  • Autonomy自主性: Cursor's Agent mode can run commands and iterate independently. Copilot remains purely inline.Cursor 的 Agent 模式可独立运行命令并迭代;Copilot 仅停留在内联补全。

Verdict结论: For serious AI-powered development, Cursor is the stronger choice. Copilot makes sense if you're locked into the GitHub ecosystem or prefer not to switch editors.认真做 AI 驱动开发的话,Cursor 是更强的选择;如果你深度绑定 GitHub 生态或不想换编辑器,Copilot 更合适。

Getting Started快速上手

# macOS: brew install --cask cursor
# Windows/Linux: download from https://cursor.com
💡 Free tier includes 2000 completions and 50 slow premium requests per month. Pro ($20/mo) unlocks unlimited completions and 500 fast premium requests. Agent mode uses premium model credits.免费档每月含 2,000 次补全和 50 次慢速高级请求;Pro(每月 20 美元)解锁不限量补全和 500 次快速高级请求。Agent 模式消耗高级模型额度。
  1. Download Cursor from cursor.com for your OS.从 cursor.com 下载对应系统的 Cursor。
  2. On first launch, import your VS Code settings (optional but recommended).首次启动时导入你的 VS Code 设置(可选但推荐)。
  3. Open a project and try Cmd/Ctrl + K to edit with AI inline, or Cmd/Ctrl + I for Composer.打开项目后用 Cmd/Ctrl + K 进行 AI 内联编辑,或用 Cmd/Ctrl + I 打开 Composer。
  4. Create a .cursorrules file in your project root with your coding standards.在项目根目录创建包含编码规范的 .cursorrules 文件。
  5. Try Agent mode: open Composer, enable Agent, and describe a full feature to implement.试试 Agent 模式:打开 Composer、启用 Agent,然后描述一个要实现的完整功能。

Alternatives to CursorCursor 的替代品

Prompt Examples提示词示例

Here are real-world prompts that work well in Cursor's Composer and Chat. Copy and adapt them for your projects.以下是经实战验证、在 Cursor 的 Composer 和 Chat 中效果良好的提示词,可复制并按项目情况调整。

🏗️ Feature Implementation (Composer / Agent)功能实现(Composer / Agent)

Use in Composer with Agent mode enabled for full autonomous execution.在 Composer 中启用 Agent 模式使用,可实现完全自主执行。

Add a user authentication system to this Express.js app. Use JWT tokens stored in HTTP-only cookies. Protect all /api/user/* routes. Write unit tests with Jest for the auth middleware. Follow the existing code style in this project.

🔁 Refactoring Across Files (Composer)跨文件重构(Composer)

Refactor all API calls in the /services directory to use the new ApiClient class I created in src/lib/apiClient.ts. Replace every direct fetch() or axios() call. Make sure error handling is consistent. Do not change any business logic.

🐛 Bug Investigation (Chat)Bug 排查(Chat)

The checkout flow fails when a user applies a discount code and then changes their cart quantity. Trace through the order calculation logic and identify where the discount is being applied incorrectly. Show me the exact lines causing the issue.

📝 Test Generation (Composer)测试生成(Composer)

Write comprehensive Vitest unit tests for the userService.ts module. Cover all exported functions, edge cases (empty inputs, null values), and error paths. Match the test structure in the existing __tests__ directory.

Best Practices最佳实践

1. Write a Good .cursorrules File写一份高质量的 .cursorrules 文件

The single highest-leverage thing you can do to improve Cursor's output. A well-written .cursorrules file means you never have to repeat project context in prompts. Include:这是提升 Cursor 输出的最高杠杆动作。一份写好的 .cursorrules 文件意味着你无需在提示词中反复交代项目上下文,建议包含:

  • Tech stack技术栈: exact versions — "React 18, TypeScript 5.4, Tailwind CSS 3.4, Prisma 5"写清精确版本——"React 18, TypeScript 5.4, Tailwind CSS 3.4, Prisma 5"
  • Code style rules代码风格规范: "Use arrow functions, never var, prefer const, use named exports""用箭头函数、不用 var、优先 const、使用命名导出"
  • Testing framework测试框架: "Vitest + React Testing Library, tests in __tests__ next to source files""Vitest + React Testing Library,测试放在源码旁的 __tests__ 目录"
  • Patterns to follow应遵循的模式: "State management via Zustand, no Redux. API calls via React Query, not useEffect.""状态管理用 Zustand,不用 Redux;API 调用走 React Query,不用 useEffect。"
  • What NOT to do禁止事项: "Never use class components. Do not add console.log statements.""不要用类组件,不要加 console.log 语句。"

2. Use Agent Mode for Complex Tasks复杂任务使用 Agent 模式

Agent mode (Composer with "Agent" toggled on) lets Cursor run terminal commands and iterate until the task passes. Best used for: implementing a feature end-to-end, running and fixing failing tests, setting up a new integration. Be specific about your acceptance criteria—"make all tests pass" is a great stopping condition.Agent 模式(在 Composer 中打开 "Agent" 开关)让 Cursor 运行终端命令并迭代直到任务通过。适合:端到端实现功能、运行并修复失败的测试、搭建新的集成。验收标准要写具体——"让所有测试通过"就是个很好的终止条件。

3. Scope Your Context with @ Mentions用 @ 提及限定上下文

In Chat and Composer, use @filename to pin specific files into context. This is faster and more precise than letting Cursor guess which files are relevant. For large codebases, always mention the specific files you want edited rather than relying on codebase search.在 Chat 和 Composer 中用 @文件名 把特定文件钉进上下文,比让 Cursor 猜测相关文件更快更准。大型代码库里务必指明要编辑的具体文件,别依赖代码库搜索。

4. Review Multi-File Diffs Before Accepting接受前检查多文件 diff

When Composer makes changes across multiple files, always review each diff individually before accepting. Cursor occasionally over-edits adjacent functions. Use Ctrl+Z (undo) to revert specific file changes if needed—it works independently per file.Composer 跨文件改动时,接受前务必逐个检查每个 diff。Cursor 偶尔会过度修改相邻函数。需要时用 Ctrl+Z(撤销)回退特定文件的改动——它对每个文件独立生效。

5. Set Model Per Task按任务选择模型

Use cursor-small for Tab completions and simple Chat questions (faster, cheaper). Switch to Claude 4 or GPT-4o for complex Composer tasks, architectural questions, and debugging. The model selector is per-request in Chat and can be set as default in Settings.Tab 补全和简单的 Chat 提问用 cursor-small(更快更便宜);复杂的 Composer 任务、架构问题和调试切换到 Claude 4 或 GPT-4o。Chat 中模型可按请求选择,也可在设置中设默认。

Frequently Asked Questions常见问题

Is Cursor AI free to use? Cursor AI 免费吗? ▼
Yes. Cursor offers a free Hobby plan with 2,000 completions and 50 premium requests per month. The Pro plan ($20/month) unlocks unlimited completions and access to Claude 4 and GPT-4o.免费。Cursor 提供免费爱好者版,每月 2,000 次补全和 50 次高级请求;Pro 版(每月 20 美元)解锁不限量补全和 Claude 4、GPT-4o 使用权。
Does Cursor store my code? Cursor 会存储我的代码吗? ▼
By default, Cursor may log prompts and completions for quality improvement. Enable Privacy Mode (Settings → Privacy) to prevent your code from being stored on Cursor's servers. Enterprise Business plans include full data isolation.默认情况下 Cursor 可能记录提示词与补全以改进质量。开启隐私模式(设置 → 隐私)可防止代码存储到 Cursor 服务器;企业版包含完整的数据隔离。
What AI models does Cursor support? Cursor 支持哪些 AI 模型? ▼
Cursor supports Claude 3.5 Sonnet, Claude 4, GPT-4o, GPT-4o mini, and cursor-small (a fast model optimized for completions). Pro users can switch models per request from the model picker.Cursor 支持 Claude 3.5 Sonnet、Claude 4、GPT-4o、GPT-4o mini 以及 cursor-small(为补全优化的快速模型)。Pro 用户可在模型选择器中按请求切换。
Can I use my VS Code extensions in Cursor? Cursor 能用我的 VS Code 扩展吗? ▼
Yes. Cursor is a fork of VS Code and is 100% compatible with VS Code extensions from the Open VSX Registry and most extensions from the VS Code Marketplace. Import your existing profile via File → Preferences → Import VS Code Settings.可以。Cursor 是 VS Code 的分支,100% 兼容 Open VSX Registry 的扩展及 VS Code Marketplace 上大多数扩展。通过 文件 → 首选项 → 导入 VS Code 设置 导入现有配置。
How does .cursorrules work? .cursorrules 如何工作? ▼
A .cursorrules file in your project root contains plain-text instructions that are automatically included in every AI prompt. Use it to define your tech stack, coding standards, preferred patterns, and any project-specific context that the AI should always be aware of.项目根目录的 .cursorrules 文件包含纯文本指令,会自动附加到每一条 AI 提示词中。用它定义技术栈、编码规范、偏好模式以及 AI 始终需要了解的项目上下文。