Skip to content

rajeshkanaka/open-with-cursor-mac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸš€ Open with Cursor - macOS Finder Integration

License: MIT macOS Cursor

Cursor Logo

Seamlessly integrate Cursor IDE into your macOS Finder for an enhanced development workflow

Installation β€’ Features β€’ Usage β€’ Troubleshooting


✨ Features

  • πŸ–±οΈ Right-click integration in Finder context menu
  • πŸ“ Open files and folders directly in Cursor
  • πŸͺ„ Background area support for quick access
  • ⚑ Lightning-fast workflow enhancement
  • πŸ”’ Secure local implementation

πŸ“‹ Prerequisites

  • macOS 10.15 or later
  • Cursor IDE installed in your Applications folder
  • Administrative access for setup

πŸš€ Installation

Step 1: Create Automator Quick Action

  1. Launch Automator from your Applications

  2. Create a New Document β†’ Select Quick Action

  3. Configure workflow settings:

    Workflow receives current: files or folders
    Application: Finder
    
  4. Add Run Shell Script action with settings:

    • Shell: /bin/bash
    • Pass input: as arguments
  5. Insert the following script:

#!/bin/bash

cursorExePath="$HOME/Applications/Cursor.app/Contents/MacOS/Cursor"

if [ -f "$cursorExePath" ]; then
  open -a "$cursorExePath" "$@"
else
  osascript -e 'display notification "Cursor executable not found" with title "Error"'
fi

Step 2: Configure AppleScript Integration

Click to expand AppleScript configuration
  1. Open Script Editor from Applications
  2. Create new script with:
set cursorExePath to (POSIX path of (path to home folder)) & "Applications/Cursor.app/Contents/MacOS/Cursor"

if (do shell script "test -f " & quoted form of cursorExePath) is "0" then
  do shell script quoted form of cursorExePath
else
  display notification "Cursor executable not found" with title "Error"
end if
  1. Save as application named Open with Cursor in Applications

Step 3: Service Configuration

Click to expand service setup
  1. Create com.cursor.openwithcursor.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.cursor.openwithcursor</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/open</string>
        <string>-a</string>
        <string>Open with Cursor</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
  1. Save to ~/Library/LaunchAgents/

Step 4: Activate the Service

launchctl load ~/Library/LaunchAgents/com.cursor.openwithcursor.plist

🎯 Usage

  1. Files/Folders: Right-click β†’ Services β†’ Open with Cursor
  2. Finder Background: Right-click empty area β†’ Open with Cursor

πŸ”§ Troubleshooting

Common Issues & Solutions

Service Not Appearing

  • Verify Cursor.app is in Applications folder
  • Restart Finder: killall Finder
  • Reload launch agent:
    launchctl unload ~/Library/LaunchAgents/com.cursor.openwithcursor.plist
    launchctl load ~/Library/LaunchAgents/com.cursor.openwithcursor.plist

Permission Issues

  • Check System Preferences β†’ Security & Privacy β†’ Privacy β†’ Automation
  • Ensure Automator and Script Editor have necessary permissions

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❀️ by the rajeshkanaka

⬆ back to top

About

macOS Finder Integration for Cursor IDE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published