Skip to content

Cursor

Cursor is an AI-powered code editor built on VS Code that integrates advanced AI capabilities for code generation, editing, and debugging with support for multiple AI models including GPT-4 and Claude.

CommandDescription
Download from cursor.shInstall Cursor from official website
cursor --versionCheck installed version
cursor .Open current directory in Cursor
cursor file.pyOpen specific file
cursor --helpDisplay help information
cursor --extensions-dirShow extensions directory
ShortcutDescription
Ctrl+K / Cmd+KOpen AI command palette
Ctrl+L / Cmd+LOpen AI chat panel
Ctrl+I / Cmd+IInline AI editing
TabAccept AI suggestion
EscapeReject AI suggestion
Alt+] / Option+]Next AI suggestion
Alt+[ / Option+[Previous AI suggestion
CommandDescription
@workspaceReference entire workspace
@fileReference specific file
@folderReference folder contents
@codeReference selected code
@docsReference documentation
@webSearch web for context
@gitReference git history
ShortcutDescription
Ctrl+K then type promptGenerate code inline
Ctrl+K then Ctrl+AGenerate entire file
Ctrl+K then Ctrl+DGenerate documentation
Ctrl+K then Ctrl+TGenerate tests
Ctrl+K then Ctrl+RRefactor code
Ctrl+K then Ctrl+FFix code issues
CommandDescription
”Create a function that…”Generate specific function
”Add error handling to this code”Improve existing code
”Convert this to TypeScript”Language conversion
”Optimize this algorithm”Performance optimization
”Add comments to explain this”Documentation generation
ShortcutDescription
Select code + Ctrl+KEdit selected code
Select code + Ctrl+IInline edit selection
Ctrl+Shift+KEdit with context
Alt+KQuick edit
ShortcutDescription
Ctrl+Alt+Down / Cmd+Option+DownAdd cursor below
Ctrl+Alt+Up / Cmd+Option+UpAdd cursor above
Ctrl+D / Cmd+DSelect next occurrence
Ctrl+Shift+L / Cmd+Shift+LSelect all occurrences
SettingDescription
GPT-4Default model for complex tasks
GPT-3.5-turboFaster model for simple tasks
Claude-3Alternative model for coding
CodexSpecialized for code generation
Custom modelsConfigure local or custom models
ShortcutDescription
Ctrl+P / Cmd+PQuick file open
Ctrl+Shift+P / Cmd+Shift+PCommand palette
Ctrl+Shift+E / Cmd+Shift+EExplorer panel
Ctrl+Shift+F / Cmd+Shift+FSearch across files
Ctrl+Shift+G / Cmd+Shift+GSource control
CommandDescription
@search "semantic query"Semantic code search
@find "natural language"Natural language file finding
@grep "pattern with AI"AI-enhanced grep
FeatureDescription
AI Debug AssistantExplain debugging output
Error ExplanationAI explains error messages
Fix SuggestionsAI suggests fixes for bugs
Breakpoint AnalysisAI analyzes breakpoint context
ShortcutDescription
F5Start debugging
F9Toggle breakpoint
F10Step over
F11Step into
Shift+F11Step out
Ctrl+Shift+F5Restart debugging
CommandDescription
@git diffAI explains git differences
@git commitGenerate commit messages
@git branchSuggest branch names
@git mergeHelp with merge conflicts
ShortcutDescription
Ctrl+Shift+G / Cmd+Shift+GSource control panel
Ctrl+Enter / Cmd+EnterCommit changes
Ctrl+Shift+P then “Git”`Git commands
ExtensionDescription
Cursor AICore AI functionality
GitHub CopilotAdditional AI assistance
PrettierCode formatting
ESLintJavaScript linting
PythonPython language support
Live ShareReal-time collaboration
SettingDescription
cursor.ai.modelDefault AI model
cursor.ai.temperatureAI creativity level
cursor.ai.maxTokensMaximum response length
cursor.ai.autoCompleteEnable auto-completion
cursor.ai.inlineChatEnable inline chat
FeatureDescription
Multi-file editingEdit multiple files simultaneously
Project-wide changesApply changes across entire project
Dependency trackingTrack file dependencies
Batch operationsPerform bulk operations
AgentDescription
Code AgentSpecialized for code tasks
Debug AgentFocused on debugging
Test AgentGenerates and runs tests
Docs AgentCreates documentation
Refactor AgentCode refactoring specialist
CommandDescription
@python "create class"Generate Python classes
@python "add type hints"Add type annotations
@python "create tests"Generate pytest tests
@python "optimize"Performance optimization
CommandDescription
@js "create component"Generate React components
@ts "add types"Add TypeScript types
@js "async/await"Convert to async/await
@js "error handling"Add error handling
CommandDescription
@rust "safe code"Generate safe Rust code
@go "concurrent"Go concurrency patterns
@java "spring boot"Spring Boot applications
@cpp "modern cpp"Modern C++ features
TemplateDescription
@template apiREST API template
@template componentUI component template
@template testTest file template
@template configConfiguration template
FeatureDescription
Auto-saveAutomatic file saving
Format on saveAuto-format code
Lint on saveAuto-lint code
AI suggestionsProactive suggestions
FeatureDescription
Live ShareReal-time collaboration
AI Pair ProgrammingAI as coding partner
Code ReviewsAI-assisted reviews
Team SettingsShared AI configurations
ShortcutDescription
Ctrl+Shift+P then “Live Share”`Start collaboration session
Ctrl+Shift+P then “Share”`Share workspace
SettingDescription
cursor.ai.cacheSizeAI response cache size
cursor.ai.requestTimeoutRequest timeout
cursor.ai.batchSizeBatch request size
cursor.ai.throttleRequest throttling
IssueSolution
AI not respondingCheck internet connection
Slow responsesReduce context size
Wrong suggestionsProvide more context
Model errorsSwitch AI model
Extension conflictsDisable conflicting extensions
CommandDescription
Ctrl+Shift+P then “Developer: Reload Window”`Reload Cursor
Ctrl+Shift+P then “Developer: Toggle Developer Tools”`Open dev tools
Help > Show All CommandsShow all available commands
{
  "cursor.ai.customModels": [
    {
      "name": "Local Model",
      "endpoint": "http://localhost:8000",
      "apiKey": "your-api-key"
    }
  ]
}
{
  "cursor.ai.webhooks": {
    "onCodeGeneration": "https://your-webhook.com/code",
    "onError": "https://your-webhook.com/error"
  }
}
ShortcutAction
Ctrl+KAI command
Ctrl+LAI chat
Ctrl+IInline edit
TabAccept suggestion
EscapeReject suggestion
Ctrl+/Toggle comment
Ctrl+SSave file
Ctrl+ZUndo
Ctrl+YRedo
ShortcutAction
Ctrl+PQuick open
Ctrl+GGo to line
Ctrl+FFind
Ctrl+HReplace
F12Go to definition
Alt+F12Peek definition
  • Be specific and clear in requests
  • Provide context for better results
  • Use examples when possible
  • Break complex tasks into smaller parts
  • Iterate and refine prompts
  • Review AI-generated code carefully
  • Add proper error handling
  • Include comprehensive tests
  • Follow coding standards
  • Document complex logic
  • Use appropriate AI models for tasks
  • Optimize context size
  • Cache frequently used responses
  • Monitor API usage
  • Configure timeouts appropriately
  • Review AI suggestions for security issues
  • Don’t include sensitive data in prompts
  • Use secure API endpoints
  • Implement proper access controls
  • Regular security audits
# GitHub Actions with Cursor
name: AI Code Review
on: [pull_request]
jobs:
  ai-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: AI Code Review
        run: cursor-cli review --pr ${{ github.event.number }}
#!/bin/bash
# Cursor automation script
cursor --ai-command "review and optimize" src/
cursor --ai-command "generate tests" src/
cursor --ai-command "update documentation" docs/
  • React component generation
  • API endpoint creation
  • Database schema design
  • Frontend optimization
  • Testing automation
  • Data analysis scripts
  • Machine learning models
  • Visualization code
  • Data cleaning pipelines
  • Statistical analysis
  • Infrastructure as code
  • CI/CD pipeline configuration
  • Monitoring setup
  • Deployment scripts
  • Security configurations