Code Monkey home page Code Monkey logo

eget's Introduction

Eget: easy pre-built binary installation

Go Report Card Release MIT License

Eget is the best way to easily get pre-built binaries for your favorite tools. It downloads and extracts pre-built binaries from releases on GitHub. To use it, provide a repository and Eget will search through the assets from the latest release in an attempt to find a suitable prebuilt binary for your system. If one is found, the asset will be downloaded and Eget will extract the binary to the current directory. Eget should only be used for installing simple, static prebuilt binaries, where the extracted binary is all that is needed for installation. For more complex installation, you may use the --download-only option, and perform extraction manually.

Eget Demo

For software maintainers, if you provide prebuilt binaries on GitHub, you can list eget as a one-line method for users to install your software.

Eget has a number of detection mechanisms and should work out-of-the-box with most software that is distributed via single binaries on GitHub releases. First try using Eget on your software, it may already just work. Otherwise, see the FAQ for a clear set of rules to make your software compatible with Eget.

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

Examples

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

How to get Eget

Before you can get anything, you have to get Eget. If you already have Eget and want to upgrade, use eget zyedidia/eget.

Quick-install script

curl -o eget.sh https://zyedidia.github.io/eget.sh
shasum -a 256 eget.sh # verify with hash below
bash eget.sh

Or alternatively (less secure):

curl https://zyedidia.github.io/eget.sh | sh

You can then place the downloaded binary in a location on your $PATH such as /usr/local/bin.

To verify the script, the sha256 checksum is 0e64b8a3c13f531da005096cc364ac77835bda54276fedef6c62f3dbdc1ee919 (use shasum -a 256 eget.sh after downloading the script).

One of the reasons to use eget is to avoid running curl into bash, but unfortunately you can't eget eget until you have eget.

Homebrew

brew install eget

Chocolatey

choco install eget

Pre-built binaries

Pre-built binaries are available on the releases page.

From source

Install the latest released version:

go install github.com/zyedidia/eget@latest

or install from HEAD:

git clone https://github.com/zyedidia/eget
cd eget
make build # or go build (produces incomplete version information)

A man page can be generated by cloning the repository and running make eget.1 (requires pandoc). You can also use eget to download the man page: eget -f eget.1 zyedidia/eget.

Usage

The TARGET argument passed to Eget should either be a GitHub repository, formatted as user/repo, in which case Eget will search the release assets, a direct URL, in which case Eget will directly download and extract from the given URL, or a local file, in which case Eget will extract directly from the local file.

If Eget downloads an asset called xxx and there also exists an asset called xxx.sha256 or xxx.sha256sum, Eget will automatically verify that the SHA-256 checksum of the downloaded asset matches the one contained in that file, and abort installation if a mismatch occurs.

When installing an executable, Eget will place it in the current directory by default. If the environment variable EGET_BIN is non-empty, Eget will place the executable in that directory.

Directories can also be specified as files to extract, and all files within them will be extracted. For example:

eget https://go.dev/dl/go1.17.5.linux-amd64.tar.gz --file go --to ~/go1.17.5

GitHub limits API requests to 60 per hour for unauthenticated users. If you would like to perform more requests (up to 5,000 per hour), you can set up a personal access token and assign it to an environment variable named either GITHUB_TOKEN or EGET_GITHUB_TOKEN when running Eget. If both are set, EGET_GITHUB_TOKEN will take precedence. Eget will read this variable and send the token as authorization with requests to GitHub. It is also possible to read the token from a file by using @/path/to/file as the token value.

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 or it will fallback to the expected XDG_CONFIG_HOME directory of your os. Alternatively, the configuration file can be located in the same directory as the Eget binary or the path specified with the environment variable EGET_CONFIG.

Both global settings can be configured, as well as setting on a per-repository basis.

Sections can be named either global or "owner/repo", where owner and repo are the owner and repository name of the target repository (not that the owner/repo format is quoted).

For example, the following configuration file will set the --to flag to ~/bin for all repositories, and will set the --to flag to ~/.local/bin for the zyedidia/micro repository.

[global]
target = "~/bin"

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

Available settings - global section

Setting Related Flag Description Default
github_token N/A GitHub API token to use for requests ""
all --all Whether to extract all candidate files. false
download_only --download-only Whether to stop after downloading the asset (no extraction). false
download_source --source Whether to download the source code for the target repo instead of a release. false
file --file The glob to select files for extraction. *
quiet --quiet Whether to only print essential output. false
show_hash --sha256 Whether to show the SHA-256 hash of the downloaded asset. false
system --system The target system to download for. all
target --to The directory to move the downloaded file to after extraction. .
upgrade_only --upgrade-only Whether to only download if release is more recent than current version. false

Available settings - repository sections

Setting Related Flag Description Default
all --all Whether to extract all candidate files. false
asset_filters --asset An array of partial asset names to filter the available assets for download. []
download_only --download-only Whether to stop after downloading the asset (no extraction). false
download_source --source Whether to download the source code for the target repo instead of a release. false
file --file The glob to select files for extraction. *
quiet --quiet Whether to only print essential output. false
show_hash --sha256 Whether to show the SHA-256 hash of the downloaded asset. false
system --system The target system to download for. all
target --to The directory to move the downloaded file to after extraction. .
upgrade_only --upgrade-only Whether to only download if release is more recent than current version. false
verify_sha256 --verify-sha256 Verify the sha256 hash of the asset against a provided hash. ""

Example configuration

[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"

By using the configuration above, you could run the following command to download the latest release of micro:

eget zyedidia/micro

Without the configuration, you would need to run the following command instead:

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

FAQ

How is this different from a package manager?

Eget only downloads pre-built binaries uploaded to GitHub by the developers of the repository. It does not maintain a central list of packages, nor does it do any dependency management. Eget does not "install" executables by placing them in system-wide directories (such as /usr/local/bin) unless instructed, and it does not maintain a registry for uninstallation. Eget works best for installing software that comes as a single binary with no additional files needed (CLI tools made in Go, Rust, or Haskell tend to fit this description).

Does Eget keep track of installed binaries?

Eget does not maintain any sort of manifest containing information about installed binaries. In general, Eget does not maintain any state across invocations. However, Eget does support the --upgrade-only option, which will first check EGET_BIN to determine if you have already downloaded the tool you are trying to install -- if so it will only download a new version if the GitHub release is newer than the binary on your file system.

Is this secure?

Eget does not run any downloaded code -- it just finds executables from GitHub releases and downloads/extracts them. If you trust the code you are downloading (i.e. if you trust downloading pre-built binaries from GitHub) then using Eget is perfectly safe. If Eget finds a matching asset ending in .sha256 or .sha256sum, the SHA-256 checksum of your download will be automatically verified. You can also use the --sha256 or --verify-sha256 options to manually verify the SHA-256 checksums of your downloads (checksums are provided in an alternative manner by your download source).

Does this work only for GitHub repositories?

At the moment Eget supports searching GitHub releases, direct URLs, and local files. If you provide a direct URL instead of a GitHub repository, Eget will skip the detection phase and download directly from the given URL. If you provide a local file, Eget will skip detection and download and just perform extraction from the local file.

How can I make my software compatible with Eget?

Eget should work out-of-the-box with many methods for releasing software, and does not require that you build your release process for Eget in particular. However, here are some rules that will guarantee compatibility with Eget.

  • Provide your pre-built binaries as GitHub release assets.
  • Format the system name as OS_Arch and include it in every pre-built binary name. Supported OSes are darwin/macos, windows, linux, netbsd, openbsd, freebsd, android, illumos, solaris, plan9. Supported architectures are amd64, i386, arm, arm64, riscv64.
  • If desired, include *.sha256 files for each asset, containing the SHA-256 checksum of each asset. These checksums will be automatically verified by Eget.
  • Include only a single executable or appimage per system in each release archive.
  • Use .tar.gz, .tar.bz2, .tar.xz, .tar, or .zip for archives. You may also directly upload the executable without an archive, or a compressed executable ending in .gz, .bz2, or .xz.

Does this work with monorepos?

Yes, you can pass a tag or tag identifier with the --tag TAG option. If no tag exactly matches, Eget will look for the latest release with a tag that contains TAG. So if your repository contains releases for multiple different projects, just pass the appropriate tag (for the project you want) to Eget, and it will find the latest release for that particular project (as long as releases for that project are given tags that contain the project name).

Contributing

If you find a bug, have a suggestion, or something else, please open an issue for discussion. I am sometimes prone to leaving pull requests unmerged, so please double check with me before investing lots of time into implementing a pull request. See DOCS.md for more in-depth documentation.

eget's People

Contributors

daylinmorgan avatar dufferzafar avatar hhromic avatar ksz16 avatar larsks avatar masta99wrfvshsa avatar neersighted avatar patinthehat avatar zyedidia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eget's Issues

Panic trying to install zip packages

❯ eget procs-v0.11.13-x86_64-lnx.zip
procs-v0.11.13-x86_64-lnx.zip
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
main.(*ZipArchive).ReadAll(0xc000016110?)
        github.com/zyedidia/eget/archive.go:91 +0x1a8
main.(*ArchiveExtractor).Extract(0xc000028040, {0xc000600000, 0x22de88, 0x3ffe00}, 0x0)
        github.com/zyedidia/eget/extract.go:179 +0x389
main.main()
        github.com/zyedidia/eget/eget.go:327 +0xab4

This happens with the new version 1.0.0, 0.3.1 works fine.

Verify SHA-256 checksums automatically

If downloading asset xxx and there is also an asset called xxx.sha256 or xxx.sha256sum, Eget should automatically verify the checksum. Eget should also have an additional flag --verify-sha256=sum which verifies the downloaded checksum against a checksum passed at the command line.

[Bug] Release `v1.1.0`'s version number is incorrect when downloading source

The version number that is displayed when running eget -v on version v1.1.0 shows the wrong version when building with go build or go install.

Steps to reproduce

Method 1

Run:

go install github.com/zyedidia/[email protected]

Method 2

Download the latest release (v1.1.0) zip on the releases page.
Then, navigate to the directory with the zip file in it, and run:

unzip eget-1.1.0.zip
cd eget-1.1.0/
go install

Result

Regardless of which method you used, run:

~/go/bin/eget -v

Output

eget version 1.0.1+src

Expected Output

eget version 1.1.0+src

How to fix

It looks like the version number wasn't updated in version.go. This should be able to be resolved by releasing a new v1.1.1 release with the version number set correctly.

See also #31.

Feature: Add instructions for maintainers

It would be great to add instructions for maintainers on how to structure releases to be perfectly compatible with eget.

I, myself would love to support eget as a stupidly simple one-line install. But I dont see what I need to change to make this happen. Some documentation would be great!

Also, as a sidenote: How did you create the GIF in the readme?

eget can't update itself

sudo /usr/local/bin/eget --to /usr/local/bin zyedidia/eget
https://github.com/zyedidia/eget/releases/download/v0.3.1/eget-0.3.1-linux_amd64.tar.gz
Downloading 100% [==========================================================================================================] (2.2/2.2 MB, 3.381 MB/s)
open /usr/local/bin/eget: text file busy

The error message is the same when you're trying to copy a file to a target in use. cp has a parameter --force to force overwriting files in use. Could eget do the same?

select asset finds two candidates

Projects often provide musl and standard (non-musl) packages. I would like to download the non-musl package but the asset string matches both (see below).

Is there a way to avoid prompting? Maybe by accepting a regular expression (like bat_.+amd64\.deb) for the matching string?

> eget --asset amd64.deb sharkdp/bat
2 candidates found for asset `amd64.deb`: please select manually
(1) bat-musl_0.18.3_amd64.deb
(2) bat_0.18.3_amd64.deb

Feature Request: allow outputting to STDOUT so `eget` becomes a pipeable tool

Would be great if eget could stream the downloaded (in the case of --download-only) or extracted file to STDOUT somehow. This could happen either via a --stdout flag or by allowing --to to take "/dev/stdout" (which currently fails).

e.g. I want to install hostctl, but it is only available (for my system) as a ".deb" file. Currently, I can mktemp to get a safe temp file, download the file to the temp filename (using --to), run it through dpkg, then delete the temp ".deb" file. If eget could just stream the downloaded/extracted file to STDOUT, I could simply:

eget guumaster/hostctl --stdout | sudo dpkg --install /dev/stdin

... with no need for prior prep or cleanup after.


(This also seems like a more extensible solution that adding apt/deb/yum/etc install options, as I've seen suggested elsewhere, FWIW.)

usage of asset_filter breaks target

With the following simple config file

[global]
  target = "~/bin"
  upgrade_only = true

the command eget neovim/neovim downloads the appimage and places it in ~/bin.

But when I add

["neovim/neovim"]
   asset_filters = "nvim.appimage"

the download ends up in ./ (i.e. the current directory).

Allow downloading multiple assets from the same repository

The operator-sdk project (https://github.com/operator-framework/operator-sdk) includes multiple binaries in each release:

  • ansible-operator
  • helm-operator
  • operator-sdk

I'd like to be able to download all of them, but this doesn't work:

eget operator-framework/operator-sdk \
  -a operator-sdk_linux_amd64 \
  -a ansible-operator_linux_amd64

Nor does this:

eget operator-framework/operator-sdk -a operator-sdk_linux_amd64
eget operator-framework/operator-sdk -a ansible-operator_linux_amd64

upgrade-only failure

seems using --to breaks --upgrade-only:

$ eget --upgrade-only --to=$HOME/bin zyedidia/eget

re-downloads eget (unless I already am in $HOME/bin)

Improve binary name detection for --upgrade-only

Thanks for --upgrade-only. It's a step in the right direction.

However it fails to work when the last component of the repo is different from the binary name.

Case in point:

❯ agrind --version
ag 0.18.0

❯ ls -lah agrind
-rwxr-xr-x 1 szafar infra 140M May 29 20:15 agrind

# The binary is already latest, but eget starts downloading.

❯ eget --upgrade-only rcoh/angle-grinder -a musl
https://github.com/rcoh/angle-grinder/releases/download/v0.18.0/agrind-x86_64-unknown-linux-musl.tar.gz

# This is because it is trying to find a binary called "angle-grinder", which doesn't exist.

# At first I thought, -f would work, but it doesn't
❯ eget --upgrade-only rcoh/angle-grinder -a musl -f agrind
https://github.com/rcoh/angle-grinder/releases/download/v0.18.0/agrind-x86_64-unknown-linux-musl.tar.gz

And now that I think about it, -f should not be used for this functionality.

We could use another switch for it perhaps? -b isn't used yet, -a for asset, -b for binary?

This would help in cases where we rename binaries from the packages, for eg. releases of GDU: https://github.com/dundee/gdu/ usually have binaries with long name like: gdu_linux_amd64_static, which I manually rename to gdu via mv gdu* gdu.

So, I guess for eget, something like this should work: eget --upgrade-only dundee/gdu -a static -b gdu

Install deb packages automatically

Using latest version of Eget on Ubuntu 21.10.

❯ eget --asset=deb --asset=amd64 cli/cli
https://github.com/cli/cli/releases/download/v2.11.3/gh_2.11.3_linux_amd64.deb
Downloading 100% [======================] (7.7/7.7 MB, 44.170 MB/s)        
Extracted `gh_2.11.3_linux_amd64.deb` to `gh_2.11.3_linux_amd64.deb`

In this scenario, it would be nice if Eget could automatically do the equivalent of sudo dpkg -i ./gh_2.11.3_linux_amd64.deb && rm ./gh_2.11.3_linux_amd64.deb.

Cheers

Feature: a flag to download pre release versions

I don't know how possible this is, if you are using the GitHub API like I have for my own scripts, then there isn't a direct way to get the latest pre release, in the way that getting the latest release is built in.

This can be manually worked around using a tag (if the repo has provided it) but a direct way could be nice

Use eget to update eget

Eget can't update itself!

❯ eget -v
eget version 0.2.0

❯ eget zyedidia/eget --to /apps/bin
https://github.com/zyedidia/eget/releases/download/v1.0.1/eget-1.0.1-linux_amd64.tar.gz
Downloading 100% [===========================================================] (2.2/2.2 MB, 1.657 MB/s)        
open /apps/bin/eget: text file busy

So I use a workaround:

❯ eget zyedidia/eget --to /tmp                       
https://github.com/zyedidia/eget/releases/download/v1.0.1/eget-1.0.1-linux_amd64.tar.gz
Downloading 100% [===========================================================] (2.2/2.2 MB, 756.315 kB/s)        
Extracted `eget-1.0.1-linux_amd64/eget` to `/tmp/eget`

❯ mv /tmp/eget /apps/bin/

❯ eget -v
eget version 1.0.1

cli argument flag processing disregarding flag values

Can't grok logic for the returns asset choices

command in question

$ eget --asset=.tar.gz --system=linux/amd64 neovim/neovim

4 candidates found for asset .tar.gz
please select manually:
  (1) nvim-linux64.tar.gz
  (2) nvim-linux64.tar.gz.sha256sum
  (3) nvim-macos.tar.gz
  (4) nvim-macos.tar.gz.sha256sum
Enter selection number:

The above command and subsequently returned choices strikes me to believe that:

  1. This is a bug in the processing of CLI flags that disregards previous flag
    values and returns results that should have been filtered out.

ex. I specify criteria of .tar.gz assets for Linux, but eget returned
darwin assets that don't satisfy criteria.

Happy to fix this, but wanted to get confirmation before doing needful.

  1. Somewhat quirky behavior which I am guilty of glossing over when reading
    through documentation. If this is the case, could you ELI5 the design choices
    around parsing CLI arguments and another hypothetical scenario that explains
    returned asset choices?

cli/cli: too many candidates found

Using latest version of Eget on Ubuntu 21.10.

❯ eget --asset=deb cli/cli
4 candidates found for asset `deb`: please select manually
(1) gh_2.11.3_linux_386.deb
(2) gh_2.11.3_linux_amd64.deb
(3) gh_2.11.3_linux_arm64.deb
(4) gh_2.11.3_linux_armv6.deb
Enter selection number: ^C

❯ eget --asset=deb --system=amd64 cli/cli
4 candidates found for asset `deb`: please select manually
(1) gh_2.11.3_linux_386.deb
(2) gh_2.11.3_linux_amd64.deb
(3) gh_2.11.3_linux_arm64.deb
(4) gh_2.11.3_linux_armv6.deb
Enter selection number: ^C

❯ eget --asset=deb --system=linux/amd64 cli/cli
4 candidates found for asset `deb`: please select manually
(1) gh_2.11.3_linux_386.deb
(2) gh_2.11.3_linux_amd64.deb
(3) gh_2.11.3_linux_arm64.deb
(4) gh_2.11.3_linux_armv6.deb
Enter selection number: ^C

I'd expect Eget to detect which package to download in all of the above cases.

Cheers, and thanks for your work !

Add a "tag pattern" parameter for repositories that host multiple packages

I'd like to install kustomize from https://github.com/kubernetes-sigs/kustomize/releases, but this fails:

$ eget kubernetes-sigs/kustomize --to ~/bin
no candidates found

If I specify an explicit tag it works:

$ eget kubernetes-sigs/kustomize --to ~/bin/ -t kustomize/v4.5.7
https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.5.7/kustomize_v4.5.7_linux_amd64.tar.gz
Downloading 100% [=============================================================================================================================================================] (5.5/5.5 MB, 14.692 MB/s)
Extracted `kustomize` to `/home/lars/bin/kustomize`

It would be nice for this sort of repository if I could specify a tag pattern, so that I could run something like:

$ eget kubernetes-sigs/kustomize --to ~/bin --tag-pattern 'kustomize/.*'

And have eget get the latest release that matches the given tag pattern.

Error using --download-only

> eget --download-only --asset amd64.deb zyedidia/micro
https://github.com/zyedidia/micro/releases/download/v2.0.10/micro-2.0.10-amd64.deb
Downloading 100% [==========================================================================================================================] (4.3/4.3 MB, 13.197 MB/s)
open .: is a directory

[Bug] the soft links were not extracted

I am using the following command to install prebuilt nodejs

eget https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.xz -f node-v16.15.0-linux-x64 --to $XDG_DATA_HOME/node

and I have added the $XDG_DATA_HOME/node/bin into the $PATH.

However, the soft links such as npm and npx at node-v16.15.0-linux-x64/bin/ were not extracted.

upgrade_only glitches

The following config file

[global]
  target = "~/bin"
  upgrade_only = true

["fatedier/frp"]
   all = true

["zyedidia/eget"]

["zyedidia/micro"]

used with the command eget -D will re-download frpc and frps every time.

Same is, when all = true is replaced with file = "frpc". (OK, not exactly the same, as only frpc is downloaded).

eget-1.0.0-linux_amd64 incompatible with Citrix Hypervisor

eget --version
eget: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by eget)

lsb_release -sd
"Citrix Hypervisor release 8.2.0 (xenenterprise)"

Previous version 0.3.1 worked fine. I guess a musl (or static) version would work.

403 Forbidden: API rate limit exceeded

I have got the following error :

403 Forbidden: API rate limit exceeded for 183.82.157.82. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.): https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting

Full Github URL isn't working always

This works:

eget https://github.com/natesales/q
# file q
q: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=mxYZfmW39jbfAoEkWt-g/OIPz-cV31mFntE2scAxz/trG6K7JTtKLLSe8ThtCp/nzp3wY8I98v7fTxDZkQz, stripped

But this not,

eget https://github.com/mr-karan/doggo
# file doggo 
doggo: HTML document, Unicode text, UTF-8 text, with very long lines (18275)

aarch64-linux-android does not work on a raspberry pi

Hi there, not sure if this is useful to you, but fyi;

When downloading this release with eget denisidoro/navi i get navi-v2.19.0-aarch64-linux-android.tar.gz which does not run on a pi4B.

❯ eget --version
eget version 1.0.1

 ❯ uname -a
Linux pi 5.4.0-1059-raspi #67-Ubuntu SMP PREEMPT Mon Apr 11 14:16:01 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

 ❯ dpkg --print-architecture
arm64

 ❯ cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.2

Ability to filter out matching candidates

Consider the following scenario:

❯ eget --asset=deb --asset=amd64 sharkdp/fd
2 candidates found for asset chain: please select manually
(1) fd-musl_8.4.0_amd64.deb
(2) fd_8.4.0_amd64.deb
Enter selection number: 

Here, as often in the Rust ecosystem, the binaries come as either (1) statically linked to musl (fd-musl_8.4.0_amd64.deb) or (2) dynamically linked to glibc (fd_8.4.0_amd64.deb). By common practice, when nothing is specified within the asset name, the latter is implied.

Since I encountered problems with programs linked to musl in rare occasions, I wish to prefer programs dynamically linked to glibc, when available.

Hence, I wish there was such -x | --exclude option that would allow me to --exclude=musl and thus lead me to the desired asset.

Bug: some tbz-packed binaries are not extracted correctly

Looks like binaries packed within tbz tarballs are not (always?) extracted correctly. As an example, see the btop tool. On issuing an eget aristocratos/btop, the correct asset for my system was identified ("btop-x86_64-linux-musl.tbz"), and a btop executable is extracted, but it is not binary-accurate and attempting to run it will result in an error.

Manually pulling the tarball via eget --download-only aristocratos/btop followed by a tar -xjf btop-x86_64-linux-musl.tbz does yield a correctly extracted binary as "bin/btop", however.

[Feature,flag suggest]direct unzip(unzip keep layout+keepallfiles)

reason
for example.eget keepassxreboot/keepassxc
what you will get is the 3 exe without any dll.
(keep all files,include exe. flag?)

if any users wants to follow the repo layout / likes to use windows C drive program files.
its a must.Imagine you do eget xxx/xxx --to "thesweetfolder"&eget yyy/yyy --to "thesweetfolder"
The next time you open the "thesweetfolder"
OMG,its keepassxc+eget+fzf+yyy+(manually installed obs)+(10 manually installed apps)
they probably need to pray for the dll being compatible.
(keep zip inner layout flag?)

I think most zip extraction api should have a -keep layout option built-in.

regex support for -a

Hi

Thanks for a great tool; makes so many things easier on various machines!

Some of my eget commands appear to be using asset filtering like -a tar.gz -a ^sig (e.g., caddyserver/caddy is one example off the top of my head).

Would be nice to be able to say -a tar.gz$. I saw some mention of regex in various issues, but they all appeared to be more about priority between --system and --asset.

Please note this is only about convenience, so I'm OK if your response is a WONTFIX, but had to ask anyway :)

Get tag from Github URL

This should work,

eget https://github.com/contour-terminal/contour/releases/tag/v0.3.2.202

Gitea support

It would be neat to use this with releases on a Gitea instance as well.

install all or provide range

Some releases provide multiple binaries, e.g.:

$ eget eBay/tsv-utils                                                                                                                    
https://github.com/eBay/tsv-utils/releases/download/v2.2.1/tsv-utils-v2.2.1_osx-x86_64_ldc2.tar.gz                                                    
Downloading 100% [===================================================================================================] (11/11 MB, 5.951 MB/s)         
14 candidates for target exe `tsv-utils` found: please select manually                                                                                
(1) tsv-utils-v2.2.1_osx-x86_64_ldc2/extras/scripts/tsv-sort                                                                                          
(2) tsv-utils-v2.2.1_osx-x86_64_ldc2/extras/scripts/tsv-sort-fast                                                                                     
(3) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-split
(4) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-select
(5) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-pretty
(6) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-join
(7) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-filter
(8) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-summarize
(9) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/keep-header
(10) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-sample
(11) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-append
(12) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/tsv-uniq
(13) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/number-lines
(14) tsv-utils-v2.2.1_osx-x86_64_ldc2/bin/csv2tsv
Enter selection number:

and I'd naturally want to install most if not all of them. Would be nice if I could select (A) All or specify a range of numbers, or multiple numbers.

How to use the file parameter?

Some repositories upload a tarball that contains multiple executables.

In such cases, eget picks up the first one it finds.

Can I use the --file parameter to get around this?

This is what I've tried:

> eget Canop/broot --to /spare/ssd/szafar/apps/bin
https://github.com/Canop/broot/releases/download/v1.6.6/broot_1.6.6.zip
Downloading 100% [=========================================================] (17/17 MB, 4.638 MB/s)
Extracted `build/aarch64-linux-android/broot` to `/spare/ssd/szafar/apps/bin/broot`

> eget Canop/broot --to /spare/ssd/szafar/apps/bin --file x86_64-unknown-linux-musl/broot
https://github.com/Canop/broot/releases/download/v1.6.6/broot_1.6.6.zip
Downloading 100% [=========================================================] (17/17 MB, 4.222 MB/s)
target `x86_64-unknown-linux-musl/broot` not found in archive

> eget Canop/broot --to /spare/ssd/szafar/apps/bin --file build/x86_64-unknown-linux-musl/broot
https://github.com/Canop/broot/releases/download/v1.6.6/broot_1.6.6.zip
Downloading 100% [=========================================================] (17/17 MB, 3.470 MB/s)
target `build/x86_64-unknown-linux-musl/broot` not found in archive

Add to debian/ubuntu apt

Please add eget to official repos, so it can be conveniently installed with
apt install eget

eliminating

  • wget,
  • gzip,
  • copy,
  • access right settings.

Doesn't have to be latest version, just something we can start easily download other stuff.
cheers

Add installation option

If a --install flag is provided, Eget should install the binary into $EGET_BIN, or if that is an invalid directory, ~/.eget/bin. If the install directory is not in the $PATH, Eget should give a warning.

no candidates found

Hello! Thanks for eget!
Install latest eget

eget version 1.0.1

I try install terraform

 ./eget hashicorp/terraform --to /usr/local/bin

But get error:

no candidates found

Feature request: download only if hash doesn't match

I'm downloading packages for later installation (eget --download-only zyedidia/eget). This downloads the same file every time it's executed even if there is no newer version (which I cannot know in advance).

Would it be possible to only download the file if the hashes of the file eget is going to download does not match the file that is already there?

Abort when reading EOF at "enter selection number" prompt

I'd like to run eget non-interactively in a script, but if I fail to fully specify something (or have a typo), eget will prompt interactively to select a package:

$ eget ogham/exa
2 matches found: please select manually
(1) exa-linux-x86_64-musl-v0.10.1.zip
(2) exa-linux-x86_64-v0.10.1.zip
Enter selection number:

I'd like to avoid this interactive prompt and have eget simply exit with an error if it can't select a single asset for download. I hoped this would work:

$ eget ogham/exa < /dev/null

But that results in:

Enter selection number: Invalid selection: EOF
Enter selection number: Invalid selection: EOF
Enter selection number: Invalid selection: EOF
Enter selection number: Invalid selection: EOF
[...ad infinitum...]

I think eget should simply abort if it receives an EOF at this prompt.

Getting dist file for Archlinux while running from Fedora

Happened here https://github.com/contour-terminal/contour/releases/tag/v0.3.2.202

eget https://github.com/contour-terminal/contour
https://github.com/contour-terminal/contour/releases/download/v0.3.2.202/contour_0.3.2.202-archlinux_x86_64
Downloading 100% [========================================================================================================================================] (1.2/1.2 MB, 557.055 kB/s)        
Extracted `contour_0.3.2.202-archlinux_x86_64` to `contour`

Should have got the .rpm

Add Chocolatey to the "How to get Eget" section in README.md

First of all, thank you very much for a development of this tool. Until now when I wanted to download binaries from GitHub in scripts I had to use a combination of curl and grep - Eget makes this task much simpler.
I thought that those miserable people using Windows (I'm kidding, of course 😃) also deserve an easy way to install Eget. So I created a package and added it to the Chocolatey Community Repository. Now Eget can be installed on Windows by running:

choco install eget

I made a pull request and added "Chocolatey" subsection to the "How to get Eget" section of README.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.