https://github.com/dcai/grumpy
https://github.com/dcai/grumpy
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dcai/grumpy
- Owner: dcai
- Created: 2023-11-22T00:48:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T09:24:01.000Z (over 2 years ago)
- Last Synced: 2024-04-15T01:57:34.502Z (about 2 years ago)
- Language: JavaScript
- Size: 161 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### grumpy
Openai client I use on cli.
#### Install
```
npm install grumpy-ai
```
This installs a executable called `ai`, and requires `OPENAI_API_KEY` in your shell environment, then you can do things like this:
- `ai as`: list predefined prompts, to edit the library, edit `$HOME/ai.json`.
- `ai as dict`: Assume you have `dict` prompt in ai.json, this will use `dict` prompt to answer your questions.
- `ai ask`: ask openai in an interactive way.
- `cat question.md | ai frompipe | bat -l markdown`: read question from a markdown file and render answer with [bat](https://github.com/sharkdp/bat)
- `cat question.md | ai frompipe | pbcopy`: read question from markdown and copy the answer to clipboard, I find difficult to copy long answer in chatgpt web or other GUI, this makes it easier.