当前位置: 首页 > news >正文

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

http://www.jsqmd.com/news/737894/

相关文章:

  • 从MagicPoint到SuperPoint:一个‘合成数据+自监督’如何教会AI看懂真实世界的角点?
  • AutoDL新手避坑指南:从租用服务器到跑通ChatGLM3的完整流程(含常见错误解决)
  • FreeACT:基于FreeRTOS的Actor模型框架,重塑嵌入式并发编程
  • 在离线或内网环境,如何手动/自动更新ClamAV病毒库(附脚本和国内镜像源)
  • BBDown完整教程:如何免费高效下载B站高清视频
  • 拒绝“张口就来”:推理技术如何让 AI 像人类一样拆解复杂难题?
  • 智能体状态管理:Agentic Vault 架构解析与实战集成指南
  • 如何通过Boss直聘批量投递工具实现日均50+精准岗位投递?求职效率提升3倍的秘密
  • 公差的具体标注方法(书本上/理论上标注方法)
  • KromHC技术:基于Kronecker积的深度学习参数优化方法
  • 葛卫东2026年重仓标的下半年投资机会深度分析
  • 基于vue的观影助手系统[vue]-计算机毕业设计源码+LW文档
  • 3分钟掌握TegraRcmGUI:Switch图形化注入终极指南
  • 保姆级教程:在RK3588平台上配置CIF链路MIPI断流自动复位(含四种监测模式详解)
  • WaveTools鸣潮工具箱:解锁游戏新体验的终极指南
  • MediaPipe TouchDesigner插件:3步快速入门GPU加速计算机视觉
  • Unbrowse:为AI智能体构建网站API接口,告别低效浏览器模拟
  • Ark-Pets:让明日方舟干员成为你的桌面智能伙伴
  • 小红书数据采集终极指南:Python实战与完整解决方案
  • FastAPI+Docker构建安全高性能机器学习API服务
  • NetBeans集成ChatGPT插件开发:AI助手无缝融入IDE的实践指南
  • 如何告别手动分层?Ai2Psd脚本让你的AI到PSD转换效率提升10倍
  • 美少女[特殊字符]万花镜部署
  • QueryExcel终极指南:10分钟搞定100个Excel文件的多文件批量查询神器
  • D3keyHelper终极指南:如何用智能宏系统解放你的暗黑3双手
  • 从SSH登录到屏幕输出:深入伪终端(PTY)如何驱动你的每一次命令行交互
  • 从数学公式到代码:手把手推导STM32F407舵机PWM角度控制算法(附两种角度表示法)
  • WSL2环境下实现OpenClaw AI助手跨系统桌面截图技能
  • Prompt组件以及使用技巧
  • 在旧手机(Android 5.0)上用Termux 0.118跑Alpine Linux,我踩过的那些坑都帮你填平了