Back to All Cheatsheet Libraries cheatsheets

Cursor IDE Cheatsheet

Master command reference, dev/prompting shortcuts, and setup guides for Cursor's AI-native editor.

Choose the Right Surface

Agent

Edits files, runs terminal commands, searches the codebase, and executes multi-step tasks.

Default mode

Plan

Researches code, asks questions, and constructs a reviewable plan before editing anything.

Shift + Tab

Ask

Explores codebase architecture and explains code without editing any files.

/ask

Inline Edit

Makes a targeted edit to the selected code directly inside the editor.

⌘ K · Ctrl K

Command Reference

Total Shortcuts: 0
Category Action macOS Windows Description
AgentToggle Agent Sidepanel Essential⌘ ICtrl IOpen or close the main Agent panel.
AgentToggle Agent Layout Essential⌘ ECtrl ESwitch between editor and agent view layout.
AgentOpen Mode Switcher Essential⌘ .Ctrl .Toggle between Agent, Plan, or Ask modes.
AgentCycle Agent Modes Essential⇧ TabShift TabRotate through the active AI modes.
AgentCycle AI Models Advanced⌘ /Ctrl /Cycle through the available AI models.
AgentNudge Agent EssentialReturnEnterSend the default prompt nudge.
AgentQueue Message AdvancedCtrl ReturnCtrl EnterQueue a message while the agent is still acting.
AgentSend Immediately Advanced⌘ ReturnCtrl EnterSend the prompt and interrupt the current task.
AgentToggle Voice Input Advanced⌘ ⇧ SpaceCtrl Shift SpaceActivate voice dictation.
EditInline Code Edit Essential⌘ KCtrl KGenerate or edit code right at the cursor.
TabAccept Auto-suggestion EssentialTabTabAccept the autocomplete suggestion.
TabAccept Next Word Advanced⌘ →Ctrl →Accept the suggestion one word at a time.
TabReject Suggestion EssentialEscEscDismiss the active autocomplete suggestion.
NavigateCommand Palette Essential⌘ ⇧ PCtrl Shift POpen the main IDE command palette.
NavigateQuick Open File Essential⌘ PCtrl PNavigate to a file by name.
NavigateGlobal Search Essential⌘ ⇧ FCtrl Shift FSearch text across the whole codebase.
TerminalToggle Terminal Essential⌃ `Ctrl `Open the integrated terminal panel.
SetupCursor Settings Essential⌘ ⇧ JCtrl Shift JOpen Cursor's own options and settings.
SetupGeneral Options Essential⌘ ,Ctrl ,Open the global settings panel.

The CLEAR Framework

Define strict boundaries so Cursor executes accurately without unnecessary edits.

C · Context

State the stack, scope, baseline functionality, and the relevant source files.

L · Limits

Define which files are in scope, which modules are untouchable, and any other constraints.

E · Expected

Detail the expected end-state behavior and the visual or functional outcome.

A · Actions

Explicitly list the steps Cursor should execute, in order, and how to verify them.

Prompt Templates

New Feature Blueprint
Inspect the existing component architecture before writing code. Preserve current UI tokens, responsive layouts, and strict TypeScript types. Create a reviewable plan first. Implement only after confirmation, and run tests upon completion.
Bug Investigation & Root Cause
Reproduce the issue first. Trace the data flow across modules, isolate the root cause with evidence, and fix it with the minimal code delta. Do not refactor unrelated code. Verify the fix with unit tests.

Project Rules (.cursor/rules/*.mdc)

Configure project-wide instructions to standardize agent code output across a team.

Rule File Best Practices
  • Keep rules modular and path-scoped using globs.
  • Reference canonical code files as structural examples.
  • Use AGENTS.md for directory-level domain context.
  • Store custom rules under .cursor/rules/name.mdc.
---
description: Frontend TSX standards
globs: src/components/**/*.tsx
alwaysApply: false
---
- Use Tailwind CSS tokens for colors and spacing.
- Enforce strict typing; avoid `any`.
- Keep components modular and export pure functions.

Model Context Protocol

Integrate external databases, documentation scraping, and API calls directly into Cursor's Agent loop using MCP.

Transport Options

Use stdio for local tools and HTTP/SSE for remote services.

Least Privilege

Restrict write capabilities; assign read-only access wherever possible.

Scoped Config

Use a project-level mcp.json for repository-specific tooling.

Environment Keys

Pass credentials securely using environment variables, e.g. ${env:KEY}.

{
  "mcpServers": {
    "database": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": { "DATABASE_URL": "${env:DATABASE_URL}" }
    }
  }
}

CLI Installation

Control the Cursor Agent directly from a terminal, run isolated tasks in Git worktrees, and resume sessions seamlessly.

macOS / Linux
Installs the Cursor Agent CLI via the official install script.
curl https://cursor.com/install -fsS | bash
Windows PowerShell
Installs the Cursor Agent CLI on Windows via PowerShell.
irm 'https://cursor.com/install?win32=true' | iex

Production Loops

The safest AI workflow cycles between autonomous agent execution and human validation loops.

Safe Change Directive

A prompt template that forces a review-before-execute loop on any risky change.

1

Inspect the repository first

Do not modify any files yet — read the relevant code and identify every targeted file.

2

Explain the proposed architecture change

List the risk factors and construct a test plan before touching any code.

3

Await explicit approval

Only execute the change once the plan has been reviewed and approved.

Inspect repository first. Do not modify files. Identify targeted files, explain proposed architecture changes, list risk factors, and construct a test plan. Await explicit approval before execution.

Safety Guardrails

Keep automated code generation safe and deterministic with explicit boundaries and automated checks.

Safe Defaults
Use Plan mode for discovery, review diffs line-by-line, and run unit tests prior to merging.
Review First
Audit package installations, database migration scripts, and any write-enabled MCP server calls.
High Risk
Never commit raw API keys or secrets in prompts. Keep .env files listed in .cursorignore.