shell_gpt

A command-line productivity tool powered by AI large language models like GPT-5, will help you accomplish your tasks faster and more efficiently.

What is shell_gpt?

A command-line productivity tool powered by AI large language models like GPT-5, will help you accomplish your tasks faster and more efficiently.

Overview of shell_gpt

What it is

ShellGPT is a command-line productivity tool powered by AI large language models (LLM). It generates shell commands, code snippets, and documentation directly in the terminal, eliminating the need for external resources like Google search. The tool supports Linux, macOS, and Windows, and is compatible with all major shells including PowerShell, CMD, Bash, and Zsh.

Key features

  • Generates shell commands, code snippets, and documentation from natural language prompts
  • Accepts input from both stdin and command-line arguments, including pipes and redirection
  • Provides shell integration with hotkey support (Ctrl+l by default) for Bash and Zsh
  • Offers a chat mode for preserving and recalling conversational context across prompts
  • Includes options for pure code output (--code) and shell command generation (--shell)
  • Supports non-interactive mode (--no-interaction) for piping generated commands to other tools

Use cases

  • Quickly generate shell commands for system administration tasks, such as updating the system or managing Docker containers
  • Analyze logs, identify errors, and get suggestions for possible solutions by piping log output
  • Generate code snippets (e.g., Python) and redirect them to files for reuse
  • Create git commit messages based on diffs
  • Use chat sessions to iteratively refine prompts and build upon previous responses

Getting started

pip install shell-gpt

By default, ShellGPT uses OpenAI's API and GPT-4 model. You will need an API key, which you can generate from OpenAI. You will be prompted for your key, which will then be stored in ~/.config/shell_gpt/.sgptrc. OpenAI API is not free of charge; refer to OpenAI pricing for more information. Alternatively, you can run open-source models locally (e.g., with Ollama), but ShellGPT is not optimized for local models and may not work as expected.

License and pricing

ShellGPT is open source under the MIT license. The tool itself is free to use, but using the default OpenAI API backend may incur costs based on OpenAI's pricing. If you use a local model, there are no API costs.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/ther1dshell-gpt.svg)](https://yunodb.com/tools/ther1dshell-gpt?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/ther1dshell-gpt?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/ther1dshell-gpt.svg" alt="Featured on YunoDB" height="20"></a>