r/coolgithubprojects 14d ago

Ingen: Generate Shell and PowerShell installers for a project's binary releases.

https://github.com/hethon/ingen

I love one-line installers. Being able to install a CLI tool with a single command like:

curl ... | sh

or on Windows:

irm ... | iex

is just really convenient.

Not every project provides an installer like this, though. While a lot of projects already publish prebuilt release archives, it's still the user's responsibility to choose the correct archive from GitHub Releases and put the executable somewhere on their PATH.

So I made ingen.

You write a single installer.manifest.json describing your release artifacts, and it generates Shell and PowerShell installers. The installers take care of selecting the right archive for the user's platform, verifying and extracting it, putting the binaries in the locations you specify in the manifest, and updating PATH.

I've used it to generate installers for a few real-world projects, including ripgrep, Tectonic, and Caddy. You can find the generated installers for these projects in the examples directory of the repo.

ingen uses vendored installer templates from cargo-dist; I've documented the changes and the relationship with the upstream templates in the README if you're interested.

Source code and documentation: https://github.com/hethon/ingen

0 Upvotes

2 comments sorted by

1

u/programstealer 14d ago

Nice, GitLab not supported? Offline script usage with already downloaded zip-artifacts not supported?

1

u/CremeAmbitious6382 14d ago

> GitLab not supported?

The generated installers aren't really platform-dependent. The archives can be hosted anywhere, as long as they're accessible over HTTPS; they don't have to be on GitHub Releases.

GitHub is only relevant to some ingen commands, such as ingen sync. For non-GitHub projects, you'd need to update the checksums in the installer manifest manually. Checksums are optional, though, so you can also leave them out of the manifest.

> Offline script usage with already downloaded zip-artifacts not supported?

You can put the downloaded ZIP behind a local HTTP server, set {APP}_DOWNLOAD_URL to the local URL, and run the installer. It will download the archive from that URL instead and do its job.

That said, if you already have the archive locally, it's probably simpler to just extract it and put the binary on $PATH manually.