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 startInstall pi with npm:npm install -g mariozechner/pi-coding-agentThen run it in a project directory:piAuthenticate with/loginfor subscription providers, or set an API key such asANTHROPIC_API_KEYbefore starting pi.For the full first-run flow, see Quickstart.Start hereQuickstart - 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 密钥设置。设置 - 全局和项目设置。快捷键 - 默认快捷键和自定义快捷键。会话 - 会话管理、分支和树形导航。压缩 - 上下文压缩和分支摘要。CustomizationExtensions - 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 usageSDK - 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.ReferenceSession 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 workflowPi isnt 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 modelsAnthropic, 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/modelorCtrlL. Cycle through your favorites withCtrlP.Add custom providers and models via models.json or extensions.Tree-structured, shareable historySessions 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 engineeringPis minimal system prompt and extensibility let you do actual context engineering. Control what goes into the context window and how its 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 upSubmit messages while the agent works.Entersends a steering message (delivered after current tool, interrupts remaining tools).AltEntersends a follow-up (waits until the agent finishes).Four modesInteractive:The full TUI experience.Print/JSON:pi -p queryfor 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 featuresFeatures 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.Dont 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-doomBrowse packagesand it can play doomWhat we didnt buildPi is aggressively extensible so it doesnt 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.Theres 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.coloradmin.cn/o/2574871.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!