Repository navigation
feat: add npm wrapper to install and run the CLI via npx - #610
Merged
Merged
Conversation
Publish the CLI to npm as @inference-gateway/cli so anyone with Node.js (>= 18) can run it via 'npx @inference-gateway/cli' without a Go toolchain or manual download. The zero-dependency npm/ wrapper downloads the matching native release binary (infer-<os>-<arch>) on postinstall, checksum-verifies it against checksums.txt, caches it next to the script, and execs it. Publishing is wired into semantic-release (@semantic-release/npm, pkgRoot: npm) with npm/package.json committed back so the version stays in sync; release.yml gains id-token: write for npm OIDC trusted publishing, with a temporary NPM_TOKEN for the bootstrap publish. A .markdownlintignore excludes the publish-time npm/ copies. Mirrors the approach already used in inference-gateway/adl-cli.
edenreich
commented
Jun 6, 2026
Co-authored-by: Eden Reich <[email protected]>
inference-gateway-releaser Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
## [0.119.0](v0.118.0...v0.119.0) (2026-06-06) ### 🚀 Features * add npm wrapper to install and run the CLI via npx ([#610](#610)) ([8f24fd5](8f24fd5)), closes [inference-gateway/docs#182](inference-gateway/docs#182) * **tools:** indentation-tolerant matching and stale-read detection for Edit/MultiEdit ([#608](#608)) ([14d7e98](14d7e98)) ### 🐛 Bug Fixes * **agent:** execute approved tools concurrently and freeze tickers on finish ([#609](#609)) ([a713306](a713306)) ### 💄 Styles * replace em dashes with hyphens ([91a3746](91a3746)) ### 🧹 Maintenance * **deps:** bump codex 0.133.0 -> 0.135.0 ([#607](#607)) ([86af5fb](86af5fb)) * enable skills by default ([9440593](9440593)) * regenerate config ([991cd77](991cd77))
Contributor
|
🎉 This PR is included in version 0.119.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closed
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.
Summary
Closes #568. Adds an npm/npx wrapper so the CLI can be run with
npx @inference-gateway/cli(Node >= 18) - no Go toolchain or manual download. Mirrors the approach already shipping ininference-gateway/adl-cli.This repo ships raw release binaries (
infer-<os>-<arch>) built byartifacts.yml, so the installer downloads the binary directly (no archive to extract) and verifies it againstchecksums.txt.What's included
npm/wrapper (zero runtime deps)package.json-@inference-gateway/cli, bininfer,postinstallhook,os/cpugates (linux/darwin, x64/arm64).bin/install.js- downloads the matchinginfer-<os>-<arch>release asset, checksum-verifies againstchecksums.txt, caches it next to the script,chmod +x. HonorsINFER_CLI_BASE_URLandINFER_CLI_SKIP_DOWNLOAD.bin/run.js- locates/installs the binary, execs it, forwards args and exit code..gitignore- excludes the fetched binary and the publish-time README/LICENSE copies..releaserc.yaml-@semantic-release/npm(pkgRoot: npm); copies LICENSE/README intonpm/at release; commitsnpm/package.jsonso the version stays in sync; adds an "npm / npx" block to the release body..github/workflows/release.yml-id-token: write(OIDC), Node pinned to24(npm >= 11.5.1),@semantic-release/[email protected], passesNPM_TOKENfor the bootstrap publish.README.md- new "Using npm/npx (Recommended)" install section with a "not recommended for production" caveat.Taskfile.yml+.markdownlintignore- moved markdownlint ignores into a config file so they apply fortask lint, pre-commit, and any direct/CI invocation; thenpm/publish copies are excluded.artifacts.ymlis unchanged - it already producesinfer-{linux,darwin}-{amd64,arm64}+checksums.txt, exactly what the installer consumes.Platforms
Linux + macOS on amd64/arm64 (matches adl-cli and this repo's release assets). armv7 and Windows (use WSL) are out of scope.
Manual prerequisites before the next release publishes to npm (org admin)
NPM_TOKENsecret (npm automation token with publish rights to the@inference-gatewayscope). The first release publishes@inference-gateway/cliusing it.@inference-gateway/cli-> repoinference-gateway/cli, workflow.github/workflows/release.yml, then delete theNPM_TOKENsecret so subsequent releases publish via OIDC (same model as@inference-gateway/adl-cli).Verification
install.jsdownloaded + checksum-verifiedinfer-darwin-arm64from v0.118.0;run.jsran it (infer v0.118.0,--help); re-run no-ops (cached);INFER_CLI_SKIP_DOWNLOADskips.npm pack --dry-run-> tarball = package.json + bin/{run,install}.js + README + LICENSE (native binary excluded).markdownlint .and the full pre-commit lint pass.Follow-up
Docs ticket filed: inference-gateway/docs#182 (document
npx @inference-gateway/cli).