Skip to content

Fix first-run CLI command setup - #611

Merged
Aymericr merged 1 commit into
mainfrom
fix/cli-install-command
Aug 7, 2026
Merged

Fix first-run CLI command setup#611
Aymericr merged 1 commit into
mainfrom
fix/cli-install-command

Conversation

@Aymericr

@Aymericr Aymericr commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • install the exact CLI version globally after an interactive npx ... editor start becomes healthy
  • make pascal status available immediately in the unchanged shell
  • retain npx guidance when setup is non-interactive or global installation fails
  • document the new first-run contract and cover installer detection, safety, and failure behavior

Verification

  • bunx biome check ...
  • bun run --cwd packages/cli check-types
  • bun test packages/cli/src (26 passed)
  • bun run --cwd packages/cli prepublishOnly
  • unchanged-shell E2E: simulated npx start, /opt/homebrew/bin/pascal, pascal status against port 57659

Note

Medium Risk
Runs npm install -g on user machines during first run (permissions/timeouts); editor startup is unaffected on failure but global npm state can change on success.

Overview
Interactive npx @pascal-app/cli editor runs now trigger a post-health-check npm install --global --ignore-scripts @pascal-app/cli@<version>, so pascal status, logs, and stop work in the same shell without a separate setup step.

New command-install logic detects npx/npm-exec invocations and runs the global install with a timeout; failures are non-fatal and the success message falls back to npx guidance plus manual install instructions. Non-interactive (--json, non-TTY) paths skip auto-install. README and smoke tests reflect the updated first-run contract.

Reviewed by Cursor Bugbot for commit 9d373e4. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9d373e4. Configure here.

'',
'To install the shorter "pascal" command:',
' npm install --global @pascal-app/cli',
]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wrong short command for transient runners

Medium Severity

useShortCommand treats every non-npx launch as if pascal is already installed. Documented transient runners like pnpm dlx and bunx never match isNpxInvocation and never run the global install, so the ready output still directs users to bare pascal commands that are not on PATH, and it omits the manual install hint.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9d373e4. Configure here.

environment.npm_lifecycle_event === 'npx' ||
(environment.npm_command === 'exec' &&
(environment.PATH ?? '').split(':').some((entry) => entry.includes('/_npx/')))
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Windows npx detection uses Unix PATH

Low Severity

The npm exec branch of isNpxInvocation splits PATH on : and looks for /_npx/. On Windows, PATH is ;-separated and the npx cache uses backslashes, so real npx/npm exec runs can be missed. That skips global install and falls through to bare pascal guidance.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9d373e4. Configure here.

@Aymericr
Aymericr merged commit 5e0a1d9 into main Aug 7, 2026
3 checks passed
@Aymericr
Aymericr deleted the fix/cli-install-command branch August 7, 2026 15:06
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