If the binary to run is not named same as the package, you won't be able to run it with bunx. There are some binaries included in packages that don't have same name as package.
For instance, Renovate: a tool to update dependencies. Their package provides two binaries:
renovate (same as package name) to run the dependencies update bot
renovate-config-validator: to validate your config
You can run the bot with bunx renovate. But you can't run the renovate-config-validator using bunx right now.
Other package managers offer the -p CLI option to specify which package to install, then the first argument is the binary to run. For instance, following previous example:
What is the feature you are proposing to solve the problem?
Would be nice to have also some -p or --package to enable this use case :)
What alternatives have you considered?
Installing the dependency, then use bun run with path to script in node_modules directory. But the great of bunx is to just install and run for dependencies that won't be needed often. Like validating the configuration of your dependencies update tool.
Until then, other package managers can be used for this purpose
What is the problem this feature would solve?
If the binary to run is not named same as the package, you won't be able to run it with
bunx
. There are some binaries included in packages that don't have same name as package.For instance, Renovate: a tool to update dependencies. Their package provides two binaries:
renovate
(same as package name) to run the dependencies update botrenovate-config-validator
: to validate your configYou can run the bot with
bunx renovate
. But you can't run therenovate-config-validator
usingbunx
right now.Other package managers offer the
-p
CLI option to specify which package to install, then the first argument is the binary to run. For instance, following previous example:npm exec --package
/npx -p|--package
We can run the script with:npm exec --package renovate renovate-config-validator
npx --package renovate renovate-config-validator
yarn dlx -p|--package
We can run the script with:yarn dlx -p renovate renovate-config-validator
What is the feature you are proposing to solve the problem?
Would be nice to have also some
-p
or--package
to enable this use case :)What alternatives have you considered?
Installing the dependency, then use
bun run
with path to script innode_modules
directory. But the great ofbunx
is to just install and run for dependencies that won't be needed often. Like validating the configuration of your dependencies update tool.Until then, other package managers can be used for this purpose