Skip to content

adborroto/homebrew-shellgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shellgpt

License: MIT Homebrew

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.


🚀 Features

  • 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.

📦 Installation

First, ensure you have Homebrew installed on your macOS.

Add the Tap

To install ShellGPT using Homebrew, add the custom tap:

brew tap adborroto/shellgpt
brew install shellgpt

🛠️ Configuration

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.

🧑‍💻 Usage

Send a Prompt

To interact with OpenAI's GPT models, use:

shellgpt p "What is the capital of France?"

Check the Default Model

You can verify the configured default model:

shellgpt model

Advanced Example

Pipe input from another command into shellgpt:

cat book.txt | shellgpt p "Make a summary"

Use Templates

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

Chat

Engage in an interactive session with GPT:

shellgpt chat
cat book.txt | shellgpt chat --model gpt-3.5-turbo

📝 License

This project is licensed under the MIT License. Feel free to use and adapt it as needed.

🛡️ Support

If you encounter any issues or have questions, feel free to open an issue in this repository.

Release

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

About

Using OpenAI from your terminal

Resources

License

Stars

Watchers

Forks

Packages

No packages published