@erasin/pi-plan-mode

Plan mode extension for pi - read-only exploration with plan creation and progress tracking

Packages

Package details

extension

Install @erasin/pi-plan-mode from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@erasin/pi-plan-mode
Package
@erasin/pi-plan-mode
Version
1.0.0
Published
May 31, 2026
Downloads
not available
Author
erasin
License
MIT
Types
extension
Size
23.9 KB
Dependencies
0 dependencies · 4 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

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

README

pi-plan-mode

Plan mode 扩展 — 为 pi 提供只读探索模式,支持创建计划、跟踪执行进度。

功能

  • 只读探索模式:限制工具为只读命令(read、grep、find、ls 等),禁止编辑、写入等操作
  • 安全 Bash:仅允许白名单中的只读命令,拦截 rm、mv、git push、npm install 等破坏性操作
  • 计划创建:AI 代理自动从回复中提取 "Plan:" 编号步骤
  • 进度追踪:执行阶段使用 [DONE:n] 标记完成步骤,UI 显示进度(☐ / ☑
  • 执行模式:用户确认后切换回完整工具权限,逐步骤执行
  • 快捷键Ctrl+Alt+P 切换 plan 模式;空编辑器中 Tab 快速切换
  • 持久化状态:会话重启后恢复 plan 状态和已完成步骤

安装

# 从 npm 安装
pi install npm:@erasin/pi-plan-mode

# 从 git 安装
pi install git:github.com/erasin/pi-plan-mode

# 从本地路径安装
pi install ~/Projects/pi-plan-mode

启动时自动启用 plan 模式:

pi --plan

用法

  1. Ctrl+Alt+P 进入 plan 模式(或使用命令 /plan
  2. AI 代理将仅使用只读工具探索代码库
  3. 代理回复中应包含 "Plan:" 标题和编号步骤
  4. 扩展提供操作选择:执行计划 / 保持 plan 模式 / 细化计划
  5. 选择"执行计划"后,切换为完整工具权限,逐步执行
  6. 执行中在回复里添加 [DONE:1][DONE:2] 等标记完成步骤

命令

命令 说明
/plan 切换 plan 模式
/todos 显示当前计划进度

快捷键

快捷键 说明
Ctrl+Alt+P 切换 plan 模式
Tab 编辑器为空时切换 plan 模式

开发

# 构建(tsc 类型检查)
npm run build

# 类型检查
npm run typecheck

许可证

MIT