终端里的
AI 编程搭档
The AI coding partner
in your terminal

Rpi 是一个用 Rust 编写的终端 AI 编程助手:读代码、改文件、跑命令、管理会话,全都在你的终端里完成。项目源自 Pi Rpi is a terminal AI coding assistant written in Rust: it reads code, edits files, runs commands and manages sessions — all without leaving your terminal. The project originates from Pi.

MIT 开源MIT License Rust 单二进制Single Rust binary v0.1.0 38 家模型服务商38 model providers 插件可扩展Extensible
rpi — ~/develop/ai/rpi
ls crates/
rpi   rpi-agent   rpi-ai   rpi-tui   rpi-ext-host
分析一下本机的 CPU 和内存配置analyze this machine's CPU and memory
⠋ thinking… (level: high · 12s)
bashlscpu | grep -E 'Model name|Socket' && free -h
✓ 完成✓ Done · read / bash / edit 工具可用 · 16 轮上下文已压缩 · read / bash / edit tools available · 16 turns compacted
本机为 AMD Ryzen 7 8845HS(8 核 16 线程),内存 32 GB DDR5-5600(2×16 GB)。This machine runs an AMD Ryzen 7 8845HS (8 cores / 16 threads) with 32 GB DDR5-5600 (2×16 GB).
把这段分析写进 notes.md 并提交write this analysis into notes.md and commit it
edit notes.md · +12 −0 · git commit ✓

Features

为什么是 RpiWhy Rpi

一个趁手的终端编程助手该有的样子:启动快、看得懂你的项目、改得动你的代码,还能按你的习惯扩展。 Everything a handy terminal coding assistant should be: fast to start, aware of your project, able to change your code, and easy to extend.

Rust 单二进制Single Rust binary

编译产出是一个静态链接的可执行文件,不依赖 Node、Python 或任何运行时。拷到机器上就能跑,启动毫秒级。 Builds into one statically linked executable — no Node, no Python, no runtime at all. Copy it onto a machine and it just runs, with millisecond startup.

🖥️完整的终端体验A complete terminal UI

多轮对话、流式输出、代码语法高亮、斜杠命令、@ 模糊引用文件、会话树回看与分支——在终端里就是完整的工作台。 Multi-turn chat, streaming output, syntax highlighting, slash commands, @ fuzzy file references, and a session tree you can revisit and branch — a full workbench in your terminal.

🛠️真正能干活Gets real work done

内置读文件、改代码、执行命令等工具,长对话自动压缩上下文不中断;可以把会话导出成 HTML,或一键生成链接分享给同事。 Built-in tools for reading files, editing code and running commands, with automatic context compaction on long conversations. Export sessions to HTML or share them with a link.

☁️38 家模型服务商38 model providers

OpenAI、Anthropic、DeepSeek、Kimi、Google、Bedrock……开箱内置 38 家服务商的模型清单,填个 API Key 就能切换使用。 OpenAI, Anthropic, DeepSeek, Kimi, Google, Bedrock… model catalogs for 38 providers ship out of the box — add an API key and switch models anytime.

🔌插件可扩展Extensible with plugins

想用自己喜欢的语言写插件?Rpi 同时支持 WebAssembly 插件和原生动态库插件,挂载后无需重启即可热重载。 Write plugins in the language you like: Rpi supports both WebAssembly and native dynamic-library plugins, with hot reload — no restart required.

🔒隐私由你掌控Privacy under your control

不强制上传任何数据。模型目录、版本检查等网络请求都可以用环境变量逐项关闭,配置文件都在本机 ~/.rpi 目录下。 Nothing is uploaded unless you want it to be. Model catalog, version check and other requests can each be disabled via environment variables; all configuration stays local in ~/.rpi.

Quickstart

快速开始Quickstart

三分钟跑起来:从源码构建,配上你的模型 Key,然后开始对话。 Up and running in three minutes: build from source, add your model key, and start chatting.

1从源码构建Build from source

$ git clone https://github.com/zhuacloud/rpi.git
$ cd rpi
$ cargo build --release
$ ./target/release/rpi

2配置模型Configure a model

# 在 ~/.rpi/agent/models.json 里加入你的 Key(以 DeepSeek 为例)
{"providers": {"deepseek": {
  "apiKey": "DEEPSEEK_API_KEY",
  "models": [{"id": "deepseek-v4-flash"}]}}}
# Add your key in ~/.rpi/agent/models.json (DeepSeek example)
{"providers": {"deepseek": {
  "apiKey": "DEEPSEEK_API_KEY",
  "models": [{"id": "deepseek-v4-flash"}]}}}

3开始使用Start using it

$ rpi                        # 交互模式:边聊边改
$ rpi --print "重构这个函数"    # 一次性问答,适合脚本
$ rpi --rpc                  # RPC 模式:给其他程序调用
$ rpi                           # interactive: chat and edit
$ rpi --print "refactor this"   # one-shot, script-friendly
$ rpi --rpc                     # RPC mode for other programs

4(可选)关掉网络请求(Optional) Disable requests

# 不需要模型目录更新 / 版本检查时,逐项关闭:
$ export RPI_MODEL_CATALOG_URL=off
$ export RPI_VERSION_CHECK_URL=off
$ export RPI_TELEMETRY_URL=off
# Turn off catalog updates / version checks individually:
$ export RPI_MODEL_CATALOG_URL=off
$ export RPI_VERSION_CHECK_URL=off
$ export RPI_TELEMETRY_URL=off