149 words
1 minutes
How to Run Shell Commands Directly Inside GitHub Copilot CLI【!】

Overview#

When you’re in the middle of a Copilot CLI session and think “I just want to check git status real quick” — do you actually quit the CLI and open another terminal?

You don’t have to. Just prefix any command with ! and it runs directly in your local shell.


Usage#

Add ! before the command you want to run:

/copilot> !git status
/copilot> !ls -la
/copilot> !npm test

The command bypasses Copilot entirely and runs on your local shell.


When to Use It#

ScenarioExample
Check Git status!git status
List files!ls / !dir
Run tests!npm test
Build the project!npm run build
Check environment!echo $PATH

How It Differs from a Regular Prompt#

MethodWhat happens
Regular promptCopilot interprets and executes (approval required)
! prefixRuns directly in your shell, bypassing Copilot

Perfect for “I don’t need AI for this, I just need to check something real quick.” Also doesn’t consume any premium requests.


How to Run Shell Commands Directly Inside GitHub Copilot CLI【!】
https://naonao-na.com/en/posts/github-copilot-cli-shell-execute/
Author
[object Object]
Published at
2026-03-28