ShellGPT
AI in your terminal — ask questions, generate shell commands, run chat sessions.
About
ShellGPT (sgpt) is a command-line tool that puts large language models in your terminal. Ask it anything, have it generate and optionally execute shell commands from natural language, produce code, or run an interactive REPL chat — with stdin piping so you can feed command output straight into a follow-up question. With ~12,300 GitHub stars it is one of the most popular terminal AI utilities.
It is provider-flexible: OpenAI's models out of the box, local models via Ollama, and other backends through configuration, plus chat caching, custom roles, and a functions system for extending what the assistant can do. Installation is a single pip install, and shell integration lets you invoke it with natural language right in your command line.
The caveats are the usual ones for terminal AI: prompts go to whichever provider you configure, so point it at Ollama if your work is sensitive; output quality tracks the model you choose; and generated shell commands should be reviewed before execution — sgpt asks for confirmation, but the habit of reading first is yours to keep. MIT licensed and community-maintained.
What it can do
- Natural-language Q&A, shell command generation, and code output from the terminal
- `--shell` mode generates and (with confirmation) executes commands
- Interactive REPL chat with session caching; stdin piping for follow-up questions
- Multiple backends: OpenAI, Ollama/local models, configurable providers
- Custom roles and LLM functions; shell integration for bash/zsh/fish; MIT licensed
Setup
- Install with
pip install shell-gpt. - Set your OpenAI API key (
sgptprompts on first run) or configure Ollama/another backend. - Run
sgpt "your question"for answers,sgpt --shell "list large files"for commands. - Add shell integration (
sgpt --install-integration) and define custom roles for repeated tasks.
Prerequisites
Python 3.8+ and pip; an OpenAI API key or a local Ollama setup. Shell integration needs bash/zsh/fish.
Use cases
Works with
Trust score — 9/10
Scored 9/10 (metrics tier, metrics-v1). Evidence: 12,291 GitHub stars (TheR1D/shell_gpt); MIT license confirmed via GitHub API; Terminal AI: natural-language Q&A, --shell command generation with confirmation, REPL chat, stdin piping, custom roles, LLM functions; backends: OpenAI, Ollama/local, configurable — verified against README and PyPI; Install via pip; shell integration for bash/zsh/fish — verified. Manual review: prompts go to the configured provider (privacy depends on backend choice — flagged); command execution requires user confirmation, but read-before-run is still the user's habit to keep. License: MIT.
★ 12,291 GitHub stars
How the trust score is built
Full methodology →- Adoption · stars/downloads, log-scaled vs peers
- 8.0/10
- Maintenance · recency, releases, issue load
- 8.0/10
- Openness · license + docs
- 10.0/10
- Manual review · sanity read + red-flag check
- 8.0/10
- · 12,291 GitHub stars (TheR1D/shell_gpt); MIT license confirmed via GitHub API
- · Terminal AI: natural-language Q&A, --shell command generation with confirmation, REPL chat, stdin piping, custom roles, LLM functions; backends: OpenAI, Ollama/local, configurable — verified against README and PyPI
- · Install via pip; shell integration for bash/zsh/fish — verified
- · manual review: prompts go to the configured provider (privacy depends on backend choice — flagged); command execution requires user confirmation, but read-before-run is still the user's habit to keep
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.