Bug
When installing ypi globally via bun, the pi binary from @mariozechner/pi-coding-agent (a transitive dependency) is not symlinked to the global bin directory. Running ypi fails immediately:
$ ypi ./
/Users/minzi/.bun/bin/ypi: line 119: exec: pi: not found
What happens next is worse
The natural reaction is to run bun install -g pi, which installs the wrong package — pi@2.0.5, a math pi-number calculator that squats the pi name on npm. That package then crashes with:
Error: Cannot find module './pi'
...because bun blocks its postinstall script.
Root Cause
Both ypi (line 124) and rlm_query (lines 345, 414, 433) invoke bare pi via exec pi / $TIMEOUT_CMD pi, relying on PATH resolution. But:
- bun (and pnpm) only link direct package binaries globally, not transitive dependency binaries
ypi declares @mariozechner/pi-coding-agent as a dependency but doesn't re-export its pi binary
- The
pi binary ends up at node_modules/@mariozechner/pi-coding-agent/dist/cli.js — present but not on PATH
Suggested Fix
Resolve pi from the package's own node_modules relative to SCRIPT_DIR instead of relying on bare PATH lookup. Search order:
$SCRIPT_DIR/node_modules/.bin/pi (nested)
$SCRIPT_DIR/../.bin/pi (hoisted .bin)
$SCRIPT_DIR/node_modules/@mariozechner/pi-coding-agent/dist/cli.js (nested direct)
$SCRIPT_DIR/../@mariozechner/pi-coding-agent/dist/cli.js (hoisted direct)
- Fall back to
command -v pi (PATH — for standalone installs)
I've submitted a PR with this fix.
Bug
When installing
ypiglobally via bun, thepibinary from@mariozechner/pi-coding-agent(a transitive dependency) is not symlinked to the global bin directory. Runningypifails immediately:What happens next is worse
The natural reaction is to run
bun install -g pi, which installs the wrong package —pi@2.0.5, a math pi-number calculator that squats thepiname on npm. That package then crashes with:...because bun blocks its postinstall script.
Root Cause
Both
ypi(line 124) andrlm_query(lines 345, 414, 433) invoke barepiviaexec pi/$TIMEOUT_CMD pi, relying on PATH resolution. But:ypideclares@mariozechner/pi-coding-agentas a dependency but doesn't re-export itspibinarypibinary ends up atnode_modules/@mariozechner/pi-coding-agent/dist/cli.js— present but not on PATHSuggested Fix
Resolve
pifrom the package's ownnode_modulesrelative toSCRIPT_DIRinstead of relying on bare PATH lookup. Search order:$SCRIPT_DIR/node_modules/.bin/pi(nested)$SCRIPT_DIR/../.bin/pi(hoisted .bin)$SCRIPT_DIR/node_modules/@mariozechner/pi-coding-agent/dist/cli.js(nested direct)$SCRIPT_DIR/../@mariozechner/pi-coding-agent/dist/cli.js(hoisted direct)command -v pi(PATH — for standalone installs)I've submitted a PR with this fix.