Let npx run the CLI without installing it - #359
Merged
Merged
Conversation
npx runs the binary named after the package, and only falls back to the sole binary when a package ships exactly one. This package ships four, none of them called unipept-cli, so the obvious invocation failed: $ npx unipept-cli --version npm error could not determine executable to run The natural second guess is worse: `npx unipept` looks for a package named unipept, which does not exist on npm, so it fails with a 404 that points nowhere useful. That was the name of the old Ruby gem. Adding unipept-cli as an alias for the unipept binary makes the obvious form work. The other three commands stay reachable with -p, which is the normal way to run a named binary from a package: $ npx unipept-cli pept2lca AALTER $ echo "AALTERSVKAAPKR" | npx -p unipept-cli prot2pept Running through npx is worth documenting beyond convenience: pinning a version with npx unipept-cli@4.2.2 makes an analysis reproducible without asking anyone to install anything. Patch rather than minor: the alias points at the same script as unipept and adds no capability, since the command was already reachable through npx -p. Nothing a user could do before changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bmesuere
force-pushed
the
feat/npx-support
branch
from
August 19, 2026 15:16
a1cb168 to
16599a5
Compare
bmesuere
marked this pull request as ready for review
August 19, 2026 15:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes
npx unipept-cliwork, and releases it as 4.2.2.npx runs the binary named after the package, and only falls back to the sole binary when a package ships exactly one. This package ships four, none of them called
unipept-cli, so the obvious invocation failed:The natural second guess is worse.
npx unipeptlooks for a package calledunipept, which does not exist on npm and returns a 404 that points nowhere useful. That was the name of the old Ruby gem, so it is exactly what someone coming from the old documentation would type.Adding
unipept-clias an alias for theunipeptbinary makes the obvious form work, while the other three commands stay reachable with-p, which is the normal way to run a named binary out of a package:Why this is worth more than convenience. Pinning a version through npx makes an analysis reproducible without asking anyone to install anything, which is a better thing to put in a methods section than "we used the Unipept CLI":
Patch rather than minor. The alias points at the same script as
unipeptand adds no capability: the command was already reachable throughnpx -p unipept-cli unipept, so nothing a user could do before changes. The counter argument is thatbinis public surface and the documentation now says the short form needs a given version, but that gate is on an alias rather than on anything the tool can do.Manual testing instructions
npx unipept-cli pept2lca AALTERreturns the usual CSVnpx -p unipept-cli prot2pept,peptfilteranduniprotstill workunipept,peptfilter,prot2peptanduniprotunchangedunipept-cli --helpreports its own name in the usage line, since npm's shim path is what commander readsVerification run
Verified against a packed tarball installed into a scratch project, rather than from source, so the bin wiring is the real thing:
The version pinned form
npx unipept-cli@4.2.2cannot be exercised until this is published, but the equivalentnpx -p unipept-cli@4.2.0 unipept --versionwas confirmed to print4.2.0, so version resolution itself works.Lint, typecheck and build pass.
Checklist
npx unipept-cli