Favicon of ShellGPT

ShellGPT

An open-source AI terminal assistant for Linux, macOS and Windows that uses OpenAI's API or local models through Ollama.

ShellGPT is an AI terminal assistant for developers and people who work with shell commands. It runs on Linux, macOS and Windows, turning plain-language requests into commands suited to your operating system and shell. You can review, explain or execute its suggestions, and its Bash and Zsh integrations put generated commands into the terminal input line for editing.

The app runs locally. By default, it sends requests to OpenAI's API, which requires an internet connection and an API key. It can also use local LLM models through Ollama, though it isn't optimized for local models and results may vary. ShellGPT is open source under the MIT license. It also supports Azure integration and can run in Docker.

Beyond command generation, it can write code and documentation, summarize documents, and analyze logs for errors and possible fixes. It accepts text piped from other terminal tools, so a Git diff can become a draft commit message or a log excerpt can become the basis for troubleshooting. Code-only output fits workflows that need generated code without accompanying prose.

Saved conversations retain context for follow-up requests, including revisions to code and commands. Interactive chat uses the same conversation history, which stays in a local cache. Repeated identical requests can reuse locally cached responses. Custom roles tailor its responses to particular tasks, while OpenAI function calling lets the model invoke user-defined Python functions and shell commands on your machine.

Similar to ShellGPT