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.
Install the CLI commands through the Command Palette:
Install 'cursor' to shell
Install 'code' to shell
After installation, use either command to open files or folders in Cursor:
Both commands support these options:
cursor file.js
cursor ./my-project
cursor file1.js file2.js folder1/
cursor -n
or cursor --new-window
cursor -w
or cursor --wait
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?
No, install either or both based on preference.
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
).