Ghdl
A much more convenient way to download GitHub release binaries on the command line, works on Win & Unix-like systems
Install / Use
/learn @yaonyan/GhdlREADME
ghdl
Memorize
ghdlasgithub download
ghdl is a fast and simple program (and also a golang module) for downloading and installing executable binary from github releases.
Features
-
Auto decompressing and unarchiving the downloaded asset (without any system dependencies like
tarorunzip)Currently supporting unarchiving `tar` and decompressing `zip` `gzip`. Package format `deb` `rpm` `apk` will be downloaded directlyghdlbinary is statically linked, works well on non-FHS *nix systems like NixOS). In case this is relevant to you, on that kind of system, only binaries likeghdlcan be run directly. -
Setups for executable:
ghdlmoves executable to specified location and add execute permissions to the file. -
Auto filtering: multiple assets in one release will be filtered by OS or ARCH. This feature can be disabled using
-Fflag. -
Interactive TUI: when auto filtering is failed or returned multiple options, you can select assets in a interactive way, with vim key bindings support.
-
Release tags:
ghdldownloads latest release by default, other or old tagged releases can be downloaded by specifying release tag:username/repo#tagname -
Inspect download status with real-time progress bar.
Installation
If you're going to use
ghdlas a go module, ignore the following installation progress.
-
Using Go tools:
go will download the latest version of ghdl to $GOPATH/bin, please make sure $GOPATH is in the PATH:
go install github.com/beetcb/ghdl/ghdl@latestNote: Just to be safe, you'd better specify CGO_ENABLED=0 when running
go installon non-FHS *nix systems like NixOS) -
Download and run executable from release.
-
Run the following shell script(*nix system only):
curl -fsSL "https://bina.egoist.sh/beetcb/ghdl?dir=/usr/local/bin" | sh # feel free to change the `dir` url param to specify the installation directory.
Usage
CLI
Run ghdl --help
❯ ghdl --help
ghdl download binary from github release
ghdl handles archived or compressed file as well
Usage:
ghdl <user/repo[#tagname]> [flags]
Flags:
-f, --asset-filter string specify regular expression for the asset name; used in conjunction with the platform and architecture filters.
-F, --filter-off turn off auto-filtering feature
-h, --help help for ghdl
-n, --name string specify binary file name to enhance filtering and extracting accuracy
-p, --path path save binary to path and add execute permission to it (default ".")
It's tedious to specify -p manually, we can alias ghdl -p "$DirInPath" to a shorthand command, then use it as a executable installer.
Go Module
-
Require
ghdlto go.modgo get github.com/beetcb/ghdl -
Use
ghdl's out-of-box utilities: see TestDownloadFdBinary func as an example
Credit
Inspired by egoist/bina, TUI powered by charmbracelet/bubbletea
License
Licensed under MIT
Author: @beetcb | Email: i@beetcb.com
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.8kCommit, push, and open a PR
