# AIChat

> LLM CLI with a shell assistant, chat REPL, RAG, function calling and agents, supporting 20+ providers including OpenAI, Claude, Gemini and Ollama.

Stars: 10.5k · Language: Rust · License: Apache-2.0 · Categories: AI

- Repository: https://github.com/sigoden/aichat
- Page: https://www.trmn.sh/tools/aichat

## Install

- Homebrew: `brew install aichat`
- Cargo: `cargo install aichat`
- Pacman: `pacman -S aichat`

## Overview

AIChat is a command-line client for large language models. It talks to more than 20 providers through one interface, including OpenAI, Claude, Gemini, Ollama, Groq, Azure-OpenAI, VertexAI, Bedrock, Mistral, Deepseek, OpenRouter, and any OpenAI-compatible API. It runs in two modes: CMD mode for one-shot prompts, and a Chat-REPL with tab autocompletion, multi-line input, history search, configurable keybindings, and custom prompts.

Input can come from several sources. You can pipe stdin (`cat data.txt | aichat`), pass local files, directories, or remote URLs with `-f`, or pass the output of an external command (``aichat -f '`git diff`'``). In the REPL, the equivalent is `.file`. The shell assistant turns natural-language task descriptions into shell commands and adjusts them to your OS and shell.

Other features include roles (a prompt plus model configuration), sessions that keep conversation context, and macros that chain REPL commands. RAG lets you add external documents to a conversation. Function calling supports AI tools and MCP, and agents combine instructions, tools, and RAG documents. Tools and agents are built with the separate llm-functions repository.

`aichat --serve` starts a built-in HTTP server. It exposes OpenAI-style chat completions, embeddings, and rerank endpoints, so it can proxy multiple providers. It also serves a browser-based LLM Playground and an LLM Arena for comparing models side by side. It supports custom dark and light themes. It is aimed at developers and terminal users who want to work with several LLM providers from the command line and scripts.

### Installation

```bash
# via Homebrew
brew install aichat
```

```bash
# via Cargo
cargo install aichat
```

```bash
# via Pacman
pacman -S aichat
```

![AIChat REPL mode](https://media.trmn.sh/cached/1d004d5bc35a59a0d9e37f1467a45085e7554ed1e15905aeb32c7ed08dd394ac.gif)

![AIChat shell assistant](https://media.trmn.sh/cached/5fabd40ada22479e28db25a42eb1f77832a08024cc538d9cad4e7ace0d2e2cec.gif)

![AIChat CMD mode](https://media.trmn.sh/cached/c2f095699809b345262c7ce702ad54995d3bdd12afc4f0f91d31500c49eb5d1a.png)

## Alternatives

- [code2prompt](https://www.trmn.sh/tools/code2prompt.md): CLI and TUI that converts a codebase into a single LLM prompt with a source tree, Handlebars templates, git context, and token estimates. (Rust, 7.7k stars)
- [models](https://www.trmn.sh/tools/models.md): TUI and CLI for browsing AI models, benchmarks, coding agents, and provider statuses from multiple data sources. (Rust, 517 stars)
- [Codewhale](https://www.trmn.sh/tools/codewhale.md): Rust terminal coding agent that reads a repo, edits files, runs commands and checks results using hosted or local models (Ollama, vLLM, SGLang). (Rust, 41.1k stars)
- [herdr](https://www.trmn.sh/tools/herdr.md): Terminal multiplexer written in Rust that runs coding agents in persistent panes, tracks working/blocked/idle state, and manages local and SSH machines. (Rust, 46.3k stars)
- [Goose](https://www.trmn.sh/tools/goose.md): Open source AI agent for desktop, CLI, and API with 15+ provider integrations and Model Context Protocol extensions (Rust, 55.9k stars)

---

Canonical: https://www.trmn.sh/tools/aichat
