@lhlyu/pi-kit

个人专属的 Pi Coding Agent 工具箱

Packages

Package details

extension

Install @lhlyu/pi-kit from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@lhlyu/pi-kit
Package
@lhlyu/pi-kit
Version
0.1.7
Published
Oct 20, 2026
Downloads
873/mo · 873/wk
Author
lhlyu
License
MIT
Types
extension
Size
38.7 KB
Dependencies
2 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@lhlyu/pi-kit

个人专属的 Pi Coding Agent 工具箱。

功能

  • 模型自动发现:支持多个 Provider,无需手动维护模型列表。
  • 终端状态栏:展示输出速度(TPS)、首 token 耗时(TTFT)和本轮耗时(TS)。TPS 优先使用服务端用量,无流式用量时显示实时估算;调用结束后显示平均速度,缺失最终用量时保留本轮上次平均值。
⚡️ TPS: 50.0 tok/s 🚀 TTFT: 1.23s ⌛️ TS: 2m35s

安装

需要 Node.js ≥ 22.19.0、Pi Coding Agent ≥ 1.3.0。

pi install npm:@lhlyu/pi-kit

使用

状态栏在交互式终端中自动启用,无需配置。

如需模型自动发现,在 Pi 用户目录的 models.json 中添加 Provider:

{
    "providers": {
        "my-relay": {
            "baseUrl": "https://relay.example.com/v1",
            "apiKey": "$RELAY_API_KEY",
            "api": "openai-completions",
            "discoverModels": true
        }
    }
}

设置 RELAY_API_KEY 环境变量,重启 Pi 或执行 /reload,再通过 /model 选择模型。

更多配置见 模型发现配置。