This series organizes the installation, core concepts, customization, extensions, SDK/RPC and advanced capabilities of Pi (@earendil-works/pi-coding-agent), making it easy to read and compare official documents according to the route.

This series is a set of tutorials from shallow to deep Pi agent framework Chinese learning documents. The content is based on official documentation (https://pi.dev/docs/latest/ ), source code warehouse README / CHANGELOG / examples organized, code examples are taken directly from or compared with official documents and examples/ Directory.

Data verification time: 2026-10-19 (Beijing time).

1. What is Pi (one sentence version)

Pi is a project initiated by Mario Zechner (GitHub: badlogic) "A minimalist, scalable agent harness". The original words of the official README are:

"Pi is a minimal, extensible agent harness that you can make your own."

It runs in the terminal. Give it a target and a working directory, and it can read files, run commands, change files, and complete multi-step tasks; at the same time, it provides Extensions, skills, prompt templates, themes, Pi packages, and print/JSON/RPC mode and TypeScript SDK, allowing you to transform it into your own tool or embed it into your own application.

2. Version Notes (Important)

  • npm package

    Description
    @earendil-works/pi-coding-agent(command name pi)
  • Source code

  • Official website document

  • 0.99.0

    Description
    Released on 2026-09-29, introduced Codemode and MCP, system theme, Sign in with ChatGPT,virtual model, classifier model
  • 1.0.0

    Description
    Released on 2026-10-01: Default full-screen TUI, codemode prompt words are more streamlined, codemode image generation, etc.
  • Latest

    Description
    As of 2026-10-19, the latest version of npm is 1.3.0(2026-10-15)
ProjectDescription
npm package@earendil-works/pi-coding-agent(command name pi)
Source codehttps://github.com/badlogic/pi-mono (Now redirected to https://github.com/earendil-works/pi )
Official website documenthttps://pi.dev/docs/latest/
0.99.0Released on 2026-09-29, introduced Codemode and MCP, system theme, Sign in with ChatGPT,virtual model, classifier model
1.0.0Released on 2026-10-01: Default full-screen TUI, codemode prompt words are more streamlined, codemode image generation, etc.
LatestAs of 2026-10-19, the latest version of npm is 1.3.0(2026-10-15)

The "about 0.99" you mentioned is exactly the first version of codemode/MCP. Since it has been iterated to 1.3.0 in the next two weeks, this series starts with The latest documentation (docs/latest, corresponding to 1.3.x) shall prevail; any differences from 0.99 will be specially marked (for example, starting from 1.0, the default is full screen, starting from 1.2 before_agent_start semantic changes). Use after installation pi --version and pi --help Your local version shall prevail.

3. Quick overview of Monorepo structure

The repository is a monorepo, with the core package (extracted from the root README):

  • @earendil-works/pi-ai

    function
    Unified multi-provider LLM API (OpenAI, Anthropic, Google, etc.)
  • @earendil-works/pi-agent-core

    function
    Agent runtime with tool invocation and state management
  • @earendil-works/pi-coding-agent

    function
    Interactive coding agent CLI (i.e. pi), which is also the entrance to the SDK
  • @earendil-works/pi-tui

    function
    Differential rendering terminal UI library
  • @earendil-works/pi-durable

    function
    Persistence session/task/document runtime
  • @earendil-works/chord、pi-telemetry

    function
    Plug-in hosting runtime, telemetry contract
packagefunction
@earendil-works/pi-aiUnified multi-provider LLM API (OpenAI, Anthropic, Google, etc.)
@earendil-works/pi-agent-coreAgent runtime with tool invocation and state management
@earendil-works/pi-coding-agentInteractive coding agent CLI (i.e. pi), which is also the entrance to the SDK
@earendil-works/pi-tuiDifferential rendering terminal UI library
@earendil-works/pi-durablePersistence session/task/document runtime
@earendil-works/chord、pi-telemetryPlug-in hosting runtime, telemetry contract

In addition, there are also packages/mcp、packages/codemode Waiting for support package.

4. Learning Roadmap

Getting Started ──► Core Concepts ──► Proficient Use ──► Customization ──► Extension Development ──► Integration ──► Advanced ──► Practical Combat

01 02 03 04 05 06 07 08

  • 00

    Documentation
    Learning route and catalog (this article)
    difficulty
    ★
    you will learn
    Global understanding, version, reading order
  • 01

    Documentation
    What is Pi, installation and getting started
    difficulty
    ★
    you will learn
    installation,/login, first task, basic operations
  • 02

    Documentation
    Core concepts: agent loop, session tree, branching and compression
    difficulty
    ★★
    you will learn
    Understand how Pi works internally
  • 03

    Documentation
    Usage Tips: Four Modes, Models and Provider Configuration
    difficulty
    ★★
    you will learn
    print/JSON/RPC、models.json, tool selection, safety
  • 04

    Documentation
    Customization: context files, prompt templates, skills, themes, settings
    difficulty
    ★★★
    you will learn
    Transform Pi without writing code
  • 05

    Documentation
    Extension development: TypeScript registration tool/command/event
    difficulty
    ★★★★
    you will learn
    Write your own extension
  • 06

    Documentation
    SDK and RPC integration
    difficulty
    ★★★★
    you will learn
    Embed Pi into your own applications or other languages
  • 07

    Documentation
    Advanced: MCP, Codemode, virtual model, custom Provider, Pi package distribution
    difficulty
    ★★★★★
    you will learn
    0.99+ New Features and Distribution
  • 08

    Documentation
    Practical project exercises and reference materials
    difficulty
    ★★★★★
    you will learn
    Comprehensive project + data index
No.Documentationdifficultyyou will learn
00Learning route and catalog (this article)★Global understanding, version, reading order
01What is Pi, installation and getting started★installation,/login, first task, basic operations
02Core concepts: agent loop, session tree, branching and compression★★Understand how Pi works internally
03Usage Tips: Four Modes, Models and Provider Configuration★★print/JSON/RPC、models.json, tool selection, safety
04Customization: context files, prompt templates, skills, themes, settings★★★Transform Pi without writing code
05Extension development: TypeScript registration tool/command/event★★★★Write your own extension
06SDK and RPC integration★★★★Embed Pi into your own applications or other languages
07Advanced: MCP, Codemode, virtual model, custom Provider, Pi package distribution★★★★★0.99+ New Features and Distribution
08Practical project exercises and reference materials★★★★★Comprehensive project + data index

5. Suggested learning methods

  1. Use it first: 01, 02, 03 It is recommended to operate on the terminal while reading, and complete the task of "Let Pi change a small project" at least once.
  2. Customized according to the principle of "minimum mechanism": The official Quickstart gives the order of selecting customization methods - it can be used AGENTS.md There is no need for templates. If you can use templates, you don’t need skills. If you can use skills, you don’t need extensions (see 04 Customized)。
  3. Subject to examples: Officially stated clearly "The checked extension examples are the implementation reference". When writing extensions/SDK, open the warehouse first packages/coding-agent/examples/ Contrast.
  4. Subject to type declaration: Check the exact signature node_modules/@earendil-works/pi-coding-agent/dist/ down .d.ts, or source code src/core/extensions/types.ts。

6. Official customization method selection table (from Quickstart)

  • Provide persistent directives for a directory

    preferred mechanism
    AGENTS.md(context file)
  • in / Menu reuses a prompt word

    preferred mechanism
    Prompt template
  • Add task-specific instructions and supporting files

    preferred mechanism
    Skill
  • Add executable tools, commands, or event handlers

    preferred mechanism
    Extension
  • Build custom terminal components

    preferred mechanism
    Terminal UI
  • Accessing an unsupported model service

    preferred mechanism
    Custom Provider
  • Install or distribute multiple resources

    preferred mechanism
    Pi package (Pi package)
demandpreferred mechanism
Provide persistent directives for a directoryAGENTS.md(context file)
in / Menu reuses a prompt wordPrompt template
Add task-specific instructions and supporting filesSkill
Add executable tools, commands, or event handlersExtension
Build custom terminal componentsTerminal UI
Accessing an unsupported model serviceCustom Provider
Install or distribute multiple resourcesPi package (Pi package)

7. Small exercises

  1. open https://pi.dev/docs/latest/ , browse the left navigation and find the three pages "How Pi Works", "SDK" and "Codemode".
  2. run npm view @earendil-works/pi-coding-agent version, confirm the current latest version number.
  3. Open at GitHub packages/coding-agent/examples/extensions/README.md, pick 3 extension examples that interest you the most and write them down, and come back after learning 05 to implement or transform them.

8. Official sources