Let ChatGPT Run Terminal Commands Safely (Guide)
Let ChatGPT run terminal commands on your own Windows, Mac or Linux computer or server. No open ports. Read-only mode, allowed folders, blocked commands and an action log.
Usually ChatGPT writes a command, you copy it into your terminal, run it and paste the output back. Then you do it again, and again.
There is a faster way. With a remote MCP connector, ChatGPT runs the command on your machine itself, reads the output and carries on. Shellway is one such connector. It works on your own Windows, Mac or Linux computer or server, with ChatGPT, Claude and Claude Code. Because you are handing an AI a terminal, this guide starts with the limits you can set.
How it works
- A small Shellway app runs on your computer. It makes an outgoing connection to Shellway, so you do not open any ports.
- ChatGPT connects to Shellway as a connector (“Shellway: Computer & Terminal” in the ChatGPT directory).
- When you ask for something, ChatGPT calls a Shellway tool: run a command, read or write a file, list processes or search. The result comes back into the chat.
Step 1: install and pair
- Sign in on your Shellway dashboard.
- Copy the one-line setup command and run it once: PowerShell on Windows, Terminal on Mac or Linux. It brings its own Node, so there is nothing else to install.
- The computer appears in your dashboard with its name.
Step 2: set your limits before you connect ChatGPT
These rules are set on the computer itself, so the AI cannot change them.
| Limit | What it does |
|---|---|
Read-only mode (npx shellway start --readonly) | ChatGPT can read and search, but tools that write files or run programs are switched off. |
| Allowed folders | File tools work only inside the folders you list. |
| Blocked commands | Delete/format commands, or any word you add, are refused and never run. |
| File tools only | No commands at all; files can still be read and edited in allowed folders. |
| Action log | Every action in your dashboard, with time, tool and result. |
The exact one-line command for each rule is in safety rules for AI on your computer. No setup is risk-free. The aim is that ChatGPT can only do what you decided it may do, and that you can see everything it did.
Step 3: connect ChatGPT
In ChatGPT, find Shellway: Computer & Terminal in the apps directory, choose Connect and sign in. Full steps: connect Shellway to ChatGPT. Using Claude Code instead? Run claude mcp add --transport http shellway https://mcp.getshellway.com/mcp.
Step 4: start with safe requests
- "What OS and version is this machine? How much disk space is free?"
- "List the processes using the most memory."
- "In ~/code/my-app, show me the last 10 git commits."
- "Search the logs folder for ERROR from today and summarise it."
When you trust the setup, restart the app without --readonly and try a change: "Install the dependencies in ~/code/my-app, run the tests and show me any failures."
Good habits
- Ask ChatGPT to show the command first and wait for your OK before it runs anything that changes files.
- Keep production servers in read-only mode unless you are watching.
- Commit code to git before asking for big changes, so you can undo them.
- Check the action log when something looks wrong.
Windows users: see ChatGPT and PowerShell. Servers: see manage your VPS from ChatGPT.
Pricing
7-day free Pro trial, no card. After that you can stay on the free plan: 50 actions a day on 1 computer. Starter is $5/month (₹499 in India) for unlimited actions on 1 computer. Pro is $19/month (₹1,599) for up to 3 computers, and Pro Max is $49/month (₹4,199) for up to 10. See pricing.
Common questions
Can ChatGPT really run commands on my computer?
Yes, with a connector like Shellway. ChatGPT calls a Shellway tool, Shellway runs the command on your computer and returns the output to the chat.
Do I need to open a port or set up SSH?
No. The Shellway app on your computer connects out to Shellway, so nothing is opened on your side.
Does it work with PowerShell and Claude Code?
Yes. Shellway works on Windows, Mac and Linux, and with ChatGPT, Claude, Claude Code and other MCP apps.
What happens after the free trial?
You move to the free plan (50 actions a day on 1 computer) unless you choose a paid plan. The trial needs no card.