Installation
hostsctl is a single static binary with no runtime dependencies. Pick whichever of these fits your machine.
Homebrew
Section titled “Homebrew”brew install jtprogru/tap/hostsctlCovers macOS on Apple silicon and Intel, and Linux on x86_64 and arm64. The man page
and shell completions are installed with the formula.
crates.io
Section titled “crates.io”cargo install hostsctlBuilds from source, so it needs a Rust toolchain at or above the MSRV (see
rust-version in Cargo.toml). Completions and the man page are not installed this way —
generate them yourself if you want them:
hostsctl completions zsh > ~/.zsh/completions/_hostsctlhostsctl man > /usr/local/share/man/man1/hostsctl.1Install script
Section titled “Install script”curl -fsSL https://raw.githubusercontent.com/jtprogru/hostsctl/main/scripts/install.sh | shPOSIX sh, so it also runs in an Alpine container whose only shell is ash. It detects
the OS and architecture, picks the musl build when there is no glibc loader, verifies the
archive against the release’s checksums.txt before unpacking anything, and installs
into /usr/local/bin.
# pin a version and install somewhere elsecurl -fsSL .../install.sh | sh -s -- --version v0.1.0 --bin-dir ~/.local/binRelease archive
Section titled “Release archive”Every release publishes a .tar.gz per target on the
releases page:
| Target | Use it on |
|---|---|
aarch64-apple-darwin |
macOS, Apple silicon |
x86_64-apple-darwin |
macOS, Intel |
x86_64-unknown-linux-gnu |
Linux, glibc, x86_64 |
aarch64-unknown-linux-gnu |
Linux, glibc, arm64 |
x86_64-unknown-linux-musl |
Alpine and other musl systems, x86_64 |
aarch64-unknown-linux-musl |
Alpine and other musl systems, arm64 |
Each archive holds the binary, completions/, man/, the README and the licence.
Verifying a download
Section titled “Verifying a download”Every archive is listed in checksums.txt, signed with a keyless
cosign signature (.bundle next to it), and carries a SLSA
build-provenance attestation.
# checksumsha256sum -c checksums.txt --ignore-missing
# signaturecosign verify-blob \ --bundle hostsctl-aarch64-apple-darwin.tar.gz.bundle \ --certificate-identity-regexp 'https://github.com/jtprogru/hostsctl/.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ hostsctl-aarch64-apple-darwin.tar.gz
# provenancegh attestation verify hostsctl-aarch64-apple-darwin.tar.gz --repo jtprogru/hostsctlFrom source
Section titled “From source”git clone https://github.com/jtprogru/hostsctlcd hostsctlmake install # builds release and installs into /usr/local/binmake install PREFIX=~/.local installs elsewhere. make uninstall removes it.
Shell completions
Section titled “Shell completions”hostsctl completions bashhostsctl completions zshhostsctl completions fishhostsctl completions elvishhostsctl completions powershellWrite the output wherever your shell looks — for zsh, a directory on $fpath, with the
file named _hostsctl.