27 releases (12 stable)

new 1.4.0 Nov 19, 2024
1.3.3 Aug 15, 2024
0.9.1 Aug 3, 2024
0.5.0 Jul 31, 2024

#470 in Command line utilities

41 downloads per month

GPL-3.0+

58KB
1K SLoC

binup

binup tries to become the last tool you'll manually install from GitHub releases. It focuses on single binary apps and allows you to automatically install and upgrade them once you specify rules of how to find each app in release files.

Here is how it works. You create ~/.config/binup/config.yaml with the following contents:

tools:
  binup:
    project: KonishchevDmitry/binup

... and run binup install command to install the specified apps or binup upgrade to upgrade already installed apps.

The tool is fully stateless: it doesn't save any information about installed binaries. Instead, is always checks the actual state of the apps: if binary is missing, it installs it. When the binary already installed, it runs it with --version argument and tries to parse its actual version to compare with the latest release. If it fails to determine the version (the tool might not have --version flag), binup relies on binary file modification time, always setting it to update time of the downloaded release archive.

Available configuration options

Here is an example config with all available configuration options:

# Path where to install the binaries (the default is ~/.local/bin)
path: /usr/local/bin

tools:
  # Binary name
  prometheus:
    # GitHub project name
    project: prometheus/prometheus

    # Changelog URL (will be printed on app upgrade)
    changelog: https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md

    # Release archive pattern:
    # * By default shell-like glob matching is used (https://docs.rs/globset/latest/globset/#syntax)
    # * Pattern started with '~' is treated as regular expression (https://docs.rs/regex/latest/regex/#syntax)
    #
    # If it's not specified, the archive will be chosen automatically according to target platform.
    release_matcher: prometheus-*.linux-amd64.tar.gz

    # Binary path to look for inside the release archive. If it's not specified, the tool will try to find it automatically.
    binary_matcher: "*/prometheus"

    # Post-install script
    post: systemctl restart prometheus

# If you have a lot of tools, you may hit GitHub API rate limits for anonymous requests at some moment.
# So it's recommended to obtain GitHub token (https://github.com/settings/tokens) and specify it here.
# No permissions are required for the token – it's needed just to make API requests non-anonymous.
github:
  token: $token

Dependencies

~29–48MB
~820K SLoC