dra is available on Linux (x86_64, armv6, arm64), macOS (x86_64, arm64) and Windows.
Prebuilt binaries
Download the prebuilt versions of dra for all supported platforms from
the latest release.
You can use this bash script to automatically download the latest release across all supported platforms.
Replace <DESTINATION> with the path where you want to place dra (e.g ~/.local/bin).
If you omit --to option, the default value is the current working directory.
Automatically select and download an asset based on your operating system and architecture
# you can use -a or --automatic
dra download -a devmatteini/dra-tests
[!IMPORTANT]
Since there is no naming convention for release assets,
be aware that this mode may fail if no asset matches your system based on dra rules for recognizing an asset.
Selection
First, you need to generate an untagged asset name:
# use this command in your scripts
dra download --select "helloworld_{tag}.tar.gz" devmatteini/dra-tests
Download options
All dra-download options works with both interactive and non-interactive modes.
Select and download an asset to custom path
dra download --output /tmp/dra-example devmatteini/dra-tests
# or save to custom directory path
dra download --output ~/Downloads devmatteini/dra-tests
Select and download an asset from a specific release
dra download --tag 0.1.1 devmatteini/dra-tests
Select and download source code archives
dra download devmatteini/dra-tests
Release tag is 0.1.5
? Pick the asset to download ›
helloworld_0.1.5.tar.gz
❯ Source code (tar.gz)
Source code (zip)
Install assets
Download and install an asset (on both interactive and non-interactive modes)
dra download --install devmatteini/dra-tests
Supported assets that can be installed are:
Debian packages (requires elevated privileges)
Tar archives with executable(s)
Zip files with executable(s)
7-Zip files with executable(s) (requires 7z cli to be installed and in your PATH)
Compressed executable files
Executable files
AppImage files
You can use -I/--install-file <INSTALL_FILE> option when a tar/zip archive contains many executables or
when dra can’t automatically detect which one to install:
In order to download assets from private repositories and avoid rate limit
issues (60 requests per hour
is the default for unauthenticated users), dra must make authenticated requests to GitHub.
You can create
a personal access token
and then export one of the following environment variables:
DRA_GITHUB_TOKEN
GITHUB_TOKEN
GH_TOKEN
If none of the above environment variables are set,
the GitHub cli token (if available) will be used as default value.
You need to install GitHub cli and then run gh auth login.
Disable authentication
If you would like to disable GitHub authentication, you can export the environment variable
DRA_DISABLE_GITHUB_AUTHENTICATION=true
If you find a bug in the source code, you can help us
by submitting an issue to our GitHub Repository. Even
better, you can submit a Pull Request with a fix.
Missing a Feature?
You can request a new feature
by submitting a discussion to
our GitHub Repository.
If you would like to implement a new feature, please consider the size of the change and reach out to
better coordinate our efforts and prevent duplication of work.
License
dra is made available under the terms of the MIT License.
DRA - Download Release Assets from GitHub
A command line tool to download release assets from GitHub.
Why should I use dra? • Installation • Usage • Contributing • License
Why should I use dra?
You can do everything
dradoes with the official GitHub cli.drahelps you download release assets more easily:ghwithout authentication)ghyou need to provide glob pattern that you need to create manually).Installation
drais available on Linux (x86_64, armv6, arm64), macOS (x86_64, arm64) and Windows.Prebuilt binaries
Download the prebuilt versions of
drafor all supported platforms from the latest release.You can use this
bashscript to automatically download the latest release across all supported platforms. Replace<DESTINATION>with the path where you want to place dra (e.g~/.local/bin). If you omit--tooption, the default value is the current working directory.Debian-based distributions
Download the latest
.debpackage from the release page and install it via:Arch Linux
dracan be installed from the community repository:macOS/Linux with Homebrew
dracan be installed from Homebrew:From source
Update dra
The method to update
dradepends on how you initially installed it.If you used a package manager (e.g Homebrew or pacman), use the corresponding package manager commands to update
dra.If you downloaded a prebuilt binary from GitHub Releases, you have two options:
Option 1: Use dra to update itself
Option 2: Use the automated bash script
Follow the installation instructions on how to use the automated bash script
Usage
Interactive download
Manually select and download an asset from a repository
Non-Interactive download
This mode is useful to be used in automated scripts.
There are two modes to download assets: automatic and selection.
Automatic
Automatically select and download an asset based on your operating system and architecture
Selection
First, you need to generate an untagged asset name:
Copy the output and run:
Download options
All
dra-downloadoptions works with both interactive and non-interactive modes.Select and download an asset to custom path
Select and download an asset from a specific release
Select and download source code archives
Install assets
Download and install an asset (on both interactive and non-interactive modes)
Supported assets that can be installed are:
7zcli to be installed and in yourPATH)You can use
-I/--install-file <INSTALL_FILE>option when a tar/zip archive contains many executables or whendracan’t automatically detect which one to install:You can also specify this option multiple times to install multiples executables
Authentication
In order to download assets from private repositories and avoid rate limit issues (60 requests per hour is the default for unauthenticated users),
dramust make authenticated requests to GitHub.You can create a personal access token and then export one of the following environment variables:
DRA_GITHUB_TOKENGITHUB_TOKENGH_TOKENIf none of the above environment variables are set, the GitHub cli token (if available) will be used as default value. You need to install GitHub cli and then run
gh auth login.Disable authentication
If you would like to disable GitHub authentication, you can export the environment variable
DRA_DISABLE_GITHUB_AUTHENTICATION=trueShell completion
Generate shell completion
See all supported shell with
dra completion -hExamples
Install an executable from a tar archive
Install and move the executable to a custom directory
Install an executable file
Install an executable from a compressed file
Install and rename the executable (useful when downloading an executable or compressed file)
Install a specific executable when many are available
Install multiple executables from a tar/zip archive
For more information on args/flags/options/commands run:
Contributing
Take a look at the CONTRIBUTING.md guidelines.
Found a Bug?
If you find a bug in the source code, you can help us by submitting an issue to our GitHub Repository. Even better, you can submit a Pull Request with a fix.
Missing a Feature?
You can request a new feature by submitting a discussion to our GitHub Repository. If you would like to implement a new feature, please consider the size of the change and reach out to better coordinate our efforts and prevent duplication of work.
License
drais made available under the terms of the MIT License.See the LICENSE file for license details.