ShellGPT is a command-line tool that allows you to interact seamlessly with OpenAI's GPT models directly from your shell. With this tool, you can send prompts, retrieve AI-powered completions, and manage configurations—all without leaving your terminal.
- Effortless AI interaction: Query OpenAI's GPT models directly from your shell.
- Configurable settings: Save and manage your OpenAI API key and default model for a streamlined experience.
- Simple installation: Install and manage the tool via Homebrew for macOS.
- Extensible: Built with Python, easily customizable for advanced users.
First, ensure you have Homebrew installed on your macOS.
To install ShellGPT using Homebrew, add the custom tap:
brew tap adborroto/shellgpt
brew install shellgpt
Before using ShellGPT, you must configure it with your OpenAI API key:
Initialize Configuration
shellgpt init -key YOUR_API_KEY -model gpt-3.5-turbo
Replace YOUR_API_KEY with your actual OpenAI API key. The default model is set to gpt-4o-mini. You can specify other models, such as gpt-4, during initialization.
To interact with OpenAI's GPT models, use:
shellgpt p "What is the capital of France?"
You can verify the configured default model:
shellgpt model
Pipe input from another command into shellgpt
:
cat book.txt | shellgpt p "Make a summary"
Create and reuse predefined prompts:
Create a template:
shellgpt templates --new "summary" --prompt "Summarize the text"
Use the template
cat book.txt | shellgpt p -t summary
Engage in an interactive session with GPT:
shellgpt chat
cat book.txt | shellgpt chat --model gpt-3.5-turbo
This project is licensed under the MIT License. Feel free to use and adapt it as needed.
If you encounter any issues or have questions, feel free to open an issue in this repository.
git tag -a vx.x.x -m "Release vx.x.x"
git archive --format=tar.gz --output=shellgpt-vx.x.x.tar.gz vx.x.x
shasum -a 256 shellgpt-vx.x.x.tar.gz
git push origin --tags
Modify shellgpt.rb
with the SHA version