← Catalog

pi-omp-tools

oh-my-pi style tool rows for pi: framed cards with the call in the top border, live spinner and timer, and the run's facts in the bottom border

Extension

Install

Install with PiG

pig install npm:pi-omp-tools

Install with Pi

pi install npm:pi-omp-tools
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

pi-omp-tools

oh-my-pi style tool rows for pi.

Each tool call becomes one card. The call sits in the top border, the result in the body, and the run's facts (wall time, timeout, exit code, totals) in the bottom border. The border color follows the call: accent while it runs, dim once it succeeds, yellow for a warning, red for an error. A running call shows a spinner and a live timer.

 ╭─── ✔ Bash ─────────────────────────────────────────────────────────╮
 │ $ npm test                                                         │
 ├─── Output ─────────────────────────────────────────────────────────┤
 │ Test Files  9 passed (9)                                           │
 │      Tests  108 passed (108)                                       │
 ╰─── Wall: 1.84s · Timeout: 300s ────────────────────────────────────╯
 ╭─── ✔ Edit: src/config.ts ⟨+2/-1⟩ ──────────────────────────────────╮
 │  11 export const name = "pi";                                      │
 │ -12 export const retries = 3;                                      │
 │ +12 export const retries = 5;                                      │
 │ +13 export const backoffMs = 200;                                  │
 ╰────────────────────────────────────────────────────────────────────╯
 ✔ Grep: retries in src 2 matches · 2 files
 ├─ src/config.ts
 │  *12│ export const retries = 5;
 ├─ src/client.ts
 │  *40│ for (let i = 0; i < retries; i++) {

What it draws

ToolCard
bashThe command, its output following the tail (10 rows collapsed), and Wall · Timeout · Exit in the bottom border.
readOne line while it runs; then the lines numbered from the offset, with pi's "Use offset=…" notice in the bottom border.
editA diff preview built from the arguments while they stream, then pi's diff with ⟨+added/-removed⟩ in the header.
writeThe file, its line count, and the start of its content, highlighted.
grep, find, lsOne header line with counts, and the results as a tree; grep groups matches by file.
codemodeThe script's title in the top border and one row per nested call (see below).
MCP toolsA generic card in place of the one line pi's MCP support draws: arguments inline, the result as a JSON tree or a four-line preview.
Anything elseTools without a renderer get the same generic card. Tools whose extension draws them keep that drawing.

ctrl+o (or whatever app.tools.expand is bound to) expands every card: full output, the arguments as a tree, the whole diff. Clicking a card toggles it too.

All colors come from the active theme (accent, dim, muted, success, warning, error, toolTitle, toolOutput, toolDiff* and the tool*Bg backgrounds), so the cards follow any pi theme. Cards respect the outputPad setting.

Codemode

This package replaces pi-codemode-render. Remove it before installing this one (pi remove npm:pi-codemode-render): with both installed, whichever loads first draws codemode rows, and both record file changes.

 ╭─── ⚠ Codemode: Raise the retry limits ─────────────────────────────────────────╮
 │ ├─ ✔ read src/config.ts                                                    4ms │
 │ ├─ ✎ src/config.ts +2 −1                                                   3ms │
 │ │  -12 export const retries = 3;                                               │
 │ │  +12 export const retries = 5;                                               │
 │ │  +13 export const backoffMs = 200;                                           │
 │ ├─ ✔ $ npm test in packages/core                                          2.1s │
 │ └─ ✘ read missing.txt                                                      2ms │
 │    ENOENT: no such file or directory                                           │
 ├─── Output ─────────────────────────────────────────────────────────────────────┤
 │ Tests  47 passed (47)                                                          │
 ╰─── 4 actions · 1 file +2 −1 · 1 failed · 2.21s ────────────────────────────────╯
  • While the model writes the script, the card follows its last lines.
  • Each nested call is a row with its status, time and cost; a running one spins and shows the last line of its output.
  • Consecutive edits to one file fold into one row with their diff. Edits and failures stay in view when older actions are hidden.
  • The bottom border totals actions, changed files and lines, failures, time, cost and images. A finished script with a failed action gets a warning border.
  • Expanded, the card shows the highlighted script, every action, full diffs and the full output.
  • The extension asks the model to start every script with a // title comment, which becomes the card's title.

Diffs of nested edits are kept in the session as codemode-render-changes entries, the same type pi-codemode-render wrote, so sessions recorded with it keep their diffs.

Install

pi install npm:pi-omp-tools

To install a local checkout instead, run pi install /path/to/pi-omp-tools. Built and tested against pi 1.5.2.

Development

npm install --ignore-scripts
npm test
npm run typecheck

The frame, status line, output preview and JSON tree are adapted from oh-my-pi (MIT); see LICENSE.