fix: remove global CLI install, improve permission error on link#31
Conversation
Stop auto-installing @insforge/cli globally after link/create — this caused npx to use stale cached versions instead of fetching latest. Show identity in permission errors: "You're logged in as X, and you don't have access to project Y" instead of a cryptic 403. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughRemoved the global CLI installation side-effect: calls to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The API returns 404 (not 403) when a user tries to access a project they don't own, so the friendly identity message needs to catch both. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
npm install -g @insforge/cliafterlinkandcreate— this causednpxto find a stale global binary instead of fetching the latest from npm, which is what users hit when they first tried the CLI weeks ago then came backlink --project-id— now shows "You're logged in as X, and you don't have access to project Y" instead of a cryptic 403Test plan
insforge link --project-id <invalid-id>while logged in — should show identity in errorinsforge linkandinsforge create— verify no global install stepnpx @insforge/clipulls latest after uninstalling any global version🤖 Generated with Claude Code
Note
Remove global CLI install and improve permission error messaging in
linkcommandinstallCliGloballyfunction from skills.ts and all call sites in thecreateandlinkcommands, so neither command attempts a global npm install of@insforge/cli.linkcommand now catches errors with exit code 4/5 or a 'not found' message when fetching project details, and re-throws aPERMISSION_DENIEDerror (exit code 5) that includes the logged-in user's identity and the inaccessible project ID.Macroscope summarized f24ffc8.
Summary by CodeRabbit
Bug Fixes
Changes