Skip to content

Complete Guide: Adding Cursor to PATH on Mac, Windows & Linux

Complete Guide: Adding Cursor to PATH on Mac, Windows & Linux

This guide covers how to add the Cursor AI code editor to your system PATH, enabling you to launch Cursor from the terminal using the cursor command across different operating systems and shell configurations.

Table of Contents

  1. Quick Setup (Recommended)

  2. macOS Setup

  3. Windows Setup

  4. Linux Setup

  5. Shell-Specific Configuration

  6. Troubleshooting

The easiest method for all platforms:

  1. Open Cursor

  2. Access Command Palette: Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)

  3. Type: Install 'cursor' command in PATH

  4. Select the option and follow the prompts

This method automatically handles the PATH setup for your system and is the most reliable approach.

macOS Setup

Use the Command Palette method described above: open Cursor, press Cmd+Shift+P, and run “Install ‘cursor’ command in PATH”.

Method 2: Manual Setup

After installing Cursor via the .dmg file:

For Bash (~/.bash_profile or ~/.bashrc):

# Add Cursor to PATH
export PATH="/Applications/Cursor.app/Contents/Resources/app/bin:$PATH"

For Zsh (~/.zshrc):

# Add Cursor to PATH
export PATH="/Applications/Cursor.app/Contents/Resources/app/bin:$PATH"

For Fish (~/.config/fish/config.fish):

# Add Cursor to PATH
set -gx PATH /Applications/Cursor.app/Contents/Resources/app/bin $PATH

Method 3: Using fish_add_path (Fish Shell)

fish_add_path /Applications/Cursor.app/Contents/Resources/app/bin

Windows Setup

Use the Command Palette method: open Cursor, press Ctrl+Shift+P, and run “Install ‘cursor’ command in PATH”.

Method 2: During Installation

During the Cursor installation process, you can choose to “add Cursor to your system path for easier command-line access”.

Method 3: Manual Setup

Using PowerShell:

# Add to user PATH
$env:PATH += ";C:\Users\$env:USERNAME\AppData\Local\Programs\Cursor\resources\app\bin"

# To make permanent, add to PowerShell profile
echo '$env:PATH += ";C:\Users\$env:USERNAME\AppData\Local\Programs\Cursor\resources\app\bin"' >> $PROFILE

Using Command Prompt:

# Add to system PATH (requires admin)
setx PATH "%PATH%;C:\Users\%USERNAME%\AppData\Local\Programs\Cursor\resources\app\bin" /M

Via System Properties (GUI):

  1. Right-click “This PC” → Properties

  2. Advanced system settings → Environment Variables

  3. Under “User variables” or “System variables”, find PATH

  4. Add: C:\Users\[YourUsername]\AppData\Local\Programs\Cursor\resources\app\bin

Linux Setup

Use the Command Palette method: open Cursor, press Ctrl+Shift+P, and run “Install ‘cursor’ command in PATH”.

Method 2: AppImage Installation

For Linux, Cursor is distributed as an AppImage file. After downloading, make it executable and optionally move it to a standard location:

# Make executable
chmod +x ~/Downloads/Cursor-*.AppImage

# Move to system location (optional)
sudo mv ~/Downloads/Cursor-*.AppImage /opt/cursor.appimage
sudo chmod +x /opt/cursor.appimage

Method 3: Manual PATH Setup

For Bash (~/.bashrc):

# If using AppImage in /opt
export PATH="/opt:$PATH"
alias cursor='/opt/cursor.appimage'

# Or create a symlink
sudo ln -s /opt/cursor.appimage /usr/local/bin/cursor

For Zsh (~/.zshrc):

# Add Cursor to PATH
export PATH="/opt:$PATH"
alias cursor='/opt/cursor.appimage'

For Fish (~/.config/fish/config.fish):

# Add Cursor to PATH
set -gx PATH /opt $PATH
alias cursor='/opt/cursor.appimage'

Creating a Desktop Entry (Linux)

Create a desktop entry for easier access:

cat > ~/.local/share/applications/cursor.desktop << EOF
[Desktop Entry]
Name=Cursor
Exec=/opt/cursor.appimage --no-sandbox
Icon=/opt/cursor.png
Type=Application
Categories=Development;
EOF

Shell-Specific Configuration

Bash Configuration

Add to ~/.bashrc (Linux) or ~/.bash_profile (macOS):

# Cursor PATH configuration
export PATH="[CURSOR_PATH]:$PATH"

# Optional: Create alias
alias c='cursor'

Zsh Configuration

Add to ~/.zshrc:

# Cursor PATH configuration
export PATH="[CURSOR_PATH]:$PATH"

# Optional: Create alias for quick access
alias c='cursor'

# If using Oh My Zsh, ensure PATH is set before plugins

Fish Configuration

Add to ~/.config/fish/config.fish:

# Cursor PATH configuration (method 1)
set -gx PATH [CURSOR_PATH] $PATH

# Or use fish_add_path (method 2 - preferred)
fish_add_path [CURSOR_PATH]

# Optional: Create alias
alias c='cursor'

Fish-specific notes:

  • Fish treats PATH as a list, not a colon-delimited string

  • Use fish_add_path for permanent PATH modifications

  • The fish_user_paths universal variable is automatically prepended to PATH

PowerShell Configuration

Add to your PowerShell profile ($PROFILE):

# Cursor PATH configuration
$env:PATH += ";[CURSOR_PATH]"

# Optional: Create alias
Set-Alias c cursor

Troubleshooting

Common Issues and Solutions

1. Command Not Found After Setup

# Reload your shell configuration
source ~/.bashrc  # Bash
source ~/.zshrc   # Zsh
source ~/.config/fish/config.fish  # Fish

# Or restart your terminal

2. Permission Denied (macOS) If macOS shows a security warning, go to System Settings → Privacy & Security and click “Open Anyway”.

3. PATH Not Persisting

  • Ensure you’re editing the correct configuration file for your shell

  • Check that the file is being sourced on shell startup

  • Verify the Cursor installation path is correct

4. Multiple Shell Configurations If you switch between shells, you may need to configure each one separately:

# Check your current shell
echo $SHELL

# List available shells
cat /etc/shells

5. Fish Shell Specific Issues If you’re experiencing PATH issues with Fish in Cursor’s terminal, ensure your ~/.config/fish/config.fish is properly configured:

# Use absolute paths
set -gx PATH /full/path/to/cursor/bin $PATH

Verification

Test your setup:

# Check if cursor command is available
which cursor

# Check PATH contains cursor
echo $PATH | grep cursor

# Test launching cursor
cursor --help
cursor .  # Open current directory

Advanced Usage

Open specific files/directories:

cursor .                    # Open current directory
cursor /path/to/project     # Open specific directory
cursor file.js              # Open specific file
cursor -r .                 # Reuse existing window

Terminal shortcuts:

  • Use Ctrl+K in the terminal to write terminal commands in plain English, and Cursor will convert them

Platform-Specific Paths Reference

macOS:

  • Application: /Applications/Cursor.app/Contents/Resources/app/bin

  • Shell configs: ~/.zshrc, ~/.bash_profile, ~/.config/fish/config.fish

Windows:

  • Installation: C:\Users\[Username]\AppData\Local\Programs\Cursor\resources\app\bin

  • PowerShell profile: $PROFILE

Linux:

  • AppImage location: /opt/cursor.appimage or ~/Applications/

  • Shell configs: ~/.bashrc, ~/.zshrc, ~/.config/fish/config.fish

Remember to replace [CURSOR_PATH] with the actual path for your platform and installation method!

Follow

Enjoyed this post?

Follow along for more articles about language, AI, and tech experiments.