HeyGPT
This is a simple command-line interface tool that allows you to interact with ChatGPT from OpenAI or Azure.
You can use it to:
- Chat with ChatGPT and get responses
- Quick chat with ChatGPT and get responses
- Pipe text from another command into HeyGpt and get responses
Requirements
Currently, to use HeyGpt you need an API key from OpenAI or Azure. You can sign up for that on their website.
Installation
Debian / Ubuntu / macOS
$ curl https://raw.githubusercontent.com/p208p2002/heygpt/main/setup.sh | bash
Usage
Please note that you will be prompted to enter your OpenAI or Azure API key during initialization, so make sure you have that ready.
You can also modify your configuration file located at .heygpt-config
in your home directory.
- To initialize your HeyGpt configuration with OpenAI, use the
init
command:
$ heygpt init
- To initialize your HeyGpt configuration with Azure, use the
init-azure
command:
$ heygpt init-azure
- To chat with ChatGPT, simply exec
heygpt
then type your message and press Enter.
$ heygpt
- To quick chat with HeyGpt, use the quick chat command
$ heygpt "how to find my ip address" # The response will vary based on your system.
- To pipe text from another command, use the pipe
|
character followed byheygpt
, like so:
$ vim --help | heygpt "translate to traditional chinese" # cli-tool help message translate
$ cat main.py | heygpt "wirte README.md for this script" >> README.md # generate document for some script
Build From Source
Installing Rust is necessary. If you don't have Rust installed, you can install it using the command below:
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Clone this repo
-
Go into
heygpt
then run commandcargo build --release
For Ubuntu also install:
build-essential
,pkg-config
,openssl
,libssl-dev
,curl
,git
-
Copy
target/release/heygpt
to yourPATH