pi-order-extension

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

pi-order-extension

Reusable prompt templates for Pi, available through one simple /order command.

npm version Publish workflow License Node.js Pi package

pi-order-extension is a Pi extension for creating, editing, reusing, and organizing local prompt templates. It is useful for prompts you type repeatedly, such as code review instructions, weekly report templates, debugging checklists, release notes, or project-specific workflows.

Highlights

  • 🧩 One command: manage everything through /order.
  • Fast reuse: insert a saved template into the current Pi input box without auto-sending.
  • 📝 Descriptions: add short descriptions so autocomplete results are easier to identify.
  • 🔎 Autocomplete: complete subcommands and existing template names.
  • 🧹 Clear body in edit flow: clear template content without deleting the template name or description.
  • 💾 Local-first: templates are stored locally under ~/.pi/orders.

Installation

Install from npm:

pi install npm:pi-order-extension

Or install a fixed GitHub tag:

pi install git:git@github.com:LinMingjing007/pi-order.git@v0.1.1

Reload Pi after installing:

/reload

Quick start

Create a template:

/order create code-review

Send a template into the current input box:

/order send code-review

Edit a template, including description and body:

/order edit code-review

During edit, choose either:

编辑正文
清空正文

清空正文 clears only the template body. The template name and description are preserved.

Command reference

Command Description
/order create <name> Create a new template, then edit its description and body.
/order edit <name> Edit an existing template. You can edit body or clear body from the edit flow.
/order edit <name> --clear Clear the template body directly. Kept for power users and autocomplete workflows.
/order send <name> Insert the template body into the current Pi input box without sending.
/order remove <name> Delete a template and its description.
/order list List existing templates.

Template names may contain letters, numbers, _, and -.

Storage

Templates are stored locally:

~/.pi/orders/<name>.md
~/.pi/orders/descriptions.json

This extension does not upload template content anywhere.

Development

git clone https://github.com/LinMingjing007/pi-order.git
cd pi-order
npm install
npm test

Useful scripts:

npm run build
npm test
npm pack --dry-run

Release

This repository publishes to npm through GitHub Actions.

  1. Update code and tests.

  2. Bump version:

    npm version patch --no-git-tag-version
    
  3. Commit and tag:

    git add .
    git commit -m "Release vX.Y.Z"
    git tag -a vX.Y.Z -m "vX.Y.Z"
    git push origin main
    git push origin vX.Y.Z
    
  4. GitHub Actions runs tests and publishes to npm automatically.

License

MIT © LinMingjing007