@jrimmer/pi-meat

meat.dev integration for pi — installs the meat CLI into your PATH, pre-processes every new git commit in the background, and adds a meat Diffs view toggle (alt+m)

Packages

Package details

extension

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

$ pi install npm:@jrimmer/pi-meat
Package
@jrimmer/pi-meat
Version
0.1.1
Published
Aug 7, 2026
Downloads
86/mo · 86/wk
Author
jrimmer
License
MIT
Types
extension
Size
38.5 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-meat

meat.dev integration for pi: meat abridges a code diff into a reading diff — the parts a senior reviewer actually needs to read. This extension wires meat into your pi sessions:

  • Installs the latest meat CLI into your PATH. On every session start it runs go install meat.dev/cmd/meat@latest (skipped for 12h when already current) and points GOBIN at a PATH directory when your default Go bin dir isn't on PATH. Force it anytime with /meat install.
  • Pre-processes every new commit in the background. When a git commit is created (agent git commit, ! user bash, or a commit from any other terminal while a session is open), meat starts processing it immediately in the background — no need to wait around for it later.
  • Meat Diffs view with a toggle. Press alt+m (or run /meat) to open a full-screen Diffs view showing the reading diff for the current commit. If meat is still processing the commit you're told it's in process — both in the view ("⏳ meat is still processing commit …") and as a notification.
  • Live status widget above the editor showing the current commit's meat state (processing / ready / failed) with the toggle hint.

Install

pi install npm:@jrimmer/pi-meat
# or from source:
pi install git:github.com/jrimmer/pi-meat

Or clone and link it manually:

git clone https://github.com/jrimmer/pi-meat ~/work/pi-meat
ln -s ~/work/pi-meat ~/.pi/agent/extensions/pi-meat

Then /reload in pi (or restart). The extension is auto-discovered from ~/.pi/agent/extensions/.

Requirements: a Go toolchain (to install meat) and an LLM API key for meat itself — OPENAI_API_KEY or ANTHROPIC_API_KEY (or an exe.dev VM with an attached llm integration).

Credential sourcing: meat is spawned through your login shell (zsh -lic on macOS, $SHELL elsewhere), so credentials exported in ~/.zshrc / ~/.zprofile / ~/.bashrc are picked up on every run — even when pi itself started before those exports existed. No pi restart needed after editing your shell profile. (If pi's own environment already carries an OPENAI_API_KEY or ANTHROPIC_API_KEY, the extension spawns meat directly and uses that.)

Usage

What How
Toggle the meat Diffs view alt+m or /meat
Re-run meat on the current commit r inside the view, or /meat run
Run meat on a specific revision /meat run HEAD~2 (or any rev/range)
Force reinstall latest meat /meat install
Show install/repo/commit status /meat status
Scroll the reading diff / / PgUp / PgDn (or j/k)
Close the view q, esc, or alt+m again

Commit detection

The extension watches the session's git repo (git rev-parse HEAD every 4s) and treats the first HEAD seen at session start as the baseline — only new commits are processed. Commit-like commands in the agent's bash tool or ! user bash trigger an immediate re-check instead of waiting for the next poll.

Processing is fully backgrounded (detached process): you can keep working while meat summarizes. When it finishes you get a notification with the one-line summary, and the Diffs view flips from "in process" to the reading diff.

Crash recovery

meat writes its own content-addressed cache (~/.meat) before printing, so a run interrupted by a pi restart is re-runnable instantly with no extra LLM calls. The extension persists per-commit status in ~/.pi-meat/state.json and re-kicks stale in-flight entries on the next session.

Layout

index.ts          # entry point: events, commands, shortcut, wiring
src/state.ts      # persisted state (~/.pi-meat/state.json)
src/installer.ts  # install/refresh meat.dev CLI into PATH
src/runner.ts     # spawn `meat -json <rev>`, parse result
src/watcher.ts    # git HEAD watcher + background processing pipeline
src/diffs-view.ts # the meat Diffs view component (alt+m toggle)
types/            # dev-time TS stubs for @earendil-works/* host packages
harness.mjs       # functional test (extension wiring + watcher pipeline)
harness-render.mjs# render/keys test for the Diffs view

Development

npm install                 # typescript + @types/node for local type-checking
npx tsc --noEmit            # type-check (must pass)
node harness.mjs /path/to/repo   # functional checks (expect meat error w/o API key)
node harness-render.mjs     # Diffs view render + key checks

Notes:

  • Runtime resolution of @earendil-works/pi-tui/pi-coding-agent is provided by pi itself; no local install is needed. The types/ stubs exist because the pi-lens LSP tsserver ships TypeScript 4.9.5, which cannot resolve the host packages' ESM d.ts; tsconfig.json maps the packages to the stubs via paths. tsc (modern TS) passes against the same config.
  • The harnesses resolve @earendil-works/pi-tui at runtime from node_modules/@earendil-works/pi-tui; if you recreate node_modules, symlink it to the host package (ln -s /opt/homebrew/lib/node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works pi-meat/node_modules/).