bigfish1913/pi-rust

Rust-native, library-first coding-agent runtime and terminal CLI inspired by Pi, with composable LLM providers, tools, sessions, and plugin ABI

What it solves

Many coding agents are locked-down command-line tools that cannot be easily embedded into other applications or tested without a live network connection. This project provides a library-first runtime and terminal agent written in Rust, allowing developers to embed coding agents directly into their own processes, run tests offline with deterministic mocks, and extend functionality using a stable plugin system.

How it works

Built as a modular workspace of eleven composable Rust crates, the project separates concerns like provider adapters, the agent loop, tooling, and terminal UI. Sessions are persisted as JSONL files with crash-resumable progress tracking, meaning interrupted tasks can resume from the last committed frame. It supports multiple AI providers (including Anthropic and OpenAI-compatible gateways) and allows developers to write plugins as standard Rust dynamic libraries behind a stable ABI.

Who it’s for

This project is designed for developers and power users who want to own their coding-agent loop rather than relying on a black-box tool. It caters to those who need an embeddable Rust SDK for AI agents, a lightweight terminal interface with low memory usage, or a stable extension mechanism that won't break across minor releases.

Highlights

  • Library-first architecture with an embeddable agent loop that runs directly inside your process.
  • Crash-resumable sessions utilizing JSONL persistence and per-frame progress tracking.
  • Deterministic offline testing support via a built-in faux provider and in-memory execution environment.
  • Stable plugin ABI using Rust cdylib libraries to prevent extension breakage on compiler updates.
  • Extremely lightweight footprint with fast startup times and low memory usage.

Related

  • Project
  • Project
  • Project
  • Project