An Unofficial OpenAI Terminal Client
```bash
gpto -h
A tiny unofficial OpenAI client
Usage: gpto [OPTIONS]
Options:
-p, --prompt [
Learn more about how to use text completion
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ```
Install GTPO
bash
cargo install gtpo
```bash
yay gpto-bin ```
Clone the project
bash
git clone git@github.com:alanvardy/gpto.git
cd gpto
./test.sh # run the tests
cargo build --release
You can then find the binary in /target/release/
Get a completion with default parameters
```bash
gpto --prompt tell me a joke
Q: What did the fish say when it hit the wall? A: Dam! ```
Get completions using text from stdin (without displaying the spinner)
```bash
echo "what is one plus one" | gpto -xp
Two ```
Get a completion with a different model (this example uses the leading code completion model). And yes, the generated code is not idiomatic!
Read more about models here. This CLI app uses the /v1/chat/completions
endpoint.
```bash
gpto -m gpt-4 -p language is elixir\nwrite a function that raises an error if the argument is not an integer and multiplies it by 2 if it is an integer
def multiplybytwo(x) raise ArgumentError, "Argument is not an integer" unless x.is_a? Integer x * 2 end ```
If you are using vim or helix and calling this application from within them the spinners will interfere with the output, You can disable the spinner by setting the environment DISABLE_SPINNER
to any value. i.e. DISABLE_SPINNER=1 gpto -p This is a prompt