Skip to content

DannyBen/eget

 
 

Repository files navigation

Eget

repocard

eget downloads and extracts prebuilt binaries from GitHub releases. Give it a repository, and it will try to find the right asset for your operating system and architecture.

For software maintainers, if you publish release archives on GitHub, eget can often install your project with a single command and no extra registry metadata.

For more in-depth documentation, see DOCS.md.

Examples

eget junegunn/fzf
eget zyedidia/micro --tag nightly
eget jgm/pandoc --to /usr/local/bin
eget ogham/exa --asset ^musl
eget --system darwin/amd64 sharkdp/fd
eget https://go.dev/dl/go1.17.5.linux-amd64.tar.gz --file go --to ~/go1.17.5
eget --all --file '*' ActivityWatch/activitywatch

Install

Using the setup script:

curl -Ls get.dannyb.co/eget/setup | bash

Installing manually:

Download the archive for your platform from the Releases Page.

Installing from source:

go install github.com/DannyBen/eget@latest

Usage

The TARGET argument passed to eget can be:

  • a GitHub repository in owner/repo format
  • a direct URL
  • a local archive or file

If eget downloads an asset named xxx and a matching xxx.sha256 or xxx.sha256sum asset exists, it will verify the checksum automatically.

When installing an executable, eget writes to the current directory by default. If EGET_BIN is set, it writes there instead.

GitHub limits unauthenticated API requests to 60 per hour. To raise that limit, set GITHUB_TOKEN or EGET_GITHUB_TOKEN. If both are set, EGET_GITHUB_TOKEN takes precedence. A token value may also be loaded from a file by using @/path/to/file.

Usage:
  eget [OPTIONS] TARGET

Application Options:
  -t, --tag=           tagged release to use instead of latest
      --pre-release    include pre-releases when fetching the latest version
      --source         download the source code for the target repo instead of a release
      --to=            move to given location after extracting
  -s, --system=        target system to download for (use "all" for all choices)
  -f, --file=          glob to select files for extraction
      --all            extract all candidate files
  -q, --quiet          only print essential output
  -d, --download-only  stop after downloading the asset (no extraction)
      --upgrade-only   only download if release is more recent than current version
  -a, --asset=         download a specific asset containing the given string; can be specified multiple times for additional filtering; use ^ for anti-match
      --sha256         show the SHA-256 hash of the downloaded asset
      --verify-sha256= verify the downloaded asset checksum against the one provided
      --rate           show GitHub API rate limiting information
  -r, --remove         remove the given file from $EGET_BIN or the current directory
  -v, --version        show version information
  -h, --help           show this help message
  -D, --download-all   download all projects defined in the config file
  -k, --disable-ssl    disable SSL verification for download

Configuration

eget can be configured using a TOML file located at ~/.eget.toml, the OS-specific XDG config location, the same directory as the binary, or the path set in EGET_CONFIG.

Sections can be named either global or "owner/repo".

[global]
target = "~/bin"

["zyedidia/micro"]
target = "~/.local/bin"

Example:

[global]
    github_token = "ghp_1234567890"
    quiet = false
    show_hash = false
    upgrade_only = true
    target = "./test"

["zyedidia/micro"]
    upgrade_only = false
    show_hash = true
    asset_filters = [ "static", ".tar.gz" ]
    target = "~/.local/bin/micro"

With that configuration, this is enough:

eget zyedidia/micro

Without it:

export EGET_GITHUB_TOKEN=ghp_1234567890
eget zyedidia/micro --to ~/.local/bin/micro --sha256 --asset static --asset .tar.gz

Uninstall

curl -Ls get.dannyb.co/eget/uninstall | bash

Development

Local commands:

  • make build builds the binary for the current platform.
  • make test runs the integration-style test harness.
  • make eget.1 generates the man page and requires pandoc.

Release flow for this fork:

  • Push a version tag such as v1.3.5.
  • GitHub Actions runs CI.
  • The release workflow runs GoReleaser and publishes archives and checksums to GitHub Releases.

FAQ

How is this different from a package manager?

eget downloads prebuilt binaries uploaded by project maintainers. It does not maintain a package registry, solve dependencies, or install system-wide unless you ask it to.

Does Eget keep track of installed binaries?

eget will check the existing file when --upgrade-only is used, and download if the GitHub release is newer than the binary on your file system.

Is using Eget safe?

eget does not provide security guarantees beyond the normal process of downloading executables from GitHub. It automates selection, downloading, extraction, and optional checksum verification.

What repositories can Eget install from?

At the moment eget supports GitHub releases, direct URLs, and local files.

How can I make my releases compatible with Eget?

eget works out of the box with many GitHub release layouts, but compatibility is best when you:

  • provide prebuilt binaries as GitHub release assets
  • include OS_Arch in archive names
  • publish optional *.sha256 files
  • keep one executable or appimage per target archive
  • use .tar.gz, .tar.bz2, .tar.xz, .tar, .zip, or direct compressed binaries

About

Easily install prebuilt binaries from GitHub.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • Go 92.8%
  • Shell 6.1%
  • Makefile 1.1%