heygpt
A simple common-line interface for ChatGPT API.
Install to $HOME/.cargo/bin/
via cargo:
bash
cargo install --path .
You'll need a OpenAI API key (you can get one here), and you'll need to export your API Key as an environment variable:
You can also set a OpenAI API base environment variable, just like openai-python
```bash
export OPENAIAPIKEY=
```
Then you can start an interactive conversation with ChatGPT:
bash
heygpt
OR use the one-shot mode by providing a prompt:
bash
heygpt how to record screen on mac
You can also compose prompt with bash tricks like
bash
heygpt read the code and tell me what it is doing: $(cat src/main.rs)
bash
heygpt read the code diff and write a commit message: $(git diff)
You may need write prompt in multiple lines:
```bash heygpt "please translate this poem to English:
εΊεζζε οΌ ηζ―ε°δΈιγ 举倴ζζζοΌ δ½ε€΄ζζ δΉ‘γ" ```
Enter \?
to see available commands:
user => \?
Available commands:
\?, \help: Show this help
\b, \back: Retract and back to the last user message
\h, \history: View current conversation history