Test coverage: 68.860% 😌👏
clai
(/klaɪ/, like "cli" in "cli mate") is a command line context-feeder for any ai task.
Installing:
curl -fsSL https://raw.githubusercontent.com/baalimago/clai/main/setup.sh | sh
You can also install via go:
go install github.com/baalimago/clai@latest
Then run:
clai help | clai query Please give a concise explanation of clai
Either look at clai help
or the examples for how to use clai
. If you have time, you can also check out this blogpost for a slightly more structured introduction on how to use Clai efficiently.
Install Glow for formatted markdown output when querying text responses.
- Add any MCP server you'd like by simply pasting their configuration.MCP client supportVendor agnosticism- Use any functionality in Clai withmost LLM vendorsinterchangeably.- Create, manage and continue conversations.Conversations- Pre-prompted profiles enabling customized workflows and agents.ProfilesUnix-like- Clai follows theunix philosophyand works seamlessly with data piped in and out.
All of these features are easily combined and tweaked, empowering users to accomplish very diverse use cases. See examples for additional info.
| Vendor | Environment Variable | Models |
|---|---|---|
| Berget AI | BERGET_API_KEY |
|
berget: |
OPENROUTER_API_KEY
Text models, use prefixor:
MISTRAL_API_KEY
Text modelsOPENAI_API_KEY
Text models,photo modelsANTHROPIC_API_KEY
Text modelsGEMINI_API_KEY
Text models,photo modelsHF_API_KEY
Text models, use prefixhf:
XAI_API_KEY
Text modelsINCEPTION_API_KEY
Text modelsollama:
(defaults to llama3), server defaults to localhost:11434Shell completions are also available:
mkdir -p ~/.local/share/bash-completion/completions
clai completion bash > ~/.local/share/bash-completion/completions/clai
mkdir -p ~/.zsh/completions
clai completion zsh > ~/.zsh/completions/_clai
For zsh, ensure your fpath
includes the completions directory before compinit
, for example:
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit
Then restart your shell or reload your shell configuration.