Skip to content

fix(cli): resolve correct package version for npm exec#176

Open
codeboost-tr wants to merge 1 commit into
tavily-ai:mainfrom
codeboost-tr:fix/cli-version-unknown
Open

fix(cli): resolve correct package version for npm exec#176
codeboost-tr wants to merge 1 commit into
tavily-ai:mainfrom
codeboost-tr:fix/cli-version-unknown

Conversation

@codeboost-tr

Copy link
Copy Markdown

Summary

Fixes the issue where \ avily-mcp --version\ prints \unknown\ when executed via
px\ or
pm exec.

Changes

The published bin runs through npm's .bin\ symlink path, which prevents yargs from inferring the correct package version. This patch resolves the real entrypoint path, walks up to the installed \package.json, and binds that version explicitly to \yargs.version().

Tested locally with
pm pack\ and
pm exec --yes --package= -- tavily-mcp --version, which now correctly prints \

Fixes the issue where \	avily-mcp --version\ prints \unknown\ when executed via \
px\ or \
pm exec\. Yargs now walks up the directory tree to find the correct \package.json\ instead of relying on the symlink path.
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