2 releases

0.1.1 Nov 18, 2023
0.1.0 Nov 14, 2023

#73 in Multimedia

36 downloads per month

MIT license

64KB
886 lines

OpenAI Client CLI

crates.io docs.rs GitHub Actions

Authors: Asher Jingkong Chen
Description: OpenAI API client CLI

Background

I like to use CLI (e.g. cURL) to fetch OpenAI's REST API but ...

Not super easy to use! That's why I made this :)

Installation guides

The following guides will help you install the CLI program.

Install via Cargo (1st option)

Cargo will install and compile the program on your machine.

cargo install openai-client-cli

Install via Homebrew (2nd option)

[WIP]

Install from git and build from source codes (3rd option)

  1. Copy the source code with git and change the working directory
git clone --recurse-submodules https://github.com/AsherJingkongChen/openai-client-cli.git
cd openai-client-cli
  1. Install Rust toolchain manager: rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Install Rust toolchain (at least 1.72.0)
rustup toolchain install 1.72.0
rustup show
  1. Build in release mode
cargo build --release

or:

cargo b -r
  1. Add the directory target/release to environment variable $PATH
export PATH='$PATH:target/release'

To add the executable in your environment permanently, you can add the export command to ~/.profile, ~/.bashrc or ~/.zshrc.

The command runs everytime when a shell session is launched.

Usage

Check the following manual to learn how to work on the CLI.

Manual review: link

The command to show manual:

openai --help

or:

openai -h

Dependencies

~12–28MB
~418K SLoC