Pi.CodingAgent 1.4.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Pi.CodingAgent --version 1.4.1
                    
NuGet\Install-Package Pi.CodingAgent -Version 1.4.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pi.CodingAgent" Version="1.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pi.CodingAgent" Version="1.4.1" />
                    
Directory.Packages.props
<PackageReference Include="Pi.CodingAgent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pi.CodingAgent --version 1.4.1
                    
#r "nuget: Pi.CodingAgent, 1.4.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Pi.CodingAgent@1.4.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pi.CodingAgent&version=1.4.1
                    
Install as a Cake Addin
#tool nuget:?package=Pi.CodingAgent&version=1.4.1
                    
Install as a Cake Tool

Pi.NET

English | 简体中文

NuGet CI License: MIT

Pi.NET is a .NET 10 port of Pi. Pi is a minimal, extensible Agent harness (TypeScript monorepo, ~171k lines); this project ports its core libraries one by one to net10.0, bringing the same capabilities to the .NET ecosystem.

Pi's philosophy is "make Pi fit your workflow, not the other way around": each library does one minimal-but-complete thing, and you compose the layers above it yourself. This project carries that philosophy over — rather than mechanically translating TS into C#, it rebuilds everything in idiomatic C# with semantic equivalence (discriminated unions → abstract records with pattern matching, JS Proxy → explicit verb APIs).

<p align="center"> <a href="https://github.com/xuzeyu91/pi.net/blob/main/docs/media/pi-net-promo.mp4"> <img src="https://raw.githubusercontent.com/xuzeyu91/pi.net/main/docs/media/pi-net-promo-poster.png" alt="Pi.NET product promo" width="820"> </a> <br> <sub>39-second promo (with voice-over) · click the cover to play (1080p / MP4 / 5.4 MB)</sub> </p>

What It Does

  • Unified multi-provider LLM API — 10 built-in API implementations (openai-completions / openai-responses / openai-codex-responses / azure-openai-responses / anthropic-messages / google-generative-ai / google-vertex / mistral-conversations / bedrock-converse-stream / pi-messages) plus a full catalog of 42 built-in providers; streaming events, tool calls, thinking budgets, deferred responses, image generation (images) and text classification (classify); OAuth login flows for 9 providers (PKCE / RFC 8628 device code / loopback callback / refresh orchestration).
  • Agent runtime — agent state machine with dual queues, the agent-loop main loop, sequential / parallel tool execution, abort / reset.
  • MCP client — JSON-RPC protocol layer + in-memory / stdio / streamable-http transports + a complete OAuth layer (metadata discovery, PKCE authorization code, dynamic registration, credential-invalidation retry).
  • Application orchestration runtime (Chord) — services and replicated state, delta engine, facets dependency graph with topological activation, external service source bindings.
  • TCP RPC channel — handshake validation, request dispatch, cancellation, push — prepared for remotely controlling the coding-agent.
  • Vendor-neutral telemetry — contracts + reference adapter + conformance test suite.

Packages

Package Description
Pi.Telemetry Vendor-neutral telemetry contracts, reference adapter and typed schemas, with a conformance test suite
Pi.Protocol CBOR wire protocol: framing / codec, definite-length strict subset + JS safe-integer boundaries, wire-compatible with the TS implementation
Pi.Ai Unified multi-provider LLM API: native API boilerplate + compat-provider registry; streaming, tool calls, thinking, images / classify, full OAuth login flows
Pi.Agent Agent runtime: state machine / dual queues, agent-loop main loop, tool execution
Pi.Mcp MCP client: JSON-RPC + three transports + the full OAuth layer
Pi.Chord Standalone application orchestration runtime: services, replicated state, RPC and plugins
Pi.Server / Pi.Client RPC transport: handshake / requests / cancellation / push, session routing, Unix domain sockets and local server discovery
Pi.Codemode Sandboxed JavaScript execution whose only capability is calling injected tools; @options source parsing, TypeScript declaration rendering and sandbox orchestration, with a default Jint VM engine behind the replaceable ICodemodeJsEngine seam
Pi.Tui Terminal UI framework: differential rendering + synchronized output, grapheme-level width measurement and wrapping, ANSI/OSC parsing with SGR tracking, Kitty keyboard protocol and key decoding, overlay stack, focus management, mouse event dispatch, colors (OKLCH/OKHSL) and keybinding registry, stdin escape-sequence buffering, inline terminal images (Kitty / iTerm2 protocols), stack/scroll layout engine, LaTeX math rendering, slash-command and file-path autocomplete (with fd fuzzy search), single-line input component (Emacs-style kill/yank, undo, bracketed paste), select-list component (filtering / scroll window / mouse / wheel), multi-line editor, markdown rendering, settings list, image component, and the alternate-screen renderer (full-screen mode: search / select-and-copy / scrollbar / Kitty image cache / overlay routing)
Pi.Durable Durable sessions, memory / SQLite / JSONL-file storage backends, task graph, recovery, and coding-agent harness
Pi.CodingAgent / Pi.Cli Interactive coding agent, tools, compiled .NET extensions, CLI, RPC, and experimental server/worker runtime
Pi.Vacation Separate research/planning host built on the coding-agent runtime
Pi.DurableHost Separate durable-session host (pi-durable) built on the coding-agent runtime, with the subagent tool and per-directory execution environments
Pi.Evals Native .NET host and documentation eval runner; paired documentation evals use Docker

The TypeScript monorepo remains the behavioral reference. Bundled upstream docs and examples are retained as TypeScript references; use the .NET extension guide for C# extension APIs. The authoritative phase ledger, validation evidence, and documented TypeScript/.NET differences are in migration-execution-status.md.

Getting Started

Install from NuGet

All 13 libraries ship to nuget.org under their project names, targeting net10.0:

dotnet add package Pi.Ai        # unified multi-provider LLM API
dotnet add package Pi.Agent     # agent loop
dotnet add package Pi.Mcp       # MCP client
dotnet add package Pi.CodingAgent   # the whole stack, including the CLI runtime

Usage docs and samples

  • docs/usage — how to consume each package from C#: which package for which job, minimal working code, credentials, and the traps worth knowing.
  • docs/usage/models-configuration.md — every models.json field (provider, model, overrides, input limits, compatibility) with its type, default and description, generated from the published JSON Schema.
  • samples — four runnable console projects, compiled by CI so they cannot silently rot:
dotnet run --project samples/Pi.Samples.FauxAgent      # full agent loop, no API key
dotnet run --project samples/Pi.Samples.RealModel -- anthropic   # streaming from a real model
dotnet run --project samples/Pi.Samples.CodingSession  # embedded coding agent (SDK)
dotnet run --project samples/Pi.Samples.McpClient      # standalone MCP client

Package contents, release process and rollback are documented in docs/publishing.md.

Build from source

Requires the .NET 10 SDK.

dotnet build Pi.slnx --no-restore
dotnet run --project src/Pi.Cli/Pi.Cli.csproj -- --help

Test projects use xUnit v3 with Microsoft.Testing.Platform. Run a test project directly:

dotnet run --project tests/Pi.Evals.Tests/Pi.Evals.Tests.csproj --no-restore

Migration Status

Implementation progress, phase-by-phase evidence, and known TypeScript/.NET differences are tracked in docs/migration-execution-status.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.4 0 10/27/2026
1.4.3 56 10/24/2026
1.4.2 61 10/23/2026
1.4.1 51 10/23/2026
1.4.0 50 10/23/2026
1.0.4 58 10/22/2026