https://github.com/mcdallas/gptask
Command line client for ChatGPT
https://github.com/mcdallas/gptask
chatgpt cli gpt-3 rust rust-lang
Last synced: 9 months ago
JSON representation
Command line client for ChatGPT
- Host: GitHub
- URL: https://github.com/mcdallas/gptask
- Owner: mcdallas
- Created: 2023-03-04T00:25:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T22:59:45.000Z (over 3 years ago)
- Last Synced: 2025-01-31T03:33:58.419Z (over 1 year ago)
- Topics: chatgpt, cli, gpt-3, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 30.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gptask
a CLI tool to interact with chatGPT
## Installation
``` bash
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`.
``` bash
>>> 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:
``` bash
ask() { gptask "$@" | mdcat }
```
