Skip to content
yannelliPublic

About

A drop-in Rust port of the pi agent harness, with extensions, built for 1:1 parity with pi.

Topics

Resources

Security policy

Stars

24 stars

Watchers

0 watching

Forks

Repository files navigation

pi-rust logo

pi-rust

pi-rust is a drop-in Rust port of the pi coding agent harness, built for 1:1 parity with pi. In this file, "upstream pi" is the original pi, which is written in TypeScript.

  • Drop-in replacement: pi-rust is the same pi command, and it reads your ~/.pi/agent setup. Session files, settings keys, config paths, and RPC and JSON events match upstream pi byte for byte, so the two can use one setup.
  • Extensions: your TypeScript extensions, skills, prompt templates, themes, and pi packages work as they are. Extensions run on an embedded QuickJS engine with the Node built-in modules, so pi-rust does not need Node.js or another JavaScript runtime. To run them on Node 22 or later, set extensionRuntime to "node".
  • 1:1 parity: the Parity workflow compares pi-rust with upstream pi every day and updates the parity report. Differences from upstream pi lists each intended difference.

One binary has these parts:

  • A streaming API for large language models (LLMs) from many providers.
  • An agent loop that calls tools.
  • The pi coding agent, which has a command-line interface (CLI).

Website and documentation: pi-rust.com.

Install

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/yannelli/pi-rust/main/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/yannelli/pi-rust/main/install.ps1 | iex

Homebrew (macOS and Linux):

brew install yannelli/tap/pi

The script downloads the latest release, compares it with SHA256SUMS, and installs pi. For script options, manual install, and build from source, see Install.

Quick start

# set an API key (ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, ...)
# or run /login
export ANTHROPIC_API_KEY=...

# interactive session in the current directory
pi

pi -p "Summarize src/main.rs"       # print mode: run once, print the answer
pi --mode json -p "List the TODOs"  # one JSON event per line
pi --mode rpc                       # JSON-RPC over stdio for other programs
pi -c                               # continue the latest session here
pi -r                               # pick a session to resume
pi --model openai/gpt-5.5 --thinking high
pi @notes.md @screenshot.png "What changed?"
cat error.log | pi -p "Explain this error"

# install a pi package (extensions, skills, themes)
pi install npm:<package>

Run pi --help to see all options. In interactive mode, type / to see the commands.

Documentation

Page Contents
Install Script options, manual install, provenance check, update, and build from source
Interactive commands /diff, /context, /export, /init, /review, /undo, /retry, and prompt history
CLI commands and flags pi completion, pi doctor, pi sessions, pi stats, run limits, structured output, and pi extensions
Extension marketplace Find, install, update, and remove native Rust extensions
Providers Wire protocols, logins, Cursor, Google Antigravity, disabledProviders, OpenRouter, and account model lists
Status line The marketplace:statusline extension and the move from the built-in status line
Terminal Themes, notifications, and the marketplace:iterm2 extension
ACP mode pi --mode acp for Zed and other editors
ACP agents Kiro CLI, Amp, and ACP registry agents as providers, /acp, and the acpAgents setting
Docs index Agent playbooks, parity, and the protocol notes of the subscription providers

Configuration

pi-rust reads the same files as upstream pi, so the two can use one setup. To use a different folder in place of ~/.pi/agent, set PI_CODING_AGENT_DIR.

Path Contents
~/.pi/agent/auth.json API keys and OAuth logins from /login or pi auth
~/.pi/agent/settings.json Settings. In a trusted project, <project>/.pi/settings.json overrides them.
~/.pi/agent/models.json Custom providers and models
~/.pi/agent/keybindings.json Key bindings
~/.pi/agent/mcp.json, <project>/.pi/mcp.json MCP servers
~/.pi/agent/{extensions,skills,prompts,themes}/ Extensions, skills, prompt templates, and themes. .pi/ in a project and ~/.agents/skills also work.
AGENTS.md, CLAUDE.md, SYSTEM.md, APPEND_SYSTEM.md Context files and system prompt overrides
~/.pi/agent/sessions/ Sessions as JSONL trees in the pi format
~/.pi/agent/prompt-history.jsonl The prompts that you sent, for Up, Down, and Ctrl+R (pi-rust only)

When pi-rust starts for the first time, it moves files from older pi layouts, as upstream pi does. For example, it moves oauth.json into auth.json.

Differences from upstream pi

pi-rust ports the upstream pi CLI and its libraries. This section lists the differences and SDK limits.

Runtime

  • New Kimi Code OAuth logins use the global .ai endpoints.

    • For a mainland China login, set KIMI_CODE_OAUTH_HOST=https://auth.kimi.com.
    • A new login stores its OAuth and API endpoints for later refreshes. Older logins without this metadata keep their mainland endpoints.
    • KIMI_CODE_OAUTH_HOST and KIMI_CODE_BASE_URL, when set, override the saved endpoints. A custom model baseUrl in models.json stays in effect.
  • Kimi and Moonshot tool requests infer omitted types from enums, constants, and unambiguous schema structure.

  • QuickJS answers localhost and loopback reverse queries locally. It rejects onion and invalid names and their subdomains without contacting a DNS server. If the OS supplies no DNS servers, getServers() returns an empty list. Extensions can supply a server with setServers(). See DNS behavior.

  • Extensions run on an embedded QuickJS engine, so pi-rust does not need Node.js. All Node built-in modules load. These include:

    • zlib with gzip, brotli, and zstd.
    • async_hooks with AsyncLocalStorage, and v8 serialization.
    • The network modules net, tls, dgram, dns, http, https, and http2. On Windows, QuickJS uses the adapter metric alone if it cannot read the system route table.
    • vm contexts with timeouts, worker_threads, and cluster. They can send socket and server handles over inter-process communication (IPC).
    • node:sqlite on the bundled SQLite, node:test with TAP and spec output, and repl over any streams.
    • In-process inspector sessions, and wasi with a WebAssembly global on the wasmi interpreter.

    The APIs that do not work throw ERR_PI_UNSUPPORTED. Examples are rare crypto ciphers such as Camellia, and structured cloning of a CryptoKey. crates/pi-js/src/unsupported.rs lists all of them. Native npm addons cannot load on QuickJS. Packages that need one, such as pi-deltabox, @ff-labs/pi-fff, and @onkernel/browser-loop (sharp), run with --extension-runtime auto or node.

    To run extensions on Node 22 or later, set extensionRuntime to "node" or "auto", or use --extension-runtime or PI_EXTENSION_RUNTIME. On Node, native addons, child_process.fork, and V8-only modules work. If Node is missing, pi uses QuickJS. See Node backend. The extension package audit compares the 70 most downloaded npm extension packages with upstream pi and lists the engine each one needs.

  • QuickJS comes from a vendored copy of rquickjs-sys 0.14.0 with one fix in quickjs.c: a module that waited only for a top-level-await dependency can be imported again later. Unpatched QuickJS-ng never settles that import. See [patch.crates-io] in Cargo.toml.

  • VERSION of @earendil-works/pi-coding-agent is the upstream pi version that pi-rust has parity with, so version checks written for upstream releases pass. PI_RUST_VERSION is the pi-rust release. Upstream has no such export.

  • IPC handle retries use a pi-js-specific wrapper. Internal handle listeners receive an object with only close(). Cluster connections queued to a disconnected worker are not reclaimed. See Extension runtime.

  • On non-Linux Unix, a concurrent child spawn can inherit an IPC socket before QuickJS marks it close-on-exec. Node closes inherited descriptors in its macOS posix_spawn path. See Platform.

  • In extensions, ctx.sessionManager reads return copies of entries, except getEntries() of the extension's own session. Upstream pi returns its own entry objects from all reads.

    • As in upstream pi, getEntries() of the extension's own session returns the same entry objects on each call, and a message entry holds the message object that the message_end handlers received. The context of turn_end and agent_before_settle holds these objects too.
    • The other reads, such as getEntry() and getBranch(), return new copies on each call. Changes to returned entries do not change the session.
  • The extension SDK still has gaps in child sessions, resource loading, and model runtimes.

    • A DefaultResourceLoader with extensions serves one child session for each reload(). Its factories run in the caller's extension host.
    • SettingsManager supports custom storage and queued writes, with limits on JSON values and live object references.
    • createMcpExtension starts the native MCP of pi-rust. It registers no /mcp command and does not take the callback options.

    See Extension module exports for the remaining differences.

  • pi.registerProvider(provider) with an upstream Provider object registers its models, auth, and stream. pi-rust reads the model list of the object at registration and after each refreshModels publish, not on every call, and calls only streamSimple. An object without getModels() registers as a provider config. See Extension module exports.

  • The providers that extensions get from @earendil-works/pi-ai/providers/all stream, classify, generate images, and resolve auth in Rust. Their API key login asks for one key, including for Amazon Bedrock, Google Vertex AI, and Cloudflare. See Extension module exports.

  • When you quit the interactive mode, pi waits at most 3 seconds for the running turn and the session_shutdown handlers, then exits. Upstream pi waits until they finish.

  • An abort finishes in less than a second. Upstream pi waits for every tool and handler.

    • The running tools and the extension handlers of the run's last events share 400 ms. Slow handlers keep running without blocking.
    • RPC abort answers within 1.5 s.
    • A prompt sent while a run aborts starts after the run ends. Upstream pi rejects it.
    • Extension prompts that were waiting to start do not run. Upstream pi starts them.

    See RPC mode.

  • In RPC mode, extension dialogs wait until the client sends a command other than a get_* query. get_commands answers while a session_start handler waits for a dialog. Upstream pi sends dialogs at once and reads no input until its session_start handlers finish. See RPC mode.

  • grep and find use the Rust ignore crate, so pi-rust does not download rg or fd.

  • The version check and pi update --self use the releases of this repository.

  • Newer models come from the catalog at pi-rust.com (PI_CATALOG_URL overrides it), which this repository generates from upstream's catalog generator at the upstream commit of the latest release. Upstream pi reads its catalog from pi.dev. See Model catalog.

  • /bug offers Upload Report, Open GitHub Issue, and Export as Zip. Upload Report sends the report privately to pi-rust.com (PI_BUG_REPORT_URL overrides it). Open GitHub Issue writes the zip archive and opens a public prefilled issue form on yannelli/pi-rust; you submit it and attach the zip yourself. Upstream pi uploads the report to its Radius gateway (radius.pi.dev).

  • Install telemetry is off unless you turn it on with the enableInstallTelemetry setting or PI_TELEMETRY=1. When it is on, pi-rust sends the anonymous install and update ping (version and User-Agent only) to pi-rust.com (PI_TELEMETRY_URL overrides it). Upstream pi turns install telemetry on by default and pings pi.dev. For the same reason, the extension SDK's SettingsManager.getEnableInstallTelemetry() returns false when the setting is not set. Upstream returns true.

  • /share can upload the session's HTML export to your pi-rust.com account. Set sessionShareDestination to "pi-rust"; if you are not signed in, the share first signs you in with a device code, and /logout signs you out. With sessionShareViewer set to "pi-rust", gist links open on pi-rust.com/session/ and "auto" uses the account first when you are signed in. By default both work as upstream pi: Radius or a gist, with gist links on pi.dev. PI_SHARE_URL replaces the pi-rust.com service origin. See Settings.

  • Shares on a pi-rust.com account can expire (sessionShareExpiry) and can be private to you (sessionShareVisibility). On pi-rust.com you can rename, download, and delete them, and see their view counts. Upstream pi has no such options.

  • The first interactive /share asks where it sends sessions: pi.dev, as upstream pi does (Radius, or gists viewed on pi.dev), or a pi-rust.com account. pi.dev is the default, and nothing asks at startup. Upstream pi has no such question. See Session sharing.

  • The providerIdentity setting chooses how model provider requests identify pi-rust. With "pi" (the default), the User-Agent is pi/<version> with the upstream pi version that pi-rust has parity with, and attribution headers name pi and pi.dev. With "pi-rust", the User-Agent is pi-rust/<pi-rust version>, and attribution headers name pi-rust and pi-rust.com. Attribution headers are sent only while install telemetry is on. Upstream pi always reports its own version. See Settings.

  • Word movement in Chinese, Japanese, Korean (CJK), and Thai text uses ICU4X dictionaries, so some word boundaries differ from Intl.Segmenter in Node.

  • pi-env looks for remote daemons in a pi-env-daemons folder next to the pi program. Each release has a pi-env-daemons-<tag>.tar.gz archive with the daemons for Linux, Android (Termux), macOS, and Windows on x86-64 and arm64. Extract this archive in the folder that contains pi.

  • pi experimental and its commands server, client, durable, and vacation need PI_EXPERIMENTAL=1, as in upstream pi. server and client use Unix sockets. On Windows, they show a message that they need Unix. Upstream pi also has no Windows transport.

  • When a local shell command exits, pi-durable stops waiting for output as upstream does: 100 ms after the exit, or 100 ms after the last chunk that follows the exit. Then:

    • It delivers the queued chunks and any chunk that the readers finish reading before they observe the stop signal.
    • On Unix, it also takes at most 64 KiB more per stream, if that data is readable without waiting.
    • On Windows, it starts no further read.

    See Platform.

  • When you clear the message queue, pi removes only your queued messages. Upstream pi drops queued extension messages with the queue.

    • Esc while the agent works, the dequeue key, and the RPC clear_queue command clear the queue.
    • Queued extension messages, such as subagent or background task results, stay queued.
    • When a run is aborted, queued extension messages join the conversation without starting a turn, so the agent sees them with your next prompt.
    • A message that an extension sends with triggerTurn while the run is ending continues that run. Upstream pi leaves that message queued until the next prompt.
  • In a linked git worktree, pi reads the project files that the worktree lacks from the main checkout. Upstream pi reads only the worktree.

    • Files: .pi/settings.json, .pi/mcp.json, .pi/SYSTEM.md, and .pi/APPEND_SYSTEM.md.
    • Folders: .pi/skills, .pi/prompts, .pi/extensions, and .pi/themes.
    • The worktree's own copy wins.
    • Project packages and relative entries resolve from the folder of the settings file that applies.
    • A trust decision for the main checkout covers its worktrees, unless the worktree folder has its own.

    See Settings.

  • Extension and login select menus show at most 10 options, with a (n/total) counter, so the selected option stays visible. Short terminals show fewer options. Upstream pi shows all options.

  • An MCP server name in mcp.json or pi.registerMcpServer can have any characters except control characters and spaces at either end, for example "Google Drive" from a Claude Code plugin. In tool names and the server namespace, each character other than an ASCII letter, an ASCII digit, or _ changes to one _ for each UTF-16 unit (😀 gives __), so Google Drive gives mcp__Google_Drive. pi rejects a server whose name gives the same namespace as an earlier server. /mcp login, /mcp logout, and /mcp reconnect use the rest of the line as the server name. Upstream pi accepts only letters, digits, _, and - in server names.

Additions

Addition Upstream pi Docs
The slash commands /diff, /init, /review, /context, /undo, and /retry Has none of them. Shows context use only in the footer. Interactive commands
Markdown export: /export notes.md and pi --export session.jsonl notes.md Exports only HTML and JSONL Export
Prompt history across sessions, with the Ctrl+R search and the promptHistory settings Keeps prompt history only while the process runs Prompt history
Alt+Down (Alt+S on Windows, app.message.sendNow) sends the queued follow-ups after the current turn. It moves them to the steering queue. Can only edit the queue or abort the turn Interactive commands
Ctrl+Enter (app.message.interrupt) stops the agent, also during a long tool call, and sends the queued messages and the editor text as one prompt Needs Esc, which moves the queue to the editor, and then Enter Interactive commands
Esc clears the input draft when the agent is idle. Undo restores the draft.
Submitted slash commands join prompts and shell commands in the Up and Down history
pi completion and pi doctor Has neither command CLI
pi sessions and pi stats Lists and deletes sessions only in its session picker (pi -r and /resume). Shows usage only for the current session (/session). Sessions
pi extensions lists, installs, removes, enables, and disables extensions through the package and resource settings Extensions
marketplace: package sources, pi extensions search, and pi extensions info, which use signed indexes and checksummed native binaries Has no Rust extension marketplace Marketplace
The /extensions browser searches, installs, updates, removes, enables, and disables extensions, then offers a reload Has no /extensions command /extensions
Run limits (--max-turns, --max-cost) and structured output (--output-schema, --output-retries) Run limits
pi --mode acp, with several sessions per connection and the client's stdio and HTTP MCP servers Needs the separate pi-acp adapter. pi-acp accepts no HTTP MCP servers, keeps one session per connection, rejects a prompt while pi runs on its own, and ends failed turns with end_turn. ACP mode
RPC and ACP modes run /usage, /context, /extensions, /fast, and /reload without a model call. RPC mode also runs /session, /changelog, /export, and /name. Sends these prompts to the model in RPC mode RPC mode
Account model lists for OpenAI Codex, Anthropic, GitHub Copilot, OpenAI, xAI, Google, and Cursor Limits only OpenRouter Account model lists
Claude Mythos 5.2 (claude-mythos-5-2) is in the anthropic catalog with the settings and prices of Claude Fable 5.2. pi removes it for an account whose model list does not name it. Has no Mythos 5.2 model Account model lists
/usage, pi usage, and the native extension method usage.get show the subscription limits of the Claude, ChatGPT (Codex), Cursor, SuperGrok (xai, with Grok Build), and Google Antigravity logins Has no usage report Subscription usage limits
Fast mode for models that have one: /fast, --fast, the fastMode setting, the ACP Fast mode option, and RPC set_fast_mode Has no fast mode Fast mode
The subscription providers cursor and google-antigravity Has none of them Subscription providers
ACP agents as providers: Kiro CLI (V3), Amp, and the agents of the ACP registry run over stdio with their own tools. /acp installs and manages them. Has no ACP client ACP agents
The global disabledProviders setting hides providers from model selection and keeps their credentials. The TUI /settings menu has a Disabled providers list. Disable providers
The global rememberLastModel setting (on by default) saves each model you switch to as the default Saves the default model only with the selector's set-as-default key Remember the last model
/settings items for the retry.* and retry.provider.* values Sets these values only in settings.json Retry settings
listOverflow and List overflow in /settings: truncate, wrap, or scroll long list rows; PI_REDUCED_MOTION=1 disables scrolling Truncates list rows List overflow
A terminal notification when a run takes 10 seconds or more Has this only as the example extension notify.ts Notifications
The status line and /statusline, as the marketplace:statusline extension Changes the footer only through extensions Status line
More harness themes Themes
Mermaid gantt charts and gitGraph diagrams render as terminal art. Git graphs are always drawn top to bottom (BT flips them). Shows these diagrams as source
The iTerm2 integration and /terminal-setup, as the marketplace:iterm2 extension iTerm2 integration
The extension UI call ctx.ui.writeTerminal(data, { tmuxPassthrough }) writes raw bytes to the terminal Has no such call
Footer data of ctx.ui.setFooter also has getSessionStats() (input, output, cacheRead, cacheWrite, cost, contextTokens, contextWindow, contextPercent) and getRunState() (idle, working, blocked, done, or error) Has neither
Native extensions: a package lists programs in package.json pi.native, and pi runs each one as an extension over a JSON-RPC protocol on stdio Loads only TypeScript and JavaScript extensions Native extension protocol
Extensions call tools of the session's MCP servers outside a tool call, for example from a hook: pi.callMcpTool(server, tool, args) and the native method mcp.callTool Has no MCP tool calls for extensions mcp.callTool
Extension events for hook runners: instructions_loaded, prompt_expansion, notification, tool_call_blocked, cwd_changed, and before_provider_auth. session_start handlers can call ctx.switchSession(). Has none of these events. Only command contexts have switchSession. pi-rust events
A session_before_compact result can set customInstructions for that compaction. The text replaces the instructions of the event, so a handler that keeps them adds its text to event.customInstructions. Reads only cancel and compaction Events
Native extensions draw the rows of tools without renderers, such as the built-in tools (toolRenderers). They can also animate a spinner inside drawn rows, refresh rows on a timer, read the TUI theme, and set the working indicator. Renderers
ctx.ui.setChatStyle (ui.setChatStyle) puts prefixes before user and assistant messages, collapses finished thinking, and rounds the editor. It also sets the editor border color and the prompt layout (frame, caret, or harbor). Chat style
An expanded tool row can show an extension's view of the result (pi.registerToolResultExpander, native toolResultExpander), for example the full text behind a shortened result Has no expander for other tools' results Renderers
Native extensions write their own top-level settings key in the global or a trusted project settings.json with settings.set. pi refuses its own setting keys. Extensions have no settings write settings.set
pi.registerProvider takes oauth: { builtin: "<provider id>", name? }: the provider logs in and refreshes with a login flow of pi, and stores the credential under its own id Reuses a flow only through an imported OAuth object provider.register
Extension widgets above and below the editor share a budget of a third of the terminal rows. Over the budget, each widget shows its first line. Caps only text widgets, at 10 lines each /widgets
MCP servers with "lifecycle": "lazy" in mcp.json connect on first use. A saved tool list makes their tools known before they connect. Connects every enabled server when the session starts MCP server lifecycle
MCP elicitation: servers can ask the user for form data or to open a URL. The extension events mcp_elicitation and mcp_elicitation_result can answer a request or change the answer of the user. Has no MCP elicitation MCP elicitation events
The extension event message_display replaces the text of an assistant message on the screen in the TUI. The session and the model context keep the original text. Has no display-only event. registerMarkdownTransformer changes the Markdown at each render. Events
Deferred context: the contextExposure setting and the skill frontmatter exposure: deferred keep skills and extension context entries, such as agent configs, out of the system prompt. tool_search finds them. Lists every skill in the system prompt. Only tools can be deferred. Deferred context
A choice of extension engine: the extensionRuntime setting, --extension-runtime, and PI_EXTENSION_RUNTIME (quickjs, node, or auto) Always runs extensions on Node Extension runtime

Bug fixes that are open upstream

The numbers are upstream issue numbers.

  • If you remove a tool from the first tool list, later Anthropic requests do not fail (upstream issue 11376).
  • On Bedrock, strict: "prefer" tools change to non-strict when the strict tools have more than 16 optional parameters (11416).
  • modelOverrides in models.json also apply to classifier and image models: name, input, inputLimits, and cost. For classifiers, contextWindow and compat also apply (11223).
  • The editor removes escape sequences from pasted text. If the end marker of a paste does not arrive, the paste ends after 10 seconds without input or at 16 MiB. Then Ctrl+C works again (11383).
  • MCP HTTP replies that are plain JSON obey maxMessageBytes (11335).
  • A code mode script can declare its own top-level tools or console (11226).
  • Branch summaries from /tree use the selected thinking level (11444). If you resume a session after /tree, pi restores the thinking level that you used last (11451).
  • pi removes mouse reports and other escape sequences with private parameters, such as ESC[<35;59;1M, from tool output (11377).
  • In pi -p, a prompt that an extension command sends with sendUserMessage runs before pi exits (11238).
  • An unpinned -e npm: package updates when npm has a newer version (11375).
  • pi.exec keeps a maximum of 16 MiB of output from a command. It stops the command when the output gets to that limit (11360).
  • pi-env watches a directory again after the kernel drops the watch and the directory keeps its inode (11342).

Crates

Crate Contents
pi-ai Message types (JSON-compatible with pi), streaming events, providers, OAuth, the model registry, and catalogs
pi-agent The agent loop, tool argument validation, and the stateful Agent
pi-tui The terminal UI library: differential rendering, editor, markdown, images, and components
pi-mcp The MCP client (stdio and HTTP, OAuth) and server manager
pi-codemode Codemode: a sandboxed JavaScript runtime in which the model writes scripts that call tools
pi-js Embedded QuickJS with Node-style modules and TypeScript, for pi extensions
pi-coding-agent Tools, sessions, compaction, resources, extensions, the interactive TUI, the print, JSON, RPC, and ACP modes, and the pi CLI
pi-chord Chord: an application composition runtime for services, replicated state, RPC, and plugins
pi-telemetry Vendor-neutral telemetry contracts and typed schema utilities
pi-schema TypeBox-compatible JSON Schema checks, defaults, and value cleanup, and the tool argument coercion and errors of upstream pi-schema, for pi-ai, pi-agent, and pi-chord
pi-embedded In-process pi sessions for native and Rust applications, with a C ABI (include/pi_embedded.h)
pi-protocol, pi-client, pi-server The CBOR wire protocol, its client, and its server over Unix sockets
pi-durable Pi Durable: durable sessions on memory, SQLite, or JSONL storage, the harness, and its coding tools
pi-env, pi-env-daemon Remote execution environments for Pi Durable over SSH, and the pi-env daemon that runs on the remote machine
pi-evals Behavioral evals for the coding agent: host evals and a documentation-lift comparison in Docker (not published)

Development

cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

The tests use the faux provider and local mock HTTP servers. They do not need API keys or network access.

Releases

Versions obey Semantic Versioning. The commit messages set the next version, as in Conventional Commits:

Commit Release
fix:, perf:, revert: patch
feat: minor (patch before 1.0)
feat!:, fix!:, or a BREAKING CHANGE: footer major (minor before 1.0)
docs:, chore:, ci:, test:, refactor:, style:, build: none

After continuous integration (CI) passes on main, the Release workflow runs cargo xtask plan. If a release is necessary, the workflow does these steps:

  1. It increases the workspace version.
  2. It adds the new section at the top of CHANGELOG.md.
  3. It commits chore(release): vX.Y.Z and adds the tag vX.Y.Z.
  4. It builds all targets.
  5. It publishes the GitHub release with checksums.

Other ways to start the workflow:

  • Push a vX.Y.Z tag that matches Cargo.toml. The workflow releases that version.
  • Push a vX.Y.Z-rc.1 tag. The workflow publishes a pre-release.
  • Run the workflow manually with dry_run. The workflow builds all targets and does not release.
  • Run the workflow manually with bump set to patch, minor, or major, and with dry_run off. The workflow releases when the commits do not need a release.
cargo xtask plan                 # next version and release decision
cargo xtask prepare 0.2.0        # set the version and update CHANGELOG.md
cargo xtask notes 0.2.0          # print release notes

License

MIT. pi-rust is based on pi by Mario Zechner. See LICENSE.

These parts come from other projects. Each release archive includes their license notices.

Part Source License file
ACP mode pi-acp by Sergii Kozak LICENSE-pi-acp
ACP wire types Agent Client Protocol schema 0.13.7 LICENSE-agent-client-protocol-schema
Terminal mode and size handling crossterm 0.29.0 LICENSE-crossterm
Some JavaScript modules of the extension runtime Node.js LICENSE-node
JSON syntax diagnostics in the extension runtime V8 LICENSE-v8
MCP OAuth code, ported from upstream pi MCP TypeScript SDK LICENSE-mcp-typescript-sdk
Warning colors of loadProjectContextFiles in the extension SDK chalk 6.0.0 by Sindre Sorhus LICENSE-chalk
Settings JSON error messages V8, BSD 3-Clause LICENSE-v8-settings
Edit diffs and the word highlights of the diff view jsdiff 8.0.4 by Kevin Decker, BSD 3-Clause LICENSE-jsdiff
File locks and exit cleanup for ProjectTrustStore proper-lockfile 4.1.2 and signal-exit 3.0.7 LICENSE-proper-lockfile, LICENSE-signal-exit

The release archives also include THIRD-PARTY-LICENSES.md with the licenses of the third-party Rust crates in the binaries. The Release workflow writes it with cargo-about from about.toml and about.hbs.

About

A drop-in Rust port of the pi agent harness, with extensions, built for 1:1 parity with pi.

Topics

Resources

Security policy

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages