Command Line Artificial Intelligence

June 19, 2026 ยท View on GitHub

Go Report Card Wakatime

Test coverage: 68.112% ๐Ÿ˜Œ๐Ÿ‘


clai (/klaษช/, like "cli" in "climate") is a command line context-feeder for any ai task.

Banner

Get started

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.

Features

Showcase
  • MCP client support - Add any MCP server you'd like by simply pasting their configuration.
  • Vendor agnosticism - Use any functionality in Clai with most LLM vendors interchangeably.
  • Conversations - Create, manage and continue conversations.
  • Profiles - Pre-prompted profiles enabling customized workflows and agents.
  • Unix-like - Clai follows the unix philosophy and 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.

Supported vendors

VendorEnvironment VariableModels
OpenRouterOPENROUTER_API_KEYText models, use prefix or:
MistralMISTRAL_API_KEYText models
OpenAIOPENAI_API_KEYText models, photo models
AnthropicANTHROPIC_API_KEYText models
GeminiGEMINI_API_KEYText models, photo models
HuggingFaceHF_API_KEYText models, use prefix hf:
xAiXAI_API_KEYText models
InceptionINCEPTION_API_KEYText models
OllamaN/AUse format ollama: (defaults to llama3), server defaults to localhost:11434

Shell completions are also available:

# bash
mkdir -p ~/.local/share/bash-completion/completions
clai completion bash > ~/.local/share/bash-completion/completions/clai
# zsh
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.