How it works

What the install script does on your machine, step by step, and why it is built that way.

Each script URL returns a script generated from templates in the installer repository. The server fills in the owner, the repository and the options from the URL, and nothing else. It never calls GitHub. Everything that depends on the release happens on your machine, in the script you can read.

The split is on purpose. A server that resolved releases would call the GitHub API on every request, and anyone could use up its rate limit by requesting scripts for random names. It would also be one more party that sees what you install.

What the script does

The script makes no change on disk until every check has passed. A failure before step 8 leaves the machine as it was, and the script says so.

  1. Detect the machine. The OS from uname, the CPU from uname -m, and on Linux whether the C library is glibc or musl. An x86_64 shell under Rosetta 2 counts as Apple silicon. On Windows the script reads the machine’s native architecture, so it also gets this right in an x64 PowerShell on ARM64.
  2. Look up the release. The script calls api.github.com/repos/OWNER/REPO/releases/latest, or the tag you pinned with ?version=. Drafts and pre-releases are never picked as the latest release.
  3. Pick a file. The script scores every release file against the machine. How a file is picked covers the rules.
  4. Download it over HTTPS. curl runs with --proto '=https', so a redirect to plain HTTP fails.
  5. Verify it. The file’s SHA-256 must match the digest GitHub computed when the file was uploaded, or the release’s checksum file. A mismatch stops the install.
  6. Unpack it into a temporary directory. An archive that wraps everything in one folder gets unwrapped.
  7. Find the commands. On Linux and macOS these are the native executables (ELF and Mach-O files) up to three levels deep. On Windows they are the .exe files. A name with a platform in it, such as yq_linux_amd64, becomes yq.
  8. Check for conflicts. If ~/.local/bin already holds a command of the same name that this repository did not install, the script stops.
  9. Move the files into place and link each command into ~/.local/bin. On Windows the folder that holds the .exe files goes on the user PATH instead.
  10. Set up PATH if needed, after asking. See Install locations for the files it may edit.

The script also writes a receipt, .instl-receipt, into the install directory. It records the version, the file and the linked commands. A second run that would install the same release stops early, and a run that finds an older version upgrades in place.

How a file is picked

Release files have no standard names, so the script reads the words in each name. It splits a name like tool_1.4.0_linux_amd64.tar.gz at every character that is not a letter or a digit, then looks for an OS and a CPU among the parts.

  • The OS has to match. darwin, macos, osx and mac all mean macOS. win and windows mean Windows, and win64 or linux64 also imply x86_64.
  • The CPU has to match or have a fallback. amd64, x86_64 and x64 are the same CPU, as are arm64 and aarch64. Apple silicon falls back to an x86_64 build, which runs under Rosetta 2, and Windows on ARM falls back to x64 emulation. ARMv7 also accepts ARMv6 builds. A universal macOS build fits both Mac CPUs.
  • The C library breaks ties on Linux. A musl system prefers musl builds. A glibc system prefers gnu builds or builds without a libc in the name.
  • The format has to be something the machine can unpack. .tar.gz is preferred on Linux and macOS, .zip on Windows. Bare binaries work too.
  • Plain builds beat variants. For the repository hugo, hugo_0.150.0_linux-amd64.tar.gz wins over hugo_extended_0.150.0_linux-amd64.tar.gz. Debug builds, symbol files, packages (.deb, .rpm, .msi, .pkg) and signatures are never picked.

When two files score the same, the shorter name wins. Run the verbose script to see every candidate and its score.

What the server keeps

The server counts script requests per repository, platform and day, to show install numbers. Requests from browsers and crawlers don’t count, and no IP address or user agent is stored. The script itself sends nothing back. There is no telemetry and no completion ping.