What do you want to do?
3 use cases
-
Turn plain English into shell commands you can run
Ask sgpt --shell for a command, then execute, describe or abort it with one key.
View prompt
Install TheR1D/shell_gpt, set up the shell integration for my <bash or zsh>, and show me three examples of sgpt --shell for tasks I do often: <tasks>. Always choose Describe before Execute.
-
Pipe logs and diffs into an LLM for quick answers
Send docker logs or a git diff to sgpt with a prompt to find errors or write a commit message.
View prompt
Using TheR1D/shell_gpt, pipe the last 50 lines of <service> logs into sgpt and ask it to find errors and suggest fixes. Then pipe my staged git diff into sgpt for a commit message and show me both before doing anything.
-
Build and refine code in a named terminal chat session
Use sgpt --chat with --code to generate a snippet and keep improving it across follow-up prompts.
View prompt
Using TheR1D/shell_gpt, start a chat session named <name> with --code to write a Python script that <task>, refine it with two follow-ups about <changes>, and save the final code to <file>. Run it once to check it works.
Quick start with Shell GPT
- Check you have what it needs: Python and pip; An OpenAI API key, stored in ~/.config/shell_gpt/.sgptrc on first run, or a local backend such as Ollama; Linux, macOS or Windows with Bash, Zsh, PowerShell or CMD.
- Open TheR1D/shell_gpt on GitHub and read the README and license.
- Run
pip install shell-gptand enter your OpenAI API key when prompted - Ask for a command:
sgpt --shell "find all json files in current folder" - Choose [E]xecute, [D]escribe or [A]bort; use Describe when you are not sure what it does
- Install the hotkey with
sgpt --install-integrationand restart your terminal, then press Ctrl+l to turn your input line into a command
These steps come from our top use case, Turn plain English into shell commands you can run, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for TheR1D/shell_gpt
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forDevelopers and sysadmins who live in the terminal and keep looking up command syntax.
- Why it is hot12k stars, talked about in 2 AI sources we track
- LanguagePython
- Sourcegithub.com/TheR1D/shell_gpt ยท Back to Hot repos
Requirements
- Python and pip
- An OpenAI API key, stored in ~/.config/shell_gpt/.sgptrc on first run, or a local backend such as Ollama
- Linux, macOS or Windows with Bash, Zsh, PowerShell or CMD
Add this badge to your README
Maintain Shell GPT? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/ther1d-shell-gpt/?utm_source=github&utm_medium=badge&utm_campaign=TheR1D-shell_gpt)
HTML
<a href="https://dedupedai.com/use-cases/ther1d-shell-gpt/?utm_source=github&utm_medium=badge&utm_campaign=TheR1D-shell_gpt"><img src="https://dedupedai.com/badge/TheR1D/shell_gpt.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Shell GPT
What is Shell GPT?
ShellGPT (sgpt) is a command-line productivity tool that uses large language models to generate shell commands, code snippets and documentation from plain-language prompts. It reads from arguments or stdin, knows your OS and shell, can execute suggested commands after you confirm, keeps chat sessions and a REPL, and adds a Ctrl+l hotkey to Bash and Zsh. It uses OpenAI by default and can be pointed at local models through Ollama. It is an open-source project on GitHub: https://github.com/TheR1D/shell_gpt.
How do I use Shell GPT?
Run pip install shell-gpt and enter your OpenAI API key when prompted; then ask for a command: sgpt --shell "find all json files in current folder"; choose [E]xecute, [D]escribe or [A]bort; use Describe when you are not sure what it does. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Shell GPT for?
Developers and sysadmins who live in the terminal and keep looking up command syntax.
What can I do with Shell GPT?
3 use cases so far, for example: Turn plain English into shell commands you can run; Pipe logs and diffs into an LLM for quick answers; Build and refine code in a named terminal chat session. Each has steps and a copy-paste agent prompt.
What do I need to run Shell GPT?
Python and pip; An OpenAI API key, stored in ~/.config/shell_gpt/.sgptrc on first run, or a local backend such as Ollama; Linux, macOS or Windows with Bash, Zsh, PowerShell or CMD.
What are alternatives to Shell GPT?
Other hot AI repos in Personal productivity: Nanobot, Textgen, Learnharness, Chatbox, Jan.
Is Shell GPT safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.