Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPTCLI - Rust CLI for GPT API

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

Prerequisites

Obtain an OpenAI API Key

  1. Get an OpenAI API key from https://openai.com/api/.
  2. Add the API key to your shell environment by appending this line to ~/.bashrc: export OPENAI_API_KEY=your-api-key (or ~/.zshrc if using zsh)
  3. Apply the changes by restarting your shell or sourcing your profile: source ~/.bashrc (or ~/.zshrc if using zsh)

Installation Steps

  1. Clone the GPTCLI repository: git clone https://github.com/aumbriac/GPTCLI
  2. Go to the directory: cd GPTCLI
  3. Test the CLI using Cargo: cargo run What is the meaning of life? or cargo run <image_path> [optional_prompt]
  4. Build the CLI: cargo build --release
  5. Add the built executable to your PATH:
    • Windows: Copy it to a directory in your Path, like C:\Windows\System32
    • Mac/Linux: Copy it to /usr/local/bin/ using: sudo cp target/release/gpt /usr/local/bin/

Using GPTCLI

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

Testing

GPTCLI comes with a suite of automated tests to ensure its functionality.

Running Tests

To run all the tests, use the following command: cargo test

Licensing

GPT4CLI is under the MIT License. See LICENSE.md for details.

About

Rust-powered CLI for interacting with OpenAI models

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages