bin - Effortless binary manager
Overview
bin is a lightweight, cross-platform binary manager that simplifies downloading, installing, and managing binaries without requiring root privileges.
bin - Effortless binary manager
Install
Linux
Installing bin on Linux:
curl -LO https://github.com/marcosnils/bin/releases/download/v0.25.3/bin_0.25.3_linux_amd64
chmod +x ./bin_0.25.3_linux_amd64
./bin_0.25.3_linux_amd64 install github.com/marcosnils/bin
# Answer the path question
rm -f ./bin_0.25.3_linux_amd64
bin ls
Path Version URL Status
/home/patrickmslattery/.local/bin/bin v0.25.3 https://github.com/marcosnils/bin/releases/tag/v0.25.3 OK
Windows
Installing bin on Windows:
# Determine the path to the users Downloads folder
$DownloadsPath = (New-Object -ComObject Shell.Application).Namespace('shell:Downloads').Self.Path
# Windows Server 2012 R2 does not use TLS 1.3 as most modern sites expect
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Download a recent release, it does not really matter which release we get, this is only used once:
Invoke-WebRequest `
-Uri "https://github.com/marcosnils/bin/releases/download/v0.25.3/bin_0.25.3_windows_amd64.exe" `
-OutFile ".\bin_0.25.3_windows_amd64.exe"
# Use the binary we downloaded above to install the latest release:
.\bin_0.25.3_windows_amd64.exe install github.com/marcosnils/bin
Expected response:
The installer will ask us to choose from one of the directories in the local users current path setting (You may get a different list of directories), the AppData directory works well for local binaries:
Pick a default download dir:
[1] C:\Windows\System32\OpenSSH\
[2] C:\Program Files\PowerShell\7\
[3] C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps
[4] C:\Program Files\PowerShell\7
[5] C:\Windows\system32
[6] C:\Windows
[7] C:\Windows\System32\Wbem
[8] C:\Windows\System32\WindowsPowerShell\v1.0\
Select an option or type a custom value: 3
• Getting latest release for marcosnils/bin
• Starting download of https://api.github.com/repos/marcosnils/bin/releases/assets/398614008
17.98 MiB / 17.98 MiB [------------------------------------------------------------------------------] 100.00% ? p/s 0s
• Copying for bin_0.25.3_windows_amd64.exe@v0.25.3 into C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\bin.exe
• Done installing bin_0.25.3_windows_amd64.exe v0.25.3
Delete the temporary binary:
rm .\bin_0.25.3_windows_amd64.exe
List the managed binaries:
bin ls
Expected response:
Path Version URL Status
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\bin.exe v0.25.3 github.com/marcosnils/bin OK
Installing tools
Installing some useful tools with bin:
# Command line tool for Amazon Route 53
bin install github.com/barnybug/cli53
# Command-line JSON processor
bin install github.com/jqlang/jq
# Interactive JSON filter using jq
bin install github.com/ynqa/jnv
# yq is a portable command-line YAML, JSON, XML, CSV, TOML, HCL and properties processor
bin install github.com/mikefarah/yq
# Find, verify, and analyze leaked credentials
bin install github.com/trufflesecurity/trufflehog
# Code signing and transparency for containers and binaries
bin install github.com/sigstore/cosign
# Command-line access to the Observe API - Not available for Windows
bin install github.com/observeinc/observe
# Snyk CLI scans and monitors your projects for security vulnerabilities
bin install github.com/snyk/cli
# Blazing fast terminal file manager written in Rust
bin install github.com/sxyazi/yazi
# DNSControl is an opinionated platform for seamlessly managing your DNS configuration
bin install github.com/DNSControl/dnscontrol
List managed binaries
List the installed binaries managed by bin:
bin ls
Path Version URL Status
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\bin.exe v0.25.3 github.com/marcosnils/bin OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\cli53.exe v0.8.25 github.com/barnybug/cli53 OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\cosign.exe v3.0.6 github.com/sigstore/cosign OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\jnv.exe v0.7.1 github.com/ynqa/jnv OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\jq.exe jq-1.8.1 github.com/jqlang/jq OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\snyk.exe v1.1304.0 github.com/snyk/cli OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\trufflehog.exe v3.94.3 github.com/trufflesecurity/trufflehog OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\yazi.exe v26.1.22 github.com/sxyazi/yazi OK
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\yq.exe v4.53.2 github.com/mikefarah/yq OK
Upgrade managed binaries
Upgrade the managed binaries managed by bin:
# List what updates are available
bin update --dry-run
• /home/patrickmslattery/.local/bin/snyk v1.1302.1 -> v1.1304.0 (https://github.com/snyk/cli/releases/tag/v1.1304.0)
• /home/patrickmslattery/.local/bin/talosctl v1.12.4 -> v1.12.6 (https://github.com/siderolabs/talos/releases/tag/v1.12.6)
• /home/patrickmslattery/.local/bin/cosign v3.0.5 -> v3.0.6 (https://github.com/sigstore/cosign/releases/tag/v3.0.6)
• /home/patrickmslattery/.local/bin/jnv v0.6.1 -> v0.7.1 (https://github.com/ynqa/jnv/releases/tag/v0.7.1)
• /home/patrickmslattery/.local/bin/trufflehog v3.93.0 -> v3.94.3 (https://github.com/trufflesecurity/trufflehog/releases/tag/v3.94.3)
• /home/patrickmslattery/.local/bin/bat v0.25.0 -> v0.26.1 (https://github.com/sharkdp/bat/releases/tag/v0.26.1)
• /home/patrickmslattery/.local/bin/observe v0.3.0-rc1 -> v0.3.0-rc2 (https://github.com/observeinc/observe/releases/tag/v0.3.0-rc2)
• /home/patrickmslattery/.local/bin/yazi v25.5.31 -> v26.1.22 (https://github.com/sxyazi/yazi/releases/tag/v26.1.22)
While bin does support bulk updating of all of the applications under its control I generally find it better to update one application at a time. Newer versions are noticeably better though...
bin update cosign
• /home/patrickmslattery/.local/bin/cosign v3.0.5 -> v3.0.6 (https://github.com/sigstore/cosign/releases/tag/v3.0.6)
Do you want to continue? [Y/n] y
• Getting v3.0.6 release for sigstore/cosign
Multiple matches found, please select one:
[1] cosign-linux-amd64
[2] cosign-linux-pivkey-pkcs11key-amd64
Select an option: 1
• Starting download of https://api.github.com/repos/sigstore/cosign/releases/assets/390331694
128.92 MiB / 128.92 MiB [-----------------------------------------------------------------------------------------------] 100.00% 111.68 MiB p/s 1s
• Copying for cosign-linux-amd64@v3.0.6 into /home/patrickmslattery/.local/bin/cosign
• Done updating /home/patrickmslattery/.local/bin/cosign to v3.0.6