Repolode
lassejlv

lassejlv/pi-rs

A Rust port of the pi coding agent harness, shipping a single native binary with the same CLI, terminal UI, file formats and extension API.

Stars
129
Forks
15
Open issues
0
Last commit
2 days ago

What is it?

pi-rs is a Rust reimplementation of pi, a minimal and extensible coding agent. It builds one native `pi` binary that aims for the same command-line interface, terminal UI, on-disk formats for sessions, settings, auth.json and models.json, RPC protocol and extension API as the TypeScript original. Node.js or Bun is not needed at runtime.

TypeScript extensions run on an embedded JavaScript engine (Boa), with TypeScript stripped by oxc and Node built-in modules such as fs, path and child_process provided by shims. The workspace is split into crates for providers and streaming (pi-ai), the agent loop (pi-agent), a terminal renderer (pi-tui), an MCP client (pi-mcp) and sandboxed code mode (pi-codemode).

The project documents known behavioral differences from the TypeScript version, including a different JavaScript engine, missing Windows terminal backend support and some stack trace text differences.

Key features

  • 01Single native `pi` binary with the same CLI and interactive, print, JSON and RPC modes.
  • 02Reads and writes session, settings, auth and models files compatibly with the TypeScript version.
  • 03Runs TypeScript and JavaScript extensions on an embedded engine without Node.js.
  • 04Supports many LLM providers including Anthropic, OpenAI, Google, Bedrock and Mistral.
  • 05Includes an MCP client with stdio and streamable HTTP transports.

Use cases

  • Running the pi coding agent on machines where installing Node.js or Bun is undesirable.
  • Sharing one agent configuration directory between the Rust and TypeScript builds.
  • Developing or porting pi extensions that need to run in a native binary.
  • Using MCP servers from a terminal-based coding agent.

Quick start

  1. 1

    Install Rust 1.88 or newer

  2. 2

    Build the release binary

    cargo build --release
  3. 3

    Install the pi binary into ~/.cargo/bin

    cargo install --path crates/pi-coding-agent
  4. 4

    Check the installed version

    ./target/release/pi --version

Things to know

  • No license is stated in the repository metadata.
  • Some behavior differs from the TypeScript pi, including the JavaScript engine (Boa), which changes extension stack traces and error messages.
  • The Windows terminal backend is not ported.

In collections

Topics

FAQ

What is pi-rs?
A Rust port of the pi coding agent harness, shipping a single native binary with the same CLI, terminal UI, file formats and extension API. pi-rs is a Rust reimplementation of pi, a minimal and extensible coding agent. It builds one native `pi` binary that aims for the same command-line interface, terminal UI, on-disk formats for sessions, settings, auth.json and models.json, RPC protocol and extension API as the TypeScript original. Node.js or Bun is not needed at runtime.
Is pi-rs free to use? What license does it have?
pi-rs has no declared license. Its code is public, but without a license you have no explicit permission to reuse it; ask the author before relying on it.
Is pi-rs still maintained?
Actively maintained. The last commit to pi-rs was on Nov 5, 2026.
What can I use pi-rs for?
Running the pi coding agent on machines where installing Node.js or Bun is undesirable. Sharing one agent configuration directory between the Rust and TypeScript builds. Developing or porting pi extensions that need to run in a native binary. Using MCP servers from a terminal-based coding agent.
How do I install pi-rs?
Install Rust 1.88 or newer Build the release binary: cargo build --release Install the pi binary into ~/.cargo/bin: cargo install --path crates/pi-coding-agent Check the installed version: ./target/release/pi --version
Where can I get pi-rs?
The source code and installation instructions are on GitHub: https://github.com/lassejlv/pi-rs

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects