pgpt 0.1.0

A CLI to ask ChatGPT anything with pretty markdown rendering (Pretty GPT)
Documentation

Demo

Installation

Cargo

cargo install pgpt
pgpt --help

Source

git clone  <LINK>
cd pgpt
cargo install --path .

Usage

When using for the first time, pgpt will prompt you to enter an OpenAI API key.

The key is saved/encrypted in a local config file to be used later.

Alternatively, you can pass your API key to the environment variable OPENAI_API_KEY in order to not save it.

Question

Ask a question to ChatGPT (defaults to gpt-3.5-turbo)

pgpt <QUERY>...

-m, --model

Select a specific model to use for ChatGPT.

pgpt -m, --model <MODEL> <QUERY>...

Available options for model:

Option ChatGPT Model
gpt-3 gpt-3.5-turbo
gpt-4 gpt-4-turbo
gpt-4o gpt-4o

--cost

Calculate the total cost associated with prompt and response:

pgpt --cost <QUERY>...

ChatGPT API pricing is dependent on the model with different costs for the different models.

Costs are based on "tokens" used for input/output. Each "token" roughly translates to 4 characters of text.

You can see pricing details here

--clear

Clears the local config including the OpenAI API key

pgpt --clear

--help

pgpt --help
Ask ChatGPT anything directly from the terminal with pretty markdown rendering!

Usage: pgpt [OPTIONS] [QUERY]...

Arguments:
  [QUERY]...  The query to ask ChatGPT

Options:
  -m, --model <MODEL>  ['gpt-3'] The model to use (optional) [options = 'gpt-3', 'gpt-4', 'gpt-4o']
      --clear          Clear local config including OpenAI API key
      --cost           Display the total cost for the prompt and response
  -h, --help           Print help
  -V, --version        Print version

License

MIT