Launch permission onboarding after npm install#10
Launch permission onboarding after npm install#10kbdevs wants to merge 1 commit intoiFurySt:mainfrom
Conversation
Open the bundled onboarding helper during interactive global installs so users hit permissions immediately instead of only reading postinstall text. Document the new auto-launch flow in the repo and generated package README.
There was a problem hiding this comment.
Pull request overview
Updates the npm package install experience to automatically launch the bundled macOS permission onboarding during interactive global installs, and aligns documentation/history with the new flow.
Changes:
- Auto-launch bundled permission onboarding from the generated npm
postinstallscript when appropriate (TTY + global + non-CI). - Update generated package README text and root READMEs (EN/ZH) to describe the automatic onboarding and manual fallback commands.
- Add a history entry documenting the task and scope.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/npm/build-packages.mjs | Generates a postinstall script that best-effort launches the bundled app onboarding and updates install messaging/docs in the generated README. |
| docs/histories/2026-04/20260422-1636-launch-npm-postinstall-onboarding.md | Adds a history record describing the onboarding-on-install change. |
| README.zh-CN.md | Documents automatic onboarding launch for interactive global installs (Chinese). |
| README.md | Documents automatic onboarding launch for interactive global installs (English). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| OPEN_COMPUTER_USE_LAUNCHED_FROM_POSTINSTALL: "1", | ||
| }, | ||
| }); | ||
| child.on("error", () => {}); |
There was a problem hiding this comment.
launchOnboardingIfPossible() returns true immediately after spawn(), even if the spawn fails asynchronously (e.g., EACCES/ENOENT -> error event). This can make launchedOnboarding true and print the “launched automatically” message when nothing was actually started. Consider returning false when child.pid is undefined and/or only setting launchedOnboarding once you have a successful spawn signal; alternatively, make the user-facing message not depend on a best-effort spawn result.
| child.on("error", () => {}); | |
| child.on("error", () => {}); | |
| if (child.pid === undefined) { | |
| return false; | |
| } |
| npm i -g open-computer-use | ||
| ``` | ||
|
|
||
| On interactive local global installs, npm also tries to open the bundled permiso-style permission onboarding automatically. If nothing appears, run `open-computer-use` or `open-computer-use doctor`. |
There was a problem hiding this comment.
This section describes the automatic postinstall onboarding but doesn’t mention the new opt-out env var (OPEN_COMPUTER_USE_SKIP_POSTINSTALL_ONBOARDING=1). Since this is user-facing behavior (auto-launching a GUI app), consider documenting the opt-out here (and/or in a dedicated “Environment variables” section) so users can disable it predictably.
| On interactive local global installs, npm also tries to open the bundled permiso-style permission onboarding automatically. If nothing appears, run `open-computer-use` or `open-computer-use doctor`. | |
| On interactive local global installs, npm also tries to open the bundled permiso-style permission onboarding automatically. To disable that behavior, set `OPEN_COMPUTER_USE_SKIP_POSTINSTALL_ONBOARDING=1` during install. If nothing appears, run `open-computer-use` or `open-computer-use doctor`. |
| npm i -g open-computer-use | ||
| ``` | ||
|
|
||
| 在本机交互式的全局安装场景下,npm 也会尝试自动拉起内置的 permiso 风格权限引导;如果没有弹出来,手动运行 `open-computer-use` 或 `open-computer-use doctor` 即可。 |
There was a problem hiding this comment.
这里说明了 postinstall 会自动拉起权限引导,但没有提到新增的 opt-out 环境变量(OPEN_COMPUTER_USE_SKIP_POSTINSTALL_ONBOARDING=1)。因为这是用户可感知的行为(安装时自动启动 GUI),建议在这里顺带写明如何关闭,方便用户可预期地禁用。
Summary
postinstallduring interactive local global installs instead of only printing next stepsNotes
Permisopackage dependency, which currently declaresmacOS 26whileopen-computer-usestill targetsmacOS 14+Validation
make check-docsswift testnode ./scripts/npm/build-packages.mjs --skip-build --out-dir tmp/npm-stageCI=1 node ./tmp/npm-stage/open-computer-use/scripts/postinstall.mjs