clai: command line artificial intelligence
clai
integrates AI models of multiple vendors via with the terminal.
You can generate images, text, summarize content and chat while using native terminal functionality, such as pipes and termination signals.
The multi-vendor aspect enables easy comparisons between different models, also removes the need for multiple subscriptions: most APIs are usage-based (some with expiration time).
Features
- Prompting with input from:
- Piped data
- Globbed file input
- Args
- Conversations (with same input options as above)
- Tools calling with easily forkable + extendable tools
- Photo generation*
- Human readable / robot readable output
- 100% go standard library (except for /x/net)
* Only with dall-e for the moment.
Nag on me to implement modellabs and I'll do it.
Prerequisites
Note that you can only use the models that you have bought an API key for.
Most text and photo based models within the respective vendors are supported, see model configurations for how to swap.
Get started
go install github.com/baalimago/clai@latest
Either look at clai help
or the examples for how to use clai
.
Honorable mentions
This project was originally inspired by: https://github.com/Licheam/zsh-ask, many thanks to Licheam for the inspiration.