Command reference Β· Cursor CLI
/shell
Switches to Shell mode to run short commands directly without leaving the conversation.
/shell puts the Cursor CLI into shell mode, where short commands can be run directly without leaving the running conversation. According to the shipped code, /sh and /run trigger the same command. Alternatively, a single command can also be passed inline, for example /shell git status, or the mode can be activated with ! at the start of an empty input line.
Commands in shell mode run under the normal session policy: depending on the active permission level (allowlist, run everything, auto-review, or sandbox mode), Cursor either asks before potentially risky commands or executes them automatically - the mode doesn't come with fixed, explicit path or network boundaries for that. It's suited above all for quickly checking something in the terminal in passing, such as git status or a directory, without having to awkwardly wrap the result into a prompt for the agent first.
π THE SAME TASK (βRUN SHELL COMMAND DIRECTLYβ) ON OTHER PLATFORMS
- Aider: /run
- Antigravity CLI: !<shell-command>
β WHEN TO USE IT?
Quickly check git status without leaving the chat context
/shell git status
Briefly inspect a file before the agent continues working
/sh ls -la src/
β WHEN NOT TO?
The command should be part of a multi-step task planned by the agent
/shell runs the command in isolation, without integrating it into the agent's task planning.
Better: Phrase the command as a normal prompt instead, so the agent runs it in context
Persistent network/write access with clear boundaries is needed
/shell follows the normal session policy but doesn't offer explicit path or network limits.
Better: Use agent sandbox run with --allow-paths and --network
SOURCES
- Cursor Docs β Slash Commands β cursor.com
MORE COMMANDS Β· Cursor CLI