https://github.com/joshka/ja
ja is a small CLI / TUI app that allows you to work with AI tools
https://github.com/joshka/ja
ai gpt openai ratatui tui
Last synced: about 1 month ago
JSON representation
ja is a small CLI / TUI app that allows you to work with AI tools
- Host: GitHub
- URL: https://github.com/joshka/ja
- Owner: joshka
- License: mit
- Created: 2023-05-08T02:09:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T01:57:16.000Z (about 1 month ago)
- Last Synced: 2025-03-16T00:23:10.466Z (about 1 month ago)
- Topics: ai, gpt, openai, ratatui, tui
- Language: Rust
- Homepage: https://github.com/joshka/ja
- Size: 410 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ja (just ask) a small CLI app that allows you to work with AI tools
Right now it's just yet another wrapper around the openAI apis
Run interactively:
```shell
ja
```
Command line parameters
```text
ja (just ask) is a small CLI / TUI app that allows you to work with AI toolsUsage: ja [OPTIONS] [-- ...] [COMMAND]
Commands:
chat default command (can be omitted)
logs
help Print this message or the help of the given subcommand(s)Arguments:
[MESSAGE]...
Options:
-m, --model
ID of the model to usePossible values:
- gpt-3.5-turbo: alias 3.5 (default - because it's fast and cheap)
- gpt-3.5-turbo-0301
- gpt-3.5-turbo-0613
- gpt-3.5-turbo-1106
- gpt-3.5-turbo-16k: alias 3.5-16k
- gpt-3.5-turbo-16k-0613
- gpt-4: alias 4
- gpt-4-0314
- gpt-4-0613
- gpt-4-1106-preview
- gpt-4-32k: alias 4-32k
- gpt-4-32k-0314
- gpt-4-32k-0613-t, --temperature
Sampling temperature-p, --top-p
Probability mass percentage-n, --n
Number of choices to generate for each input message-s, --stream
Stream the resultt of the API call
[possible values: true, false]--stop
Up to 4 sequences where the API will stop generating further tokens-c, --max-tokens
The maximum number of tokens to generate in the chat completion--presence-penalty
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far--frequency-penalty
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far-u, --user
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse-i, --input
Input file-o, --output
Output file--system
System message-v, --verbose
Show verbose output-h, --help
Print help (see a summary with '-h')-V, --version
Print version
```Example usage:
Provide command line paramters directly:
```text
$ ja -- hello
assistant: Hello! How can I assist you today?
```Provide input via a pipe:
```text
$ echo "hello" | ja
assistant: Hello! How can I assist you today?
```## TODO
In no specific order, some ideas:
- [x] Store logs in cache dir (use --verbose to see the filename)
- [x] Accept input from stdin
- [x] Prompts for input at the terminal if none is provided from command line / stdin
- [x] Chat mode. Not just a single conversation, but multiple (there are plenty of ChatGPT style apps already though)
- [ ] Syntax highlight code in output
- [ ] Add a TUI mode (using [ratatui](https://tui-rs-revival/ratatui))
- [ ] History management: Allow users to view, search, and manage their conversation history, making it easier to refer back to previous interactions.
- [ ] Customizable output formatting: Provide options for users to customize the output format, such as plain text, JSON, or even HTML, to better suit their needs.
- [ ] Rate limiting and usage monitoring: Add features to monitor API usage and enforce rate limits, helping users avoid unexpected costs or API restrictions.
- [ ] Support for other OpenAI models: Expand the app to support additional OpenAI models, giving users more options for generating content.
- [ ] Text-to-speech integration: Integrate text-to-speech functionality, allowing users to listen to the AI-generated responses instead of reading them.
- [ ] Customize system message. Customizable AI behavior: Allow users to adjust the AI's behavior
- [ ] Templated messages