https://github.com/sigoden/aichat
All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more.
https://github.com/sigoden/aichat
ai ai-agents chatbot claude cli function-calling gemini llm ollama openai rag rust shell webui
Last synced: 3 days ago
JSON representation
All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more.
- Host: GitHub
- URL: https://github.com/sigoden/aichat
- Owner: sigoden
- License: apache-2.0
- Created: 2023-03-03T00:29:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T00:47:22.000Z (11 days ago)
- Last Synced: 2025-04-19T12:31:07.172Z (6 days ago)
- Topics: ai, ai-agents, chatbot, claude, cli, function-calling, gemini, llm, ollama, openai, rag, rust, shell, webui
- Language: Rust
- Homepage:
- Size: 4.09 MB
- Stars: 6,479
- Watchers: 51
- Forks: 422
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-cli-apps - AIChat - Using ChatGPT/GPT-3.5/GPT-4 in the terminal. (<a name="ai"></a>AI / ChatGPT)
- awesome-ChatGPT-repositories - aichat - Using ChatGPT/GPT-3.5/GPT-4 in the terminal. (CLIs)
- awesome-llm-and-aigc - sigoden/aichat - 3.5/GPT-4 in the terminal. (Applications / 提示语(魔法))
- awesome-cli-apps-in-a-csv - AIChat - Using ChatGPT/GPT-3.5/GPT-4 in the terminal. (<a name="ai"></a>AI / ChatGPT)
- awesome-chatgpt - sigoden/aichat - Use GPT-4(V), LocalAI and other LLMs in the terminal. (UIs / CLI)
- awesome - sigoden/aichat - All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. (Rust)
- awesome-open-gpt - aichat - 3.5/GPT-4 | 1.支持角色预设<br/>2.语法突出显示markdown和其他200种语言 | (精选开源项目合集 / GPT镜像平替)
- definitive-opensource - AIChat - in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. | `Cross` `CLI` | **6.4k** | (Table of Contents / All In One)
- StarryDivineSky - sigoden/aichat - REPL、Shell Assistant、RAG、AI工具和代理功能,可以访问OpenAI、Claude、Gemini、Ollama、Groq等。 (A01_文本生成_文本对话 / 大语言对话模型及数据)
- awesome-llm-and-aigc - sigoden/aichat - 3.5/GPT-4 in the terminal. (Summary)
- awesome-cuda-and-hpc - sigoden/aichat - 3.5/GPT-4 in the terminal. (Frameworks)
- awesome-cuda-and-hpc - sigoden/aichat - 3.5/GPT-4 in the terminal. (Frameworks)
- awesome-rust-list - sigoden/aichat - 3.5/GPT-4 in the terminal. (Machine Learning)
- awesome-rust-list - sigoden/aichat - 3.5/GPT-4 in the terminal. (Machine Learning)
- awesome-list - aichat - All-in-one AI CLI tool that integrates 20+ AI platforms. (Linux 🐧 / AI)
- jimsghstars - sigoden/aichat - All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. (Rust)
- awesome-rainmana - sigoden/aichat - All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. (Rust)
- Awesome-ChatGPT - aichat - 3.5/GPT-4 | 1.支持角色预设<br/>2.语法突出显示markdown和其他200种语言 | (精选开源项目合集 / GPT镜像平替)
- awesome-rust - aichat - All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. (Applications / Productivity)
- trackawesomelist - aichat (⭐5.2k) - All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. (Recently Updated / [Who Wants to Be a Millionare](https://www.boardgamecapital.com/who-wants-to-be-a-millionaire-rules.htm))
- fucking-awesome-rust - aichat - All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI Tools & Agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more. (Applications / Productivity)
README
# AIChat: All-in-one LLM CLI Tool
[](https://github.com/sigoden/aichat/actions/workflows/ci.yaml)
[](https://crates.io/crates/aichat)
[](https://discord.gg/mr3ZZUB9hG)AIChat is an all-in-one LLM CLI tool featuring Shell Assistant, CMD & REPL Mode, RAG, AI Tools & Agents, and More.
## Install
### Package Managers
- **Rust Developers:** `cargo install aichat`
- **Homebrew/Linuxbrew Users:** `brew install aichat`
- **Pacman Users**: `pacman -S aichat`
- **Windows Scoop Users:** `scoop install aichat`
- **Android Termux Users:** `pkg install aichat`### Pre-built Binaries
Download pre-built binaries for macOS, Linux, and Windows from [GitHub Releases](https://github.com/sigoden/aichat/releases), extract them, and add the `aichat` binary to your `$PATH`.
## Features
### Multi-Providers
Integrate seamlessly with over 20 leading LLM providers through a unified interface. Supported providers include OpenAI, Claude, Gemini (Google AI Studio), Ollama, Groq, Azure-OpenAI, VertexAI, Bedrock, Github Models, Mistral, Deepseek, AI21, XAI Grok, Cohere, Perplexity, Cloudflare, OpenRouter, Ernie, Qianwen, Moonshot, ZhipuAI, Lingyiwanwu, MiniMax, Deepinfra, VoyageAI, any OpenAI-Compatible API provider.
### CMD Mode
Explore powerful command-line functionalities with AIChat's CMD mode.

### REPL Mode
Experience an interactive Chat-REPL with features like tab autocompletion, multi-line input support, history search, configurable keybindings, and custom REPL prompts.

### Shell Assistant
Elevate your command-line efficiency. Describe your tasks in natural language, and let AIChat transform them into precise shell commands. AIChat intelligently adjusts to your OS and shell environment.

### Multi-Form Input
Accept diverse input forms such as stdin, local files and directories, and remote URLs, allowing flexibility in data handling.
| Input | CMD | REPL |
| ----------------- | ------------------------------------ | -------------------------------- |
| CMD | `aichat hello` | |
| STDIN | `cat data.txt \| aichat` | |
| Last Reply | | `.file %%` |
| Local files | `aichat -f image.png -f data.txt` | `.file image.png data.txt` |
| Local directories | `aichat -f dir/` | `.file dir/` |
| Remote URLs | `aichat -f https://example.com` | `.file https://example.com` |
| External commands | ```aichat -f '`git diff`'``` | ```.file `git diff` ``` |
| Combine Inputs | `aichat -f dir/ -f data.txt explain` | `.file dir/ data.txt -- explain` |### Role
Customize roles to tailor LLM behavior, enhancing interaction efficiency and boosting productivity.

> The role consists of a prompt and model configuration.
### Session
Maintain context-aware conversations through sessions, ensuring continuity in interactions.

> The left side uses a session, while the right side does not use a session.
### Macro
Streamline repetitive tasks by combining a series of REPL commands into a custom macro.

### RAG
Integrate external documents into your LLM conversations for more accurate and contextually relevant responses.

### Function Calling
Function calling supercharges LLMs by connecting them to external tools and data sources. This unlocks a world of possibilities, enabling LLMs to go beyond their core capabilities and tackle a wider range of tasks.
We have created a new repository [https://github.com/sigoden/llm-functions](https://github.com/sigoden/llm-functions) to help you make the most of this feature.
#### AI Tools
Integrate external tools to automate tasks, retrieve information, and perform actions directly within your workflow.

#### AI Agents (CLI version of OpenAI GPTs)
AI Agent = Instructions (Prompt) + Tools (Function Callings) + Documents (RAG).

### Local Server Capabilities
AIChat includes a lightweight built-in HTTP server for easy deployment.
```
$ aichat --serve
Chat Completions API: http://127.0.0.1:8000/v1/chat/completions
Embeddings API: http://127.0.0.1:8000/v1/embeddings
Rerank API: http://127.0.0.1:8000/v1/rerank
LLM Playground: http://127.0.0.1:8000/playground
LLM Arena: http://127.0.0.1:8000/arena?num=2
```#### Proxy LLM APIs
The LLM Arena is a web-based platform where you can compare different LLMs side-by-side.
Test with curl:
```sh
curl -X POST -H "Content-Type: application/json" -d '{
"model":"claude:claude-3-5-sonnet-20240620",
"messages":[{"role":"user","content":"hello"}],
"stream":true
}' http://127.0.0.1:8000/v1/chat/completions
```#### LLM Playground
A web application to interact with supported LLMs directly from your browser.

#### LLM Arena
A web platform to compare different LLMs side-by-side.

## Custom Themes
AIChat supports custom dark and light themes, which highlight response text and code blocks.

## Documentation
- [Chat-REPL Guide](https://github.com/sigoden/aichat/wiki/Chat-REPL-Guide)
- [Command-Line Guide](https://github.com/sigoden/aichat/wiki/Command-Line-Guide)
- [Role Guide](https://github.com/sigoden/aichat/wiki/Role-Guide)
- [Macro Guide](https://github.com/sigoden/aichat/wiki/Macro-Guide)
- [RAG Guide](https://github.com/sigoden/aichat/wiki/RAG-Guide)
- [Environment Variables](https://github.com/sigoden/aichat/wiki/Environment-Variables)
- [Configuration Guide](https://github.com/sigoden/aichat/wiki/Configuration-Guide)
- [Custom Theme](https://github.com/sigoden/aichat/wiki/Custom-Theme)
- [Custom REPL Prompt](https://github.com/sigoden/aichat/wiki/Custom-REPL-Prompt)
- [FAQ](https://github.com/sigoden/aichat/wiki/FAQ)## License
Copyright (c) 2023-2025 aichat-developers.
AIChat is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
See the LICENSE-APACHE and LICENSE-MIT files for license details.