# rpi

> A Rust-native, library-first coding-agent runtime and terminal CLI with composable LLM providers, tools, sessions and a plugin ABI.

rpi is an open-source coding agent written in Rust, published by bigfish1913 under the MIT license. It ships as a terminal agent for reading and editing code, running commands and managing sessions, and as a set of crates for embedding the same agent loop in other Rust programs. The latest GitHub release listed is v0.9.2.

## What It Is

rpi is a library-first coding-agent runtime with a terminal CLI built on top of it. You can install a prebuilt single binary, configure a model provider such as Anthropic or an OpenAI-compatible gateway, and run it as an interactive TUI, a one-shot prompt, or a JSON event-stream mode. It began as a Rust reimplementation of the Pi TypeScript SDK by Mario Zechner and now has its own plugin ABI and runtime.

## Architecture and SDK

The workspace is split into composable crates covering telemetry, provider and streaming types, the agent loop, built-in tools (read, write, edit, bash, grep, find, ls, powershell), session harness, terminal UI, plugin SDK, plugin host and the CLI. A deterministic faux provider lets agents and tests run offline without an API key. Sessions persist as JSONL trees and resume from the last committed frame after a crash.

## Plugins and Remote Mode

Plugins are Rust cdylib libraries behind a stable C ABI and can register tools, providers, slash commands, event handlers and resources. Installable extensions include web search, web fetch and a subagents extension that exposes delegate_task with inherited configuration. Node/TypeScript extensions are described as compatibility beta features not recommended for production. A server mode runs the agent headless over TCP, with a thin TUI client connecting using a token.

## Performance Claims

The project's offline benchmark on Windows 11 reports a 21.8 MiB single binary, about 10.7x faster cold start and about 7.6x lower memory at ready compared with Pi, excluding model inference.

## Features
- Interactive terminal UI, one-shot and JSON output modes
- Built-in read, write, edit, bash, grep, find, ls and powershell tools
- Crash-resumable JSONL session trees with compaction
- Anthropic, OpenAI-compatible and offline faux providers
- Stable C ABI plugin system for tools, providers, slash commands and resources
- Embeddable Rust SDK crates
- Subagent delegation with inherited configuration via extension
- Remote server and thin client mode
- Request and stream idle timeout controls
- Single prebuilt binary with no Node.js runtime

## Integrations
Anthropic, OpenAI-compatible gateways, DeepSeek, crates.io, Homebrew, Scoop

## Platforms
WINDOWS, MACOS, LINUX, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
0.9.2

## Links
- Website: https://rpi.bigfisharc.cn/
- Documentation: https://rpi.bigfisharc.cn/docs.html
- Repository: https://github.com/bigfish1913/pi-rust
- EveryDev.ai: https://www.everydev.ai/tools/rpi
