Download the latest Github release using command line

2022-01-17

Cmdline · Download · Github · Release

1 minute

For personal reference:

Download the latest GitHub Releases asset using common command line tools:

# Update the url accordingly. The `uname | awk` subcmds will output 'linux'|'darwin'.
$ curl -s https://api.github.com/repos/alphauslabs/bluectl/releases/latest | \
  jq -r ".assets[] | select(.name | contains(\"$(uname -s | awk '{print tolower($0)}')\")) | .browser_download_url" | \
  wget -i -