openai-client-cli

Crates.ioopenai-client-cli
lib.rsopenai-client-cli
version0.1.1
sourcesrc
created_at2023-11-14 00:19:26.080285
updated_at2023-11-18 15:52:18.695295
descriptionOpenAI API client CLI
homepage
repositoryhttps://github.com/AsherJingkongChen/openai-client-cli.git
max_upload_size
id1034183
size409,965
ChenYiran (AsherJingkongChen)

documentation

https://docs.rs/openai-client-cli

README

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
Commit count: 22

cargo fmt