news 2026/5/2 11:52:25

Pi 是一个极简终端编码工具 Pi is a minimal terminal coding harness

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
Pi 是一个极简终端编码工具 Pi is a minimal terminal coding harness

Pi is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and pi packages.

Pi 是一个极简终端编码工具。其核心设计保持精简,同时支持通过 TypeScript 扩展、技能模块、提示模板、主题样式以及 pi 工具包进行功能拓展。

Quick start

Install pi with npm:

npm install -g @mariozechner/pi-coding-agent

Then run it in a project directory:

pi

Authenticate with/loginfor subscription providers, or set an API key such asANTHROPIC_API_KEYbefore starting pi.

For the full first-run flow, see Quickstart.

Start here

  • Quickstart - install, authenticate, and run a first session.
  • Using Pi - interactive mode, slash commands, context files, and CLI reference.
  • Providers - subscription and API-key setup for built-in providers.
  • Settings - global and project settings.
  • Keybindings - default shortcuts and custom keybindings.
  • Sessions - session management, branching, and tree navigation.
  • Compaction - context compaction and branch summarization.

从这里开始
快速入门 - 安装、认证并运行第一个会话。
使用 Pi - 交互模式、斜杠命令、上下文文件和 CLI 参考。
提供者 - 内置提供者的订阅和 API 密钥设置。
设置 - 全局和项目设置。
快捷键 - 默认快捷键和自定义快捷键。
会话 - 会话管理、分支和树形导航。
压缩 - 上下文压缩和分支摘要。

Customization

  • Extensions - TypeScript modules for tools, commands, events, and custom UI.
  • Skills - Agent Skills for reusable on-demand capabilities.
  • Prompt templates - reusable prompts that expand from slash commands.
  • Themes - built-in and custom terminal themes.
  • Pi packages - bundle and share extensions, skills, prompts, and themes.
  • Custom models - add model entries for supported provider APIs.
  • Custom providers - implement custom APIs and OAuth flows.

自定义
扩展功能 - 用于工具、命令、事件和自定义用户界面的 TypeScript 模块。
技能 - 可复用的按需能力的代理技能。
提示模板 - 可通过斜杠命令扩展的可复用提示。
主题 - 内置和自定义的终端主题。
Pi 包 - 打包并分享扩展、技能、提示和主题。
自定义模型 - 为支持的提供商 API 添加模型条目。
自定义提供商 - 实现自定义 API 和 OAuth 流程。

Programmatic usage

  • SDK - embed pi in Node.js applications.
  • RPC mode - integrate over stdin/stdout JSONL.
  • JSON event stream mode - print mode with structured events.
  • TUI components - build custom terminal UI for extensions.

Reference

  • Session format - JSONL session file format, entry types, and SessionManager API.

Why Pi?

Pi is a minimal terminal coding harness. Adapt Pi to your workflows, not the other way around. Customize Pi with extensions, skills, prompt templates, and themes. Bundle them as Pi packages and share via npm or git.

Pi ships with powerful defaults but skips features like sub-agents and plan mode. Ask Pi to build what you want, or install a package that does it your way.

Four modes: interactive, print/JSON, RPC, and SDK. See OpenClaw for a real-world integration.

Change the harness, not your workflow

Pi isn't a sealed product. If you need a command, tool, provider, workflow, or UI tweak, just ask Pi to build it. It will customize itself on the fly.

Have Pi manipulate itself in place, hit/reload, and keep going. If you think others will find what you built useful, share it!

15+ providers, hundreds of models

Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi For Coding, MiniMax, OpenRouter, Ollama, and more. Authenticate via API keys or OAuth.

Switch models mid-session with/modelorCtrl+L. Cycle through your favorites withCtrl+P.

Add custom providers and models via models.json or extensions.

Tree-structured, shareable history

Sessions are stored as trees. Use/treeto navigate to any previous point and continue from there. All branches live in a single file. Filter by message type, label entries as bookmarks.

Export to HTML with/export, or upload to a GitHub gist with/shareand get a shareable URL that renders it. Example session.

Context engineering

Pi's minimal system prompt and extensibility let you do actual context engineering. Control what goes into the context window and how it's managed.

AGENTS.md:Project instructions loaded at startup from~/.pi/agent/, parent directories, and the current directory.

SYSTEM.md:Replace or append to the default system prompt per-project.

Compaction:Auto-summarizes older messages when approaching the context limit. Fully customizable via extensions: implement topic-based compaction, code-aware summaries, or use different summarization models.

Skills:Capability packages with instructions and tools, loaded on-demand. Progressive disclosure without busting the prompt cache. See skills.

Prompt templates:Reusable prompts as Markdown files. Type/nameto expand. See prompt templates.

Dynamic context:Extensions can inject messages before each turn, filter the message history, implement RAG, or build long-term memory.

Steer or follow up

Submit messages while the agent works.Entersends a steering message (delivered after current tool, interrupts remaining tools).Alt+Entersends a follow-up (waits until the agent finishes).

Four modes

Interactive:The full TUI experience.

Print/JSON:pi -p "query"for scripts,--mode jsonfor event streams.

RPC:JSON protocol over stdin/stdout for non-Node integrations. See docs/rpc.md.

SDK:Embed Pi in your apps. See OpenClaw for a real-world example.

Primitives, not features

Features that other agents bake in, you can build yourself. Extensions are TypeScript modules with access to tools, commands, keyboard shortcuts, events, and the full TUI.

Sub-agents, plan mode, permission gates, path protection, SSH execution, sandboxing, MCP integration, custom editors, status bars, overlays.

Don't want to build it? Ask Pi to build it for you. Or install a package that does it your way. See the 50+ examples.

Bundle extensions, skills, prompts, and themes as packages. Install from npm or git:

$ pi install npm:@foo/pi-tools
$ pi install git:github.com/badlogic/pi-doom

Browse packages

and it can play doom

What we didn't build

Pi is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with extensions, skills, or installed from third-party Pi packages. This keeps the core minimal while letting you shape Pi to fit how you work.

No MCP.Build CLI tools with READMEs (see Skills), or build an extension that adds MCP support. Why?

No sub-agents.There's many ways to do this. Spawn Pi instances via tmux, or build your own with extensions, or install a package that does it your way.

No permission popups.Run in a container, or build your own confirmation flow with extensions inline with your environment and security requirements.

No plan mode.Write plans to files, or build it with extensions, or install a package.

No built-in to-dos.Use a TODO.md file, or build your own with extensions.

No background bash.Use tmux. Full observability, direct interaction.

Read the blog post for the full rationale.

https://github.com/badlogic/pi-mono/issues

--

https://pi.dev/docs/latest

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/5/2 11:51:30

ZPE Nodegrid Mini SR工业云网关:边缘计算与物联网的完美融合

1. ZPE Nodegrid Mini SR工业级云网关深度解析这款仅有手掌大小的设备,却能在-20℃至70℃的极端环境下稳定运行。去年我在某化工厂部署时,现场温度高达65℃,普通网关早已死机,而Nodegrid Mini SR仍能持续传输关键传感器数据。这种…

作者头像 李华
网站建设 2026/5/2 11:49:27

利用 Taotoken 模型广场为你的 AI 应用选择性价比最优模型

利用 Taotoken 模型广场为你的 AI 应用选择性价比最优模型 1. 模型选型的核心考量因素 在实际开发中,模型选型需要平衡性能需求与成本约束。Taotoken 模型广场提供了多厂商模型的统一视图,开发者可以从三个维度进行初步筛选: 技术指标方面…

作者头像 李华
网站建设 2026/5/2 11:49:25

深度解析百度网盘解析工具:3步实现高速下载自动化

深度解析百度网盘解析工具:3步实现高速下载自动化 【免费下载链接】baidu-wangpan-parse 获取百度网盘分享文件的下载地址 项目地址: https://gitcode.com/gh_mirrors/ba/baidu-wangpan-parse 百度网盘解析工具是一款能够突破百度网盘下载限速的专业工具&…

作者头像 李华
网站建设 2026/5/2 11:47:31

基于vue的3D打印机销售管理系统[vue]-计算机毕业设计源码+LW文档

摘要:随着3D打印技术的飞速发展,3D打印机销售业务日益增长,传统销售管理方式面临效率低下、信息不及时等挑战。本文介绍了一个基于Vue框架开发的3D打印机销售管理系统,阐述了系统的开发背景、相关技术、需求分析、设计过程以及实现…

作者头像 李华
网站建设 2026/5/2 11:47:28

QueryExcel终极指南:10分钟搞定100个Excel文件的多文件批量查询神器

QueryExcel终极指南:10分钟搞定100个Excel文件的多文件批量查询神器 【免费下载链接】QueryExcel 多Excel文件内容查询工具。 项目地址: https://gitcode.com/gh_mirrors/qu/QueryExcel 你是否曾经历过这样的痛苦场景?面对堆积如山的Excel文件&am…

作者头像 李华