Skip to content

fix(cli): print the wizard version for --version under npx - #1625

Open
bryanlundberg wants to merge 1 commit into
PostHog:mainfrom
bryanlundberg:fix/1621-version-under-npx
Open

bryanlundberg wants to merge 1 commit into
PostHog:mainfrom
bryanlundberg:fix/1621-version-under-npx

Conversation

@bryanlundberg

Copy link
Copy Markdown

Problem

npx @posthog/wizard --version (and -v) prints unknown.

Closes #1621

Changes

.version() without an argument makes yargs read the package.json above node_modules, which under npx is npx's own manifest with no version. The CLI now passes the build-time VERSION from @shared/version.

Test plan

I packed the wizard, installed it into a folder laid out like npx's cache and ran wizard --version and -v. They printed unknown before the change and 3.0.0 after. pnpm typecheck and the CLI tests pass

@bryanlundberg
bryanlundberg requested a review from a team as a code owner November 28, 2026 12:13
@signed-commit-check

signed-commit-check Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

A quick word from the signature department

Hey @bryanlundberg, thanks for the PR! GitHub couldn't verify the signature on this commit:

  • fd4dffc: Signature not verified

PostHog requires verified commit signatures before merging. So we've built a bot to do the nagging. You're talking to it.

Let's get this verified

If signing isn't set up yet, follow our signing guide or GitHub's guide.

Already signed? Make sure GitHub recognizes your key. SSH keys must be registered as a Signing Key, not only as an Authentication Key.

Once signing is set up, if the unsigned commit is your latest commit, run:

git commit --amend --no-edit -S
git push --force-with-lease

Those commands fix only your latest commit. Older unsigned commits need signing too. Coordinate with anyone else using the branch before rewriting its history.

Save your future self another visit from me:

git config --local commit.gpgsign true

That enables signing for future commits; it doesn't sign existing ones. A Signed-off-by line isn't a cryptographic signature.

I'll check again after your next push and update this comment.

@bryanlundberg
bryanlundberg force-pushed the fix/1621-version-under-npx branch from 49156f7 to 90cd78d Compare November 28, 2026 12:44
@bryanlundberg
bryanlundberg force-pushed the fix/1621-version-under-npx branch from 90cd78d to fd4dffc Compare November 28, 2026 12:49
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.

wizard --version prints unknown when run through npx

1 participant