
ShellGPT
ChatGPT in your terminal — generate shell commands, code, and docs without leaving the CLI.
About
ShellGPT (github.com/TheR1D/shell_gpt, MIT licensed, 12,000+ stars) is a Python command-line productivity tool powered by large language models. Installed via pip install shell-gpt, it generates shell commands from natural language, writes code snippets, produces documentation, and offers chat mode, an interactive REPL, function calling, reusable roles, and a request cache — across Linux, macOS, Windows, and all major shells (Bash, Zsh, PowerShell, CMD). By default it uses OpenAI's API (key required, usage-billed); it can also point at local models via Ollama.
The honest picture: it is one of the most-starred terminal AI tools for good reason — simple, scriptable, and genuinely useful for 'what was that ffmpeg incantation' moments. But OpenAI API costs apply per call, and the project's own docs warn it is not optimized for local models, so the free Ollama path may underwhelm. Newer agentic CLIs (Gemini CLI, Qwen Code) do more, but ShellGPT remains the lightweight single-purpose choice.
What it can do
- Natural-language to shell command generation
- Code snippet and documentation generation
- Chat mode, REPL mode, and shell integration
- Roles, function calling, and request caching
- Works with OpenAI API or local Ollama models
Setup
Run pip install shell-gpt. On first use you will be prompted for an OpenAI API key (stored in ~/.config/shell_gpt/.sgptrc). For local models, follow the Ollama setup guide in the project wiki.
Prerequisites
Python 3 with pip; an OpenAI API key (paid usage) or a local Ollama backend.
Use cases
Works with
Trust score — 7/10
Scored 7/10 (metrics tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 58; Trending score 72/100 from researcher assessment.
★ 12,292 GitHub stars
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.