https://github.com/baalimago/clai
Command line artificial intelligence - Your local LLM context-feeder
https://github.com/baalimago/clai
ai cli context-feeder go golang-tools llm
Last synced: about 2 months ago
JSON representation
Command line artificial intelligence - Your local LLM context-feeder
- Host: GitHub
- URL: https://github.com/baalimago/clai
- Owner: baalimago
- License: mit
- Created: 2024-03-03T12:36:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-05-03T05:43:42.000Z (about 2 months ago)
- Last Synced: 2026-05-03T07:25:15.450Z (about 2 months ago)
- Topics: ai, cli, context-feeder, go, golang-tools, llm
- Language: Go
- Homepage:
- Size: 11.9 MB
- Stars: 142
- Watchers: 1
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Command Line Artificial Intelligence
[](https://goreportcard.com/report/github.com/baalimago/clai)

Test coverage: 67.467% ππ
clai (/klaΙͺ/, like "cli" in "climate") is a command line context-feeder for any ai task.
## Get started
Installing:
```bash
curl -fsSL https://raw.githubusercontent.com/baalimago/clai/main/setup.sh | sh
```
You can also install via go:
```bash
go install github.com/baalimago/clai@latest
```
Then run:
```bash
clai help | clai query Please give a concise explanation of clai
```
Either look at `clai help` or the [examples](./EXAMPLES.md) for how to use `clai`.
If you have time, you can also check out [this blogpost](https://lorentz.app/blog-item.html?id=clai) for a slightly more structured introduction on how to use Clai efficiently.
Install [Glow](https://github.com/charmbracelet/glow) for formatted markdown output when querying text responses.
## Features
- **[MCP client support](./EXAMPLES.md#mcp-tools-external-tool-servers)** - Add any MCP server you'd like by simply pasting their configuration.
- **Vendor agnosticism** - Use any functionality in Clai with [most LLM vendors](#supported-vendors) interchangeably.
- **[Conversations](./EXAMPLES.md#bind-a-previous-conversation-to-the-current-directory)** - Create, manage and continue conversations.
- **[Profiles](./EXAMPLES.md#profiles--workflow-presets)** - Pre-prompted profiles enabling customized workflows and agents.
- **Unix-like** - Clai follows the [unix philosophy](https://en.wikipedia.org/wiki/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](./EXAMPLES.md) for additional info.
## Supported vendors
| Vendor | Environment Variable | Models |
| ----------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| OpenRouter | `OPENROUTER_API_KEY` | [Text models](https://openrouter.ai/models), use prefix `or:` |
| Mistral | `MISTRAL_API_KEY` | [Text models](https://docs.mistral.ai/getting-started/models/) |
| OpenAI | `OPENAI_API_KEY` | [Text models](https://platform.openai.com/docs/models), [photo models](https://platform.openai.com/docs/models/dall-e) |
| Anthropic | `ANTHROPIC_API_KEY` | [Text models](https://platform.claude.com/docs/en/about-claude/models/overview) |
| Gemini | `GEMINI_API_KEY` | [Text models](https://ai.google.dev/gemini-api/docs/models), [photo models](https://ai.google.dev/gemini-api/docs/image-generation#image_generation_text-to-image) |
| HuggingFace | `HF_API_KEY` | [Text models](https://huggingface.co/docs/inference-endpoints/chat-completions), use prefix `hf:` |
| xAi | `XAI_API_KEY` | [Text models](https://docs.x.ai/docs/models) |
| Inception | `INCEPTION_API_KEY` | [Text models](https://platform.inceptionlabs.ai/docs#models) |
| Ollama | N/A | Use format `ollama:` (defaults to llama3), server defaults to localhost:11434 |
---
Shell completions are also available:
```bash
# bash
mkdir -p ~/.local/share/bash-completion/completions
clai completion bash > ~/.local/share/bash-completion/completions/clai
```
```bash
# zsh
mkdir -p ~/.zsh/completions
clai completion zsh > ~/.zsh/completions/_clai
```
For zsh, ensure your `fpath` includes the completions directory before `compinit`, for example:
```bash
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinit
```
Then restart your shell or reload your shell configuration.