百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dra

> 开发工具
开源

一个命令行工具,用于从 GitHub 下载发行资产

350 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个命令行工具,用于从 GitHub 下载发行资产

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 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
  • Download and install assets, with support for the most common formats (e.g. tar/zip archives, deb/rpm packages...)

Installation

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 `` 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.

bash
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/devmatteini/dra/refs/heads/main/install.sh | bash -s -- --to 

Debian-based distributions

Download the latest .deb package from the release page and install it via:

bash
sudo dpkg -i dra_x.y.z_amd64.deb # adapt version number

Arch Linux

dra can be installed from the community repository:

bash
pacman -S dra

macOS/Linux with Homebrew

dra can be installed from Homebrew:

bash
brew install dra

From source

bash
git clone https://github.com/devmatteini/dra && cd dra
make release
./target/release/dra --version

Update dra

The method to update dra depends 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

  • Linux (Note that you can't replace a binary while it's executing)
    bash
    dra download -a -i -o dra-new devmatteini/dra && mv dra-new /path/to/dra
  • macOS
    bash
    dra download -a -i -o /path/to/dra devmatteini/dra
  • Windows (Note that you can't replace a binary while it's executing)
    bash
    dra download -a -i -o dra-new.exe devmatteini/dra && mv dra-new.exe /path/to/dra.exe

Option 2: Use the automated bash script

Follow the installation instructions on how to use the automated bash script

Usage

  • Download assets with interactive mode
  • Download assets with non-interactive mode
  • Download options
  • Install assets
  • Authentication
  • Shell completion
  • Examples

Interactive download

Manually select and download an asset from a repository

bash
dra download devmatteini/dra-tests

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

bash
# 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

Select and download the first asset that matches a given pattern

bash
dra download --select  devmatteini/dra-tests

You can pass one of the following patterns:

Literal

The exact name of the asset.

bash
dra download --select helloworld.tar.gz devmatteini/dra-tests
Untagged

A version-free pattern of your asset. Most of the time, this is the pattern you will use.

It's useful when release assets contain the release tag in their name, and you want a stable pattern to download across different releases.

First, you need to generate an untagged asset name:

bash
dra untag devmatteini/dra-tests
# Output: helloworld_{tag}.tar.gz

Copy the output and run:

bash
dra download --select "helloworld_{tag}.tar.gz" devmatteini/dra-tests
Wildcard

A wildcard pattern, using * and/or ? special characters.

It's useful when release assets contain sections that change for each release (e.g. a build number or timestamp).

bash
dra download --select 'helloworld*_amd64.deb' 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

bash
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

bash
dra download --tag 0.1.1 devmatteini/dra-tests

Select and download source code archives

bash
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)

bash
dra download --install devmatteini/dra-tests

Supported assets that can be installed are:

  • Debian packages (requires elevated privileges)
  • RPM 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 option when a tar/zip archive contains many executables or when dra can't automatically detect which one to install:

bash
dra download -s helloworld-many-executables-unix.tar.gz -I helloworld-v2 devmatteini/dra-tests

You can also specify this option multiple times to install multiples executables

bash
dra download -s helloworld-many-executables-unix.tar.gz -I helloworld-v2 -I random-script devmatteini/dra-tests

Authentication

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:

  1. DRA_GITHUB_TOKEN
  2. GITHUB_TOKEN
  3. 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

Shell completion

Generate shell completion

bash
dra completion bash > dra-completion
source dra-completion

See all supported shell with dra completion -h

Examples

Install an executable from a tar archive

bash
dra download -s helloworld.tar.gz -i devmatteini/dra-tests
./helloworld

Install and move the executable to a custom directory

bash
dra download -a -i -o ~/.local/bin/ devmatteini/dra-tests
~/.local/bin/helloworld

Install an executable file

bash
dra download -s helloworld-unix -i devmatteini/dra-tests
./helloworld-unix

Install an executable from a compressed file

bash
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)

bash
dra download -s helloworld-unix -i -o helloworld devmatteini/dra-tests
./helloworld

Install a specific executable when many are available

bash
dra download -s helloworld-many-executables-unix.tar.gz -I helloworld-v2 devmatteini/dra-tests
./helloworld-v2

Install multiple executables from a tar/zip archive

bash
dra download -s helloworld-many-executables-unix.tar.gz -I helloworld-v2 -I random-script devmatteini/dra-tests
./helloworld-v2
./random-script

For more information on args/flags/options/commands run:

bash
dra --help
dra  --help

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

dra is made available under the terms of the MIT License.

See the LICENSE file for license details.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustautomationclicommand-linegithub-releases

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具