Skip to content

Fix Bun onboarding: pi-v build, prereq checks, and auth UX#9

Open
shaunymca wants to merge 3 commits intohdresearch:mainfrom
shaunymca:fix/bun-pi-v-deps
Open

Fix Bun onboarding: pi-v build, prereq checks, and auth UX#9
shaunymca wants to merge 3 commits intohdresearch:mainfrom
shaunymca:fix/bun-pi-v-deps

Conversation

@shaunymca
Copy link
Copy Markdown

Summary

  • pi-vers.js: replace npm run build with bun install && bun run build when building @hdresearch/pi-v from source — npm is unavailable in Bun-only environments, and typescript is a devDependency that must be installed before the build
  • package.json: add postinstall script (bun install --cwd) so @hdresearch/pi-v's devDependencies are installed automatically after bun install from the root
  • cli.js: add checkPrerequisites() to detect missing ssh/openssl before any command runs, with platform-aware install instructions
  • cli.js: show a "check your inbox" hint when --email is passed and no cached key exists, so users know to expect the magic link

Context

Discovered while following the README quickstart on a Bun-only Windows environment. None of these are Windows-specific — the npm and devDependency issues affect any Bun-only setup, and the auth UX gaps affect all platforms.

Test plan

  • bun install from root installs @hdresearch/pi-v devDependencies without manual cd
  • bun src/cli.js provision ... no longer fails with ENOENT: npm
  • Missing ssh or openssl produces a clear error with install instructions
  • --email flag prints inbox hint only when shell-auth will actually run

🤖 Generated with Claude Code

shaunymca and others added 3 commits March 30, 2026 15:21
- pi-vers.js: use bun install && bun run build instead of npm run build
  when building @hdresearch/pi-v; npm is not available in Bun-only
  environments and typescript is a devDependency that must be installed first
- package.json: add postinstall script to install @hdresearch/pi-v's
  devDependencies after bun install from the root (uses --cwd to stay
  cross-platform)
- cli.js: add checkPrerequisites() to detect missing ssh/openssl before
  any command runs, with platform-aware install instructions
- cli.js: show "check your inbox" hint when --email is passed and no
  cached key exists, so users know to expect the magic link

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- cli.js: add git, tar, ssh-keygen to checkPrerequisites — all three are
  required and were silently missing from the check
- cli.js: improve Windows help text to explain that openssl requires
  Git\mingw64\bin in PATH, not just Git\cmd (the installer default)
- cli.js: on Windows, detect if System32 ssh.exe takes PATH precedence
  and warn the user — the Vers ProxyCommand requires Git for Windows ssh
- orchestrate.js: use os.tmpdir() instead of process.cwd() for staging
  temp directories — avoids polluting the project dir and works correctly
  on all drives and environments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Patches dist files in @hdresearch/pi-v as a stopgap until upstream
PR #70 (hdresearch/pi-vers) is merged:
- Remove 2>/dev/null from ProxyCommand (breaks Windows native ssh.exe)
- Platform-aware UserKnownHostsFile (NUL on Windows, /dev/null elsewhere)
- icacls call after key file write to set correct Windows ACLs
- Replace require("fs") with ESM readFileSync import

The patch script runs automatically via postinstall after bun install,
and warns if expected strings are not found (e.g. already patched).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant