PI agent

Published on
Last updated on
Technical
AI

Pi Agent

  • install the main app

    curl -fsSL https://pi.dev/install.sh | sh
  • install packages

    Terminal window
    pi install <xxx>
  • config default providers ~/.pi/agent/auth.json by folloing https://pi.dev/docs/latest/providers

    {
    "deepseek": { "type": "api_key", "key": "YOUR_API_KEY" }
    }
  • config custom providers ~/.pi/agent/models.json by following https://pi.dev/models

    {
    "providers": {
    "hai": {
    "baseUrl": "http://localhost:6655/anthropic",
    "api": "anthropic-messages",
    "apiKey": "YOUR_API_KEY",
    "models": [
    {
    "id": "anthropic--claude-opus-latest",
    "name":"anthropic--claude-opus-latest",
    "reasoning": true,
    "compat": {
    "forceAdaptiveThinking": true
    }
    },
    {
    "id": "anthropic--claude-sonnet-latest",
    "name":"anthropic--claude-sonnet-latest",
    "reasoning": true,
    "compat": {
    "forceAdaptiveThinking": true
    }
    }
    ]
    }
    }

扩展

功能扩展类

  • npm:pi-mcp-adapter:使用 Lazy load 的方式加载 mcp 服务器,我基本全局不会开启 MCP,在某些特定项目上会用。

  • npm:pi-web-access:支持多个 Provider 的搜索聚合,效果很佳(社区有更多别的选择,可以自己找更好的实现)

  • npm:pi-subagents / npm:pi-intercom :这个更稳定一些。

  • npm:pi-codex-goal:实现 /goal 功能

  • npm:pi-browser-cdp-extension: use CDP to control brower

  • npm:pi-powerline-footer: Powerline 风格的状态栏扩展

  • npm:@narumitw/pi-statusline: Rich Statusline for the Pi Coding Agent

  • npm:@rezamonangg/pi-worktree

  • npm:pi-lsp

  • npm:pi-image-paste

  • npm:pi-autoresearch:增加 autoresearch 功能,为 Pi 提供运行自主优化循环所需的工具和工作流:尝试一个想法、进行基准测试、保留改进、回滚退化、重复进行

  • npm:@ogulcancelik/pi-herdr:控制 herdr,比skills+CLI 控制更稳

  • npm:pi-chrome: 让 Pi 使用你已登录的 Chrome 配置文件

功能优化和管理类

  • npm:pi-cache-graph:显示缓存命中率的变化,可用来 Debug 影响上下文的扩展
  • npm:pi-command-history:使用 Ctrl + Up 来找相同目录的历史 command。(Pi 默认 Up 只能着同 session 的,很怪)
  • npm:pi-discord-remote:这个插件很有意思,开启后它会为每个 session 都配置单独的会话,结束对话后自动销毁。这样在 discord 那边用起来就很简单,尤其是自动销毁。
  • npm:@vanillagreen/pi-extension-manager:可以不用卸载扩展,而是禁用扩展。这玩意很卡,可以不用。
  • npm:@vanillagreen/pi-session-manager:可以更好的在历史 session 中检索、跳转什么的,用处不大。
  • https://github.com/monotykamary/pi-tps:显示模型输出速度等信息
  • npm:pi-cost:打开webui 显示tokens 使用情况
  • npm:pi-inspect:打开webui 显示模型完整的上下文用于调试

Agent 行为优化类:会修改 Pi Agent 自身行为,影响较大

  • npm:pi-rtk-optimizer:使用 rtk 大幅压缩 Bash Tool 的输出
  • npm:@ff-labs/pi-fff:优化文件、内容的搜索功能,效果很好,推荐。之前有Bug老crash,最新版本修了一些。
  • npm:pi-loadout:可以关闭特定的tools和skills
  • npm:pi-dynamic-workflows:增加类似于 Claude Dynamic Workflow 的功能。
  • https://github.com/AgwaB/pi-workflow: pi-workflow lets Pi run named, repeatable multi-step workflows: research, code review, spec conformance checks, impact review, and project-specific team routines.
Back to Blog