Install
Releases are prebuilt binaries for Linux with glibc 2.34 or later (Ubuntu 22.04, Debian 12, RHEL 9 and newer) and for macOS 13 Ventura or later, on amd64 and arm64. Other platforms, Windows included, have no release build.
Install script
curl -fsSL https://retrofit.sh/install | sh
The script installs the latest release to $RETROFIT_INSTALL_DIR, else
~/.local/bin, without sudo. It checks the archive’s SHA-256 against the
release’s checksums.txt before extracting anything. Pass flags after
sh -s --:
curl -fsSL https://retrofit.sh/install | sh -s -- --version 0.10.0 # one release
curl -fsSL https://retrofit.sh/install | sh -s -- --wip # the newest WIP build
curl -fsSL https://retrofit.sh/install | sh -s -- --binary-only # no man pages or completions
--wip lists releases through the GitHub API; set GITHUB_TOKEN if that
is rate-limited.
When the install directory is a bin directory, as ~/.local/bin is, the
script also installs the man pages and the bash, zsh and fish completions.
For ~/.local/bin they go to:
- the man pages:
~/.local/share/man/man1/, wheremanfinds them throughPATH - bash:
~/.local/share/bash-completion/completions/retrofit, the per-user directory bash-completion 2 reads ($XDG_DATA_HOMEin place of~/.local/sharewhen it is set) - fish:
~/.config/fish/completions/retrofit.fish($XDG_CONFIG_HOMEin place of~/.configwhen it is set) - zsh:
~/.local/share/zsh/site-functions/_retrofit
For zsh, which has no per-user completion directory, the script prints an
fpath=(...) line to add to ~/.zshrc above compinit. When MANPATH
is set and would hide the man pages, it prints the export MANPATH=...
line to add. Under another <prefix>/bin, the man pages and the zsh file
go under <prefix>/share instead, and the bash and fish files stay in
your home directory. Any other install directory gets the binary alone,
and the script prints the URL of the archive that holds the rest (see
Manual download).
Homebrew (macOS)
brew install MonotonicHQ/tap/retrofit
The tap’s retrofit is a cask, so this is the same install as
brew install --cask MonotonicHQ/tap/retrofit. The cask also installs the
man pages, where man finds them through PATH, and the bash, zsh and
fish completions in Homebrew’s directories under $(brew --prefix):
- bash:
etc/bash_completion.d/retrofit - zsh:
share/zsh/site-functions/_retrofit - fish:
share/fish/vendor_completions.d/retrofit.fish
For zsh, _retrofit loads once $(brew --prefix)/share/zsh/site-functions
is on fpath before compinit runs. Homebrew’s
Shell Completion page says how to
set up each shell to load the completions a cask installs.
Try a WIP
A WIP is a build of every push to the wip branch, published on GitHub as
a pre-release. Its macOS binaries are signed and notarized, as a release’s
are. On Homebrew the WIP is its own cask, MonotonicHQ/tap/retrofit@wip,
which tracks the newest WIP. The two casks conflict, so one is installed at
a time: installing retrofit@wip beside retrofit fails with
Cask 'retrofit@wip' conflicts with 'retrofit', and the reverse fails the
same way. To switch, uninstall the one you have first:
brew uninstall retrofit && brew install MonotonicHQ/tap/retrofit@wip # to the WIP
brew uninstall retrofit@wip && brew install MonotonicHQ/tap/retrofit # back to the release
On Linux, the install script’s --wip installs the newest WIP, and running
the script again without it installs the latest release over it:
curl -fsSL https://retrofit.sh/install | sh -s -- --wip
Manual download
Each release has one archive per platform,
retrofit_<os>_<arch>.tar.gz, where <os> is linux or darwin and
<arch> is amd64 or arm64. An archive holds the retrofit binary,
LICENSE, THIRD_PARTY_NOTICES, a man page per command under
man/man1/, and the bash, zsh and fish completion scripts under
completions/. The release’s checksums.txt lists
the SHA-256 of every file in it, so check the line for the archive
you downloaded rather than the whole file. For the latest release on
Linux amd64:
base=https://github.com/MonotonicHQ/retrofit/releases/latest/download
curl -fsSLO "$base/retrofit_linux_amd64.tar.gz"
curl -fsSLO "$base/checksums.txt"
grep ' retrofit_linux_amd64.tar.gz$' checksums.txt | sha256sum -c # macOS: shasum -a 256 -c
tar -xzf retrofit_linux_amd64.tar.gz retrofit
mkdir -p ~/.local/bin && mv retrofit ~/.local/bin/
The snippet installs the binary alone. For the rest, extract man/man1/
and completions/ from the archive too: copy the man pages to a directory
man searches, and each completion script to a directory its shell loads
completions from. retrofit completion <shell> prints the same scripts
(see Verify).
Notes
- The directory holding the binary (
~/.local/binby default) must be onPATH, or the shell reportscommand not found. The install script prints theexport PATH=...line to add to your shell profile when it is not. - The macOS binaries are signed and notarized, but a bare binary cannot hold its notarization ticket, so its first run needs the network: Gatekeeper fetches the ticket then.
Verify
retrofit --version
man retrofit
man retrofit opens the man page the install script or the cask
installed; after a manual download it opens once you have copied the
pages. The install script and Homebrew sections above say where each put
the completions.
retrofit completion <bash|zsh|fish|powershell> prints the script for
any of the four shells, PowerShell included, to source or save (run it
with --help for install steps).