cai CLI

A Rust CLI for language models from a terminal: an answer, an image, a video, OCR, commit messages and shell commands

  • 204 ★ on the repository
  • Last commit
  • ISC
CLI

Extended access

Why this level

  • `cai commit` creates commits in a repository, `cai rename` renames files and `cai agent` starts a loop with tool calls
  • Prompt text, images and PDFs go to the chosen provider, and routing through Codex and Claude Code spends subscription limits
All reasons and checks

ad-si/cai

Install

Manual install

cargo install cai

Requires Rust with Cargo. The package is also on crates.io.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • `cai commit` creates commits in a repository, `cai rename` renames files and `cai agent` starts a loop with tool calls
  • Prompt text, images and PDFs go to the chosen provider, and routing through Codex and Claude Code spends subscription limits

This is third-party code. Review the repository files before installing.

What it does

cai is a Rust command-line program that sends tasks to models from Anthropic, OpenAI, Google, Groq, Cerebras, DeepSeek, xAI, Black Forest Labs and TypeSafe, as well as local Ollama and Llamafile and Apple's on-device model via "apfel". High-level commands remove the choice of model and prompt: `cai value capital of Australia` returns only the answer, `cai rewrite` fixes text from standard input, `cai commit` splits changes into commits and writes messages, `cai changelog` builds a changelog and `cai rename` names files by their content. Separate commands handle media: `image`, `photo` and `imgedit` for pictures, `video`, `music`, `say` and `transcribe` for video, music, speech and transcription, `ocr` pulls text from images and PDFs and `embed` builds vectors. The `run` command composes a shell command and asks for confirmation before running it, and `agent` starts a loop with tool calls. API keys are entered on first launch. With a ChatGPT or Claude subscription, OpenAI and Anthropic requests can go through the official Codex and Claude Code CLIs and spend the subscription's limits.

Who it is for. Developers and administrators who live in the terminal and want to call models from scripts and pipelines without Python glue.

Good fit when

  • You need a quick answer without commentary inside a pipeline: `cai value` returns only the value
  • Changes should be split by meaning before a commit: `cai commit` groups them and writes messages
  • A folder of scans is named at random: `cai rename` gives files names like timestamp plus title, for example `2025-08-19t2041_invoice_car.pdf`
  • You work offline: `cai local` takes Ollama or Apple's on-device model on macOS
  • A PDF page or a photo of a document must become text: `cai ocr scan.pdf`

Not a fit when

  • You need an MCP server for Claude Code or Cursor: cai runs as a command and the README mentions no MCP mode
  • You need a fixed default model: nameless prompts go through subscriptions and keys in priority order, so the result depends on settings
  • The system has neither Cargo nor Homebrew: the README lists no other way to install
  • You need a long dialogue with history in a chat interface: cai is built for individual commands

Example request

Split my uncommitted changes into logical commits with cai commit and show the messages before writing

Limitations

  • An API key from at least one provider or a local Ollama or Llamafile server is required. OpenAI and Anthropic APIs are unavailable from Russia, so local models remain.
  • Only text prompts and OCR go through subscriptions. Media generation, transcription, the agent and models outside the subscription need an API key, and answers via a CLI are not streamed.
  • Apple's model works on macOS 26 or newer with Apple Intelligence through the "apfel" utility.
  • The model list and defaults change between versions; `cai models` prints the current one.

How to disable. Remove the program with `cargo uninstall cai` or `brew uninstall cai`. Settings live in `~/.config/cai/config.yaml` and can be deleted by hand.

FAQ

How do I install cai?

Run `cargo install cai` or `brew install cai`. Then launch `cai` with no arguments: the program offers to pick a provider and enter a key.

How do I route requests through a Claude or ChatGPT subscription?

Install the official Claude Code and Codex, sign in and add `openai_via: codex` and `anthropic_via: claude-code` to `~/.config/cai/config.yaml`. The `CAI_OPENAI_VIA` and `CAI_ANTHROPIC_VIA` variables set the same values.

How do I pick a specific model?

Put the model name before the prompt: `cai opus list 10 fast CLI tools`. For media use the `-m` flag, for example `cai image -m google sunset over mountains`.

How do I work with a local model?

`cai local` calls `llama3.2` in Ollama, and if the server is not running and you are on macOS, Apple's model.

How do I pin one provider?

Add `preferred_provider: anthropic` to the config (`openai` and `google` also work). Then nameless prompts and the `fast`, `smart`, `rewrite` and `commit` commands take that provider's equivalent model.

Discussion

No questions or reviews yet.

CLI tools

A Rust CLI for over 20 LLM providers: command mode, REPL chat, RAG and tool calling from the terminal

CLIExtended access10.5KRepository stars

Black-box auditor runs a released CLI, catches side writes to disk and gives agents a command index with a readiness score.

CLIExtended access441Repository stars

A Rust coding agent with a native GUI, a terminal mode, an ACP mode for Zed and an MCP server

CLIBroad access187Repository stars

Two Rust commands for the terminal: qq answers a quick command-line question, and qa performs a single step with files and commands

CLIBroad access628Repository stars
Official

A terminal coding agent that picks a model for each request on its own and shows spend in real time

CLIBroad access352Repository stars

A Rust SDK for coding agents and the ready-made abstract CLI: REPL, 34 tools, MCP, graph memory, Anthropic and OpenAI, JSON output for CI

CLIBroad access464Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialRepository starsMain difference
cai (this card)no204
LLMno12,715a Python CLI and library with plugins, a SQLite prompt log and embeddings
AIChatno10,544a Rust CLI with a REPL chat, RAG and tool calling for over 20 providers

README in short

The page starts with a feature list and supported providers, then gives installation through Cargo or Homebrew. The usage section explains first-time key setup, routing through Codex and Claude Code subscriptions, choosing a preferred provider and the full `cai help` output with commands in groups.

README badge

Report a problem

Foxx AIcai
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.