Skip to content

[FEATURE] Add npx wrapper to install and run the CLI binary #568

Description

@inference-gateway-maintainer

Summary

Port the npx wrapper from the gateway repo to the CLI, so users with Node.js (>= 18) can run the CLI via npx without a separate Go toolchain or download step.

Motivation

The original npx wrapper was implemented in inference-gateway/inference-gateway (PR #317) but was closed because this functionality is a better fit for the CLI — users who want npx convenience likely want the CLI tool, not the gateway server itself.

The gateway repo already ships a working prototype in the npx/ folder of the branch claude/issue-315-20260526-1910 that can be adapted for the CLI.

What the prototype does

  • A thin Node.js shim (bin/inference-gateway.js) that spawns the platform-matching Go binary.
  • A download/cache module (lib/install.js) that:
    • Detects linux/darwin on x86_64/arm64/armv7.
    • Downloads the matching release tarball from GitHub Releases.
    • Caches it under ~/.cache/inference-gateway/ (respects XDG_CACHE_HOME and INFERENCE_GATEWAY_CACHE_DIR override).
    • Extracts with tar and execs the binary.
  • package.json with bin entry, engine constraints, and publishConfig: public.
  • Environment variable INFERENCE_GATEWAY_VERSION to pin a specific release tag.
  • Zero runtime dependencies (uses only Node.js built-ins: fs, os, path, https, child_process).

Proposed changes for CLI

  1. Port the npx/ folder from inference-gateway/inference-gateway to this repo.
  2. Update package name to @inference-gateway/cli (or similar).
  3. Update release automation: bump version in npx/package.json during release, include the package in release body, and wire up npm publish (needs NPM_TOKEN CI secret).
  4. Adapt documentation: add npx usage to the CLI README with "not recommended for production" caveat.

Out of scope

  • Windows support (use WSL).
  • CI workflow to automate npm publish (needs repo-admin secret setup).

Related

Acceptance Criteria

  • A Node.js npx/ package exists in this repo (@inference-gateway/cli)
  • On first npx @inference-gateway/cli, the matching release binary is downloaded and cached
  • Subsequent invocations reuse the cached binary
  • Supports Linux and macOS (x86_64, arm64, armv7)
  • Node >= 18 supported
  • Zero runtime dependencies
  • Version is synced automatically with releases
  • Documented with "not recommended for production" caveat

Activity

  1. added theissue type on Jun 1, 2026
  2. added
    enhancement
    on Jun 1, 2026
  3. moved this to Todo in 2026on Jun 2, 2026
  4. moved this from Todo to In progress in 2026on Jun 6, 2026
  5. added a commit that references this issue on Jun 6, 2026
    8f24fd5
  6. inference-gateway-releaser commented on Jun 6, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.119.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  7. moved this from In progress to Done in 2026on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions