A command line tool to download release assets from GitHub.
Why should I use dra? • Installation • Usage • License
You can do everything dra
does with the official GitHub cli.
dra
helps you download release assets more easily:
- No authentication for public repository (you cannot use
gh
without authentication) - Built-in generation of pattern to select an asset to download
(with
gh
you need to provide glob pattern that you need to create manually). - Automatically select and download an asset based on your operating system and architecture
dra
is available on Linux (x86_64, armv6, arm64), macOS (x86_64, arm64) and Windows.
Download the prebuilt versions of dra
for all supported platforms from
the latest release.
Download the latest .deb
package from the release page and
install it via:
sudo dpkg -i dra_x.y.z_amd64.deb # adapt version number
dra
can be installed from the community repository:
pacman -S dra
dra
can be installed from Homebrew:
brew install dra
git clone https://github.com/devmatteini/dra && cd dra
make release
./target/release/dra --version
- Download assets with interactive mode
- Download assets with non-interactive mode
- Download options
- Install assets
- Private repositories & rate limit
- Shell completion
- Examples
Manually select and download an asset from a repository
dra download devmatteini/dra-tests
This mode is useful to be used in automated scripts.
There are two modes to download assets: automatic and selection.
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.
First, you need to generate an untagged asset name:
dra untag devmatteini/dra-tests
# output: helloworld_{tag}.tar.gz
Copy the output and run:
# use this command in your scripts
dra download --select "helloworld_{tag}.tar.gz" devmatteini/dra-tests
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)
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 yourPATH
) - Compressed executable files
- Executable files
- AppImage files
You can use --install-file <INSTALL_FILE>
option when a tar/zip archive contains many executables or
when dra
can't automatically detect which one to install:
dra download -s helloworld-many-executables-unix.tar.gz --install-file helloworld-v2 devmatteini/dra-tests
In order to download assets from private repositories (and avoid rate limit issues) export an environment
variable GITHUB_TOKEN=<token>
.
Follow the official guide to create
a personal access token.
The minimum set of scopes needed is: Full control of private repositories
.
Generate shell completion
dra completion bash > dra-completion
source dra-completion
See all supported shell with dra completion -h
Install an executable from a tar archive
dra download -s helloworld.tar.gz -i devmatteini/dra-tests
./helloworld
Install and move the executable to a custom directory
dra download -a -i -o ~/.local/bin/ devmatteini/dra-tests
~/.local/bin/helloworld
Install an executable file
dra download -s helloworld-unix -i devmatteini/dra-tests
./helloworld-unix
Install an executable from a compressed file
dra download -s helloworld-compressed-unix.bz2 -i devmatteini/dra-tests
./helloworld-compressed-unix
Install and rename the executable (useful when downloading an executable or compressed file)
dra download -s helloworld-unix -i -o helloworld devmatteini/dra-tests
./helloworld
Install a specific executable when many are available
# First download the main executable
dra download -s helloworld-many-executables-unix.tar.gz -I helloworld-v2 devmatteini/dra-tests
./helloworld-v2
# Then download another executable
dra download -s helloworld-many-executables-unix.tar.gz -I random-script devmatteini/dra-tests
./random-script
For more information on args/flags/options/commands run:
dra --help
dra <command> --help
Take a look at the CONTRIBUTING.md guide.
dra
is made available under the terms of the MIT License.
See the LICENSE file for license details.