Safeguard
Developer Tools•

Which OpenAPI Generator install method suits CI?

npm, Docker, JAR, Homebrew, pip, JBang or the launcher script: how each install route compares for pinning, trust and repeatable generated code.

Safeguard Security Team
4 min read

The right route is the one where you can fix an exact version, fetch it from a source you control and run it the same way on every machine. Docker with a pinned tag or digest, or a JAR from Maven Central at a fixed version, usually fit well. Convenience installers suit laptops.

The routes the docs list

The installation page documents these ways to get the CLI: the npm wrapper, Homebrew on macOS, Scoop on Windows, PyPI, Docker, a direct JAR download, JBang and a Bash launcher script. The JAR needs a Java 11 runtime at minimum, according to the page.

Comparison for repeatability

RoutePin an exact versionNeeds Java on the machineMain caution
npm wrapperYes, via the version manager or a dev dependencyWrapper runs the JARGlobal install gives "latest" by default
HomebrewThe docs show a plain install command with no versionHandled by the formulaLaptop friendly, poor for CI pinning
ScoopSimilar to HomebrewJava may need separate installWindows convenience
PyPI packagePin in the requirements fileNeeds a java executable, or a bundled optionCheck what the package version maps to
Docker imageYes, by tag, better by digestNoDo not run the untagged form in CI
Direct JARYes, version in the URLYesYou must verify and cache the download
JBangMaven coordinates, so a version can be setHandled by JBangThe docs example uses LATEST, change it
Bash launcherVia an environment variableYesFetches newest by default

The notes about defaults come straight from the docs' own examples: the npm global command installs the latest version, the JBang example uses the LATEST keyword, and the launcher checks for the newest release.

How to choose

  1. CI that must be repeatable. Use Docker by digest, or the JAR at a fixed version served from your own artifact store.
  2. A JavaScript or TypeScript project. The npm wrapper as a dev dependency keeps the version in your lockfile alongside other tools.
  3. A Java project. Use the Maven or Gradle plugin with an explicit plugin version, as the plugins page shows.
  4. Developer laptops. Any convenient installer is fine, as long as CI is the source of truth and checks the version.

Whatever you choose

  • Write the version down in one file that CI and developers both read.
  • Prefer fetching through your own mirror or registry so a changed upstream does not change your build.
  • Fail the build when the reported version differs from the recorded one.
  • Remember that pinning the tool does not pin the libraries inside generated code. See dependency risk in generated clients.

The steps for holding the version are in how to pin the OpenAPI Generator version in CI, and the launcher's behaviour is covered in the bash launcher post.

Where Safeguard fits

Safeguard keeps an inventory of dependencies and build tools declared in your repositories through SBOM and dependency scanning, and continuous monitoring can flag when something in that inventory gains a new advisory. Try the free scan at gold.safeguard.sh/scan.

Try it yourself

Click through it at your own pace, or open it full screen. Look at how a new advisory is matched against an existing inventory.

Quick check

Does the Docker image avoid needing Java?

Yes. The docs describe it as an option for developers who cannot install Java or upgrade the installed version.

Which route do the docs recommend?

They list them side by side without ranking. Pick by your need for pinning and trust.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.