You need to have the var OPENAI_KEY
exported from your environment. I recommend exporting it on .zshrc
for zsh shells (or .bashrc for bash). Or you can also create a local .env at the root of the project.
Create a .env file containing your key at the root of the project
echo "export OPENAI_KEY=<your key>" > .env
gpt-cli [OPTIONS] <PROMPT>
Arguments:
<PROMPT> Your prompt
Options:
-t, --tokens The max number of tokens generated per message
-m, --model The model to be used [default: text-davinci-003]
-h, --help Print help
-V, --version Print version
Example
gpt-cli "syncronize two folders" -t 100
The binary name is called gpt
. In the future, the binaries will be added to the Arch Linux package manager, pacman. For now, you can download the compiled binaries on the releases page, or build it from source.
gpt-cli is written in Rust, so you'll need to have a Rust installation in order to compile it.
To build gpt-cli:
$ git clone git@github.com:gabrieldemian/gpt-cli.git
$ cd gpt-cli
$ cargo build --release
$ ./target/release/gpt --help
Copy the binary to a PATH folder:
$ sudo cp ./target/release/gpt /usr/bin/gpt