LinuxCommandLibrary

eget

Download files from the internet

TLDR

Download a prebuilt binary for the current system from a repository on GitHub

$ eget [zyedidia/micro]
copy

Download from a URL
$ eget [https://go.dev/dl/go1.17.5.linux-amd64.tar.gz]
copy

Specify the location to place the downloaded files
$ eget [zyedidia/micro] --to=[path/to/directory]
copy

Specify a Git tag instead of using the latest version
$ eget [zyedidia/micro] --tag=[v2.0.10]
copy

Install the latest pre-release instead of the latest stable version
$ eget [zyedidia/micro] --pre-release
copy

Only download the asset, skipping extraction
$ eget [zyedidia/micro] --download-only
copy

Only download if there is a newer release then the currently downloaded version
$ eget [zyedidia/micro] --upgrade-only
copy

SYNOPSIS

eget [OPTIONS] <repository> [<tag_or_version>]
eget [OPTIONS] <repository_owner>/<repository_name> [<tag_or_version>]

PARAMETERS

-o, --output <path>
    Specify the output file or directory where the downloaded asset will be saved.

-a, --asset <name>
    Download a specific asset by name. Useful when a release has multiple assets and automatic selection is not desired.

-t, --tag <tag>
    Download a specific release version identified by its Git tag (e.g., 'v1.2.3'). If omitted, the latest release is downloaded.

-x, --extract
    Automatically extract the downloaded archive (e.g., .zip, .tar.gz) after download.

-f, --force
    Force overwrite existing files at the destination path without prompting.

-p, --prerelease
    Include pre-release versions when searching for the latest release.

-k, --token <token>
    Provide a GitHub Personal Access Token for accessing private repositories or to avoid API rate limits.

-s, --source
    Download the source code archive (.zip or .tar.gz) instead of a release asset.

-u, --upgrade
    Upgrade eget itself to the latest version.

--all
    Download all assets associated with a release.

--file <path>
    Read a list of repositories (one per line) from a specified file and download assets for each.

--clone
    Clone the repository using Git instead of downloading release assets.

-v, --version
    Display the version information of eget.

-h, --help
    Show the help message and exit.

DESCRIPTION

eget is a powerful and flexible command-line utility designed for easily downloading files from GitHub releases. It streamlines the process of acquiring pre-built binaries, archives, and other assets directly from specified GitHub repositories. Unlike generic downloaders, eget intelligently identifies the correct asset for your operating system and architecture, making it ideal for fetching developer tools and applications distributed via GitHub.

It supports downloading the latest release, a specific version by tag, or a particular asset by name. eget can also handle private repositories using a GitHub Personal Access Token, and it offers features like automatic extraction of archives and overwriting existing files, significantly simplifying automation and script development involving GitHub-hosted artifacts.

CAVEATS

eget is a third-party utility and not part of standard Linux distributions' core toolsets, meaning it needs to be installed separately. It relies on the GitHub API, and frequent usage without a Personal Access Token (PAT) may lead to GitHub API rate limiting, which can temporarily prevent further downloads. Asset naming conventions by repository maintainers can sometimes lead to unexpected selections if the --asset option is not used, as eget tries to guess the correct binary for your system.

INSTALLATION

eget can often be installed by downloading its single binary from its own GitHub releases page using eget itself, or via a simple curl command. For Go users, it can also be installed using go install github.com/zyedidia/eget@latest, which builds it from source. The binary is typically self-contained, requiring no external dependencies beyond common system libraries.

ENVIRONMENT VARIABLES

eget checks for the EGET_TOKEN environment variable (or GITHUB_TOKEN) to automatically use a GitHub Personal Access Token. Setting this variable is recommended for frequent use or when downloading from private repositories, as it helps avoid GitHub API rate limits.

HISTORY

eget was created by Zac Bergquist (GitHub user zyedidia) with initial development activity observed around late 2018 / early 2019. Its primary motivation was to simplify and automate the process of downloading specific binaries or artifacts from GitHub releases, addressing a common need for developers and users who frequently acquire tools distributed in this manner, without the overhead of cloning entire Git repositories or manually browsing release pages.

SEE ALSO

wget(1), curl(1), git(1), gh(1)

Copied to clipboard