Skip to content

Launch permission onboarding after npm install#10

Open
kbdevs wants to merge 1 commit intoiFurySt:mainfrom
kbdevs:kb/postinstall-onboarding
Open

Launch permission onboarding after npm install#10
kbdevs wants to merge 1 commit intoiFurySt:mainfrom
kbdevs:kb/postinstall-onboarding

Conversation

@kbdevs
Copy link
Copy Markdown

@kbdevs kbdevs commented Apr 22, 2026

Summary

  • auto-launch the bundled permission onboarding from npm postinstall during interactive local global installs instead of only printing next steps
  • keep CI and non-interactive installs quiet by gating the launch behind TTY/global-install checks and an opt-out env var
  • sync the generated package README, root README docs, and history so the install flow matches the shipped behavior

Notes

  • this uses the repo's existing permiso-style onboarding flow rather than adding a direct Permiso package dependency, which currently declares macOS 26 while open-computer-use still targets macOS 14+

Validation

  • make check-docs
  • swift test
  • node ./scripts/npm/build-packages.mjs --skip-build --out-dir tmp/npm-stage
  • CI=1 node ./tmp/npm-stage/open-computer-use/scripts/postinstall.mjs

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.
Copilot AI review requested due to automatic review settings April 22, 2026 23:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 postinstall script 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", () => {});
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
child.on("error", () => {});
child.on("error", () => {});
if (child.pid === undefined) {
return false;
}

Copilot uses AI. Check for mistakes.
Comment thread README.md
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`.
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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`.

Copilot uses AI. Check for mistakes.
Comment thread README.zh-CN.md
npm i -g open-computer-use
```

在本机交互式的全局安装场景下,npm 也会尝试自动拉起内置的 permiso 风格权限引导;如果没有弹出来,手动运行 `open-computer-use` 或 `open-computer-use doctor` 即可。
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里说明了 postinstall 会自动拉起权限引导,但没有提到新增的 opt-out 环境变量(OPEN_COMPUTER_USE_SKIP_POSTINSTALL_ONBOARDING=1)。因为这是用户可感知的行为(安装时自动启动 GUI),建议在这里顺带写明如何关闭,方便用户可预期地禁用。

Copilot uses AI. Check for mistakes.
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.

2 participants