gptask

Crates.iogptask
lib.rsgptask
version0.2.0
sourcesrc
created_at2023-03-04 00:52:56.702472
updated_at2023-03-05 01:41:42.047778
descriptionsimple chatGPT CLI
homepage
repositoryhttps://github.com/mcdallas/gptask
max_upload_size
id800248
size35,235
Mike Dallas (mcdallas)

documentation

README

gptask

a CLI tool to interact with chatGPT

Installation

cargo install gptask
export OPENAI_API_KEY=sk-WEz... # from https://platform.openai.com/account/api-keys

Usage

You will need an OpenAI API key, and to set the environment variable OPENAI_API_KEY.

>>> gptask Who won the world series of poker in 1989?
The winner of the World Series of Poker in 1989 was Phil Hellmuth.

>>> gptask and who did he play against?
In the final heads-up match of the 1989 World Series of Poker Main
Event, Phil Hellmuth played against the legendary poker player
Johnny Chan. The two players battled for several hours before Phil 
Hellmuth was able to defeat Chan to win the championship.

The context of the conversation will be remembered for 15 minutes, so you can continue an existing chat. Set the environment variable GPTASK_TTL_SECONDS to 0 to disable this.

Combine with mdcat to format markdown and code snippets:

ask() { gptask "$@" | mdcat }

image

Commit count: 13

cargo fmt