https://github.com/awwaiid/iwt
I Wish To ... a command line magic tool using LLM (via OpenAI API)
https://github.com/awwaiid/iwt
cli gpt llm openai
Last synced: about 1 year ago
JSON representation
I Wish To ... a command line magic tool using LLM (via OpenAI API)
- Host: GitHub
- URL: https://github.com/awwaiid/iwt
- Owner: awwaiid
- License: mit
- Created: 2023-07-16T21:08:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-17T01:46:43.000Z (almost 3 years ago)
- Last Synced: 2024-11-07T18:01:56.392Z (over 1 year ago)
- Topics: cli, gpt, llm, openai
- Language: Rust
- Homepage:
- Size: 29.3 KB
- Stars: 11
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iwt: I Wish To...
> A cli pipeline wish granting tool that calls out to GPT, inspired by `rg`, `jq`, etc. But you know .... magic instead of science. Make a wish!
This is currently using the OpenAI API. I don't have access to GPT-4 API yet, so this is using `gpt-3.5-turbo-16k`. Eventually that should be configurable, and even cooler would be to support alternate APIs or local models. Let's see if we can get it working at all first though, k?
## Installation
Three choices for installation:
* Clone repo and build yourself with `cargo build`
* Install from crates.io with `cargo install iwt`
* [Download the latest binary from github releases](https://github.com/awwaiid/iwt/releases/latest)
Next, set up your OpenAI API key:
```sh
export OPENAI_API_KEY=yourkeyhere
```
Put that into your `~/.zshrc` or whatnot.
## Usage
Generally: ` | iwt | `
Example: `curl https://news.ycombinator.com | iwt turn this into a csv of articles with title, domain name, link, points > out.csv`
That should output a csv with a row for each article and a title, domain name, link, and points. Yup. Like magic.
## Concept / Ideas
* Data input from STDIN
* Data output to STDOUT
* Instructions as the parameters
* Either explicit or implicit row-based processing. Maybe we should take the first chunk of data and ask the AI if it should be row based or not?
* Use TTY for additional guidance from the operator?
* Break long input into batches within token/context limits
* Warn (again, via TTY) for LARGE input?
* Progress via STDERR
* Select some next in vim and pipe it through `iwt`
## References, Simlar Things, Cool Stuff
* [Initial source used from async-openai chat example (MIT)](https://github.com/64bit/async-openai)
* [plz is a universal CLI tool that converts plain-English into an executable command.](https://plz.software/)
* [openai-cli](https://github.com/peterdemin/openai-cli)
* [Another openai-cli](https://github.com/levitatingbusinessman/openai-cli)
* [prompt](https://github.com/raiyanyahya/prompt)
* [chat-openai-cli](https://github.com/maurobonfietti/chat-open-ai-cli)