The github cli (gh) can be used for this. Here are the docs.
This is for downloading all files (github release assets) from a specific github release.
gh release list -R <username>/<repo>
gh release download <tag> -D <dest> -R <username>/<repo>
# for eg.
gh release list -R cli/cli
gh release download v2.21.2 -D gh_v2.21.2 -R cli/cli
# download all assets from latest release to gh_latest directory
gh release download -p "*" -D gh_latest -R cli/cli
Note:
If you are in a git repository, gh release download <tag>
will download all the assets from the latest release to the current directory.
No need to specify -R
-D
.
If the tag is not specified, it will download the latest release but complain that one of the -A or -p
flags is required. In such case gh release download -p "*"
can be used.
Check the examples in the docs for more.