Shell Commands
Install and use Cursor shell commands
Cursor provides command-line tools to open files and folders from your terminal. Install both the cursor
and code
commands to integrate Cursor with your development workflow.
Installing CLI commands
Install the CLI commands through the Command Palette:
- Open the Command Palette (Cmd/Ctrl + P)
- Type “Install” to filter installation commands
- Select and run
Install 'cursor' to shell
- Repeat and select
Install 'code' to shell
Using the CLI commands
After installation, use either command to open files or folders in Cursor:
Command options
Both commands support these options:
- Open a file:
cursor file.js
- Open a folder:
cursor ./my-project
- Open multiple items:
cursor file1.js file2.js folder1/
- Open in a new window:
cursor -n
orcursor --new-window
- Wait for the window to close:
cursor -w
orcursor --wait
FAQ
What's the difference between cursor and code commands?
What's the difference between cursor and code commands?
They’re identical. The code
command is provided for VS Code compatibility.
Do I need to install both commands?
Do I need to install both commands?
No, install either or both based on preference.
Where are the commands installed?
Where are the commands installed?
Commands are installed in your system’s default shell configuration file (e.g., .bashrc
, .zshrc
, or .config/fish/config.fish
).