aichat README

The project's README from github.com/sigoden/aichat. As one markdown file: README.md.

AIChat: All-in-one LLM CLI Tool

CI Crates Discord

AIChat is an all-in-one LLM CLI tool featuring Shell Assistant, CMD & REPL Mode, RAG, AI Tools & Agents, and More.

Install

Package Managers

Pre-built Binaries

Download pre-built binaries for macOS, Linux, and Windows from GitHub 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, MiniMax, Deepinfra, VoyageAI, any OpenAI-Compatible API provider.

CMD Mode

Explore powerful command-line functionalities with AIChat's CMD mode.

aichat-cmd

REPL Mode

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

aichat-repl

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.

aichat-execute

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.

aichat-role

The role consists of a prompt and model configuration.

Session

Maintain context-aware conversations through sessions, ensuring continuity in interactions.

aichat-session

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.

aichat-macro

RAG

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

aichat-rag

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 to help you make the most of this feature.

AI Tools & MCP

Integrate external tools to automate tasks, retrieve information, and perform actions directly within your workflow.

aichat-tool

AI Agents (CLI version of OpenAI GPTs)

AI Agent = Instructions (Prompt) + Tools (Function Callings) + Documents (RAG).

aichat-agent

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:

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.

aichat-llm-playground

LLM Arena

A web platform to compare different LLMs side-by-side.

aichat-llm-arena

Custom Themes

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

aichat-themes

Documentation

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.

aichat (sigoden/aichat)

Searching Database…

10.5K ·GitHub
这是什么?AIChat 是一个一体化的 LLM 命令行工具:集 shell 助手、聊天 REPL、RAG、AI 工具和智能体于一身,可连接 OpenAI、Claude、Gemini、Ollama、Groq 等服务。
它是图形界面应用还是终端工具?是一个终端工具。CMD 模式用于运行单次命令,比如 'aichat hello';REPL 模式是交互式聊天,支持 Tab 补全、多行输入和历史搜索。
它能连接哪些 LLM 服务商?它通过一个统一接口支持 20 多家服务商:OpenAI、Claude、Gemini、Groq、Azure-OpenAI、Bedrock、Deepseek 等,使用你自己服务商的密钥即可。
它能在 Windows 和 macOS 上运行吗,还是只支持 Linux?macOS、Linux 和 Windows 都支持——预编译二进制文件可在 GitHub Releases 下载。Android 也能用,通过 Termux('pkg install aichat')安装。
我能把它部署成网络服务吗?可以。它内置一个轻量的 HTTP 服务器,可以把部署成 LLM API 代理、浏览器 Playground,或者用来并排对比模型的 LLM Arena。
能用本地模型吗?可以,通过 Ollama:它是支持的服务商之一,所以你可以运行本地模型,完全不碰任何云端 API。
它是开源的吗?采用 MIT 或 Apache 2.0 双重许可,任你选择——可以免费使用,包括商业用途。
Shell 助手到底能做什么?你用自然语言描述一个任务,AIChat 会把它转换成准确的 shell 命令,并自动适配你的操作系统和 shell 环境。当你知道想做什么、却记不住确切命令时,它特别好用。
能把我自己的文件或网页喂给它吗?可以——它接受标准输入、本地文件和整个目录,也接受远程网址,全部可以在一条提示里组合使用。借助 RAG,它还能把你的文档引入对话,给出更贴合上下文的回答。
能用它构建自己的智能体吗?可以。一个 AI 智能体由指令(提示词)+ 工具(函数调用)+ 文档(RAG)构成,可以理解为命令行版的 OpenAI GPTs。它还支持集成外部 AI 工具和 MCP 服务器。
能调整它的行为并保留对话上下文吗?角色(Roles)把提示词和模型配置打包在一起,用来定制 LLM 的行为;会话(sessions)则让对话保持上下文连贯。宏(Macros)可以把一系列 REPL 命令串成一个可复用的脚本,方便处理重复性任务。
Creator
sigoden
Size
4.1 MB
Stars
10.5K
Age
3y
Commits · 90 Days