CandidDevelopers
cd ../setup-guides
$catcursor-setup.md

// Cursor

AI-native code editor built on VS Code. Cursor ships with built-in AI features — Tab completion, inline chat, and a powerful Agent mode — all configurable to use your preferred API provider (DeepSeek, Kimi K2.6, etc.).

v1.0|7 sections|IDE|subscription

01# Overview

Cursor is a fork of VS Code rebuilt from the ground up for AI-assisted development. It keeps full VS Code compatibility (extensions, keybindings, settings) while adding native AI features that go far beyond what extensions can offer — multi-file edits, codebase-aware context, and an autonomous Agent mode that can run terminal commands on your behalf.

Tab Completion

Context-aware autocomplete that predicts multi-line edits

Inline Chat (Cmd+K)

Edit or generate code inline without leaving the file

Agent Mode

Autonomous agent that plans, edits files, and runs commands

Codebase Context

Indexes your project for accurate, grounded answers

VS Code Compatible

All your extensions, themes, and keybindings carry over

Multi-file Edits

Applies changes across multiple files in one action

02# Installation

Download Cursor from the official site and install it like any desktop app:

bash
# 1. Download from cursor.com
#    Available for macOS, Windows, and Linux

# 2. On macOS you can also use Homebrew:
brew install --cask cursor

# 3. Launch Cursor and import your VS Code settings
#    Cursor will detect your existing VS Code installation
#    and offer to import extensions, themes, and keybindings
📌VS Code Migration
When you first launch Cursor, it will prompt you to import your VS Code settings. This includes extensions, themes, keybindings, and user settings — everything carries over seamlessly. You can run both editors side by side if you prefer a gradual transition.

03# Configure API Key

Configure Cursor to route AI requests through your preferred API provider. This lets you use your team's shared API key for all AI features.

bash
# 1. Open Cursor Settings
#    Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
#    Search: "Cursor Settings" → Open

# 2. Go to the "Models" tab

# 3. Under "OpenAI API Key", enter your API key:
#    → Paste your API key (DeepSeek, Kimi K2.6, etc.)

# 4. Under "Override OpenAI Base URL", set:
https://candidplatform.abacus.ai/v1

# 5. Enable the models you want to use
#    Select the model from the dropdown in the chat panel

# 6. Toggle ON "Enable OpenAI API Key" to activate
💡Verify the Connection
After configuring, open the Cursor chat panel (Cmd+L) and send a test message. If you get a response, your API endpoint is working correctly. If you see an error, double-check that the base URL ends with /v1 and the API key has no extra spaces.

04# Agent Mode

Agent mode is Cursor's most powerful feature. Instead of just answering questions, the Agent autonomously plans and executes multi-step tasks — editing files, running terminal commands, and iterating until the task is complete.

bash
# Open the chat panel:
Cmd+L  (or Ctrl+L on Windows/Linux)

# Switch to Agent mode:
# → Click the mode dropdown at the top of the chat panel
# → Select "Agent" (instead of "Ask" or "Edit")

# Example Agent prompts:
"Add authentication to this Express app using JWT"
"Write tests for the UserService class and run them"
"Refactor this component to use React Query"
"Find and fix the bug causing the 500 error on /api/users"

Runs commands

Executes terminal commands with your approval

Multi-file edits

Creates and modifies files across your project

Self-correcting

Reads errors and iterates until it works

Context-aware

Uses your codebase index for accurate edits

🚨Review Before Accepting
Agent mode can run terminal commands and modify files. Always review the proposed changes before accepting. Use Cmd+Z to undo if something goes wrong. You can configure auto-accept rules in Cursor Settings → Features → Agent.

05# Core Workflows

Tab Completion

Cursor Tab goes beyond single-line autocomplete — it predicts multi-line edits based on your recent changes and cursor position.

bash
# Tab completion is always active as you type.
# Accept suggestions with Tab, dismiss with Esc.

# Pro tip: After making an edit, move your cursor
# to a similar location — Tab will predict the
# same pattern of change automatically.

Inline Edit (Cmd+K)

Select code and press Cmd+K to open the inline edit prompt. Describe what you want to change and Cursor will rewrite the selection.

bash
# Select a block of code, then press Cmd+K:

# Example prompts:
"Convert this to TypeScript"
"Add error handling and input validation"
"Optimize this database query"
"Add JSDoc comments to all functions"

# Accept with Enter, reject with Escape

Chat with Context (Cmd+L)

The side chat panel lets you ask questions and request changes with full project context. You can reference specific files, folders, or even documentation URLs.

bash
# Open chat panel: Cmd+L

# Reference files in your prompt:
"Explain how @src/auth/middleware.ts works"
"Update @package.json to add vitest"

# Reference folders:
"Summarise the architecture in @src/services/"

# Reference docs:
"Using @https://docs.example.com, implement the v2 API"

06# Project Rules

Project rules let you define guidelines that Cursor follows across all AI interactions. Create a .cursorrules file in your project root:

bash
# .cursorrules — place in your project root

You are an expert full-stack developer working on this project.

Rules:
- Use TypeScript strict mode for all new files
- Follow the existing project structure and naming conventions
- Use the team's shared component library in @/components/ui
- Write unit tests for all new utility functions
- Prefer server components unless client interactivity is needed
- Use Prisma for all database operations
- Handle errors gracefully with proper error boundaries
- Add JSDoc comments to exported functions
💡Rules Are Automatic
Cursor automatically reads .cursorrules from your project root and applies them to every AI interaction — chat, inline edit, and Agent mode. No manual setup needed. You can also set global rules in Cursor Settings → Rules for AI.

07# Best Practices

Use @-references for precision

Reference specific files with @filename in your prompts. This gives the AI exact context instead of guessing which files are relevant.

Start with Ask, graduate to Agent

Use Ask mode to understand code, Edit mode for targeted changes, and Agent mode for complex multi-step tasks. Match the mode to the complexity.

Set up .cursorrules early

Define project conventions before you start prompting. This prevents the AI from making style choices that conflict with your codebase.

Review Agent diffs carefully

Agent mode can make sweeping changes. Always review the diff before accepting. Use the built-in diff view to understand what changed and why.

Leverage codebase indexing

Let Cursor index your full project (Settings → Features → Codebase Indexing). This dramatically improves context quality for large codebases.

Commit before big Agent tasks

Always commit your work before starting a complex Agent task. If the result is not what you wanted, you can easily revert to a known good state.

08# Terminal Compatibility

💡Works with Claude Code & Codex via Terminal
Cursor has an integrated terminal. You can run Claude Code or Codex CLI directly inside it — giving you two AI coding engines in one workspace. This does not break any terms of service; you're simply using the terminal as you would any other shell. Check our Claude Code and Codex setup guides to get started.