This project is not affiliated with OpenAI.
This command-line tool provides a simple interface for interacting with the following OpenAI models:
- GPT-3.5 Turbo
- GPT-4
- GPT-4 Vision
- DALL-E 3
- Rust: You can install Rust by following the instructions on the official website: https://www.rust-lang.org/learn/get-started
- Get an OpenAI API key from https://openai.com/api/.
- Add the API key to your shell environment by appending this line to
~/.bashrc:export OPENAI_API_KEY=your-api-key(or~/.zshrcif using zsh) - Apply the changes by restarting your shell or sourcing your profile:
source ~/.bashrc(or~/.zshrcif using zsh)
- Clone the GPTCLI repository:
git clone https://github.com/aumbriac/GPTCLI - Go to the directory:
cd GPTCLI - Test the CLI using Cargo:
cargo run What is the meaning of life?orcargo run <image_path> [optional_prompt] - Build the CLI:
cargo build --release - Add the built executable to your PATH:
- Windows: Copy it to a directory in your
Path, likeC:\Windows\System32 - Mac/Linux: Copy it to
/usr/local/bin/using:sudo cp target/release/gpt /usr/local/bin/
- Windows: Copy it to a directory in your
With GPTCLI installed, use it directly in your shell.
- To chat with GPT 3.5 Turbo:
gpt What is the capital of California - To chat with GPT 4:
gpt 4 What is the meaning of life - For image analysis:
gpt v rust_astronaut.png What colors are in this image - To generate an image:
gpt d an astronaut in a rusty spacesuit on mars holding a crab
GPTCLI comes with a suite of automated tests to ensure its functionality.
To run all the tests, use the following command: cargo test
GPT4CLI is under the MIT License. See LICENSE.md for details.