CLI helper to install Github releases on your system.

Overview

Github release installer

CI PyPI Python Versions PyPI Package Version

gh-release-install is a CLI helper to install Github releases on your system. It can be used for pretty much anything, to install a formatter in your CI, deploy some binary using an orcherstration tool, or on your desktop.

This project was mainly created to...

# ...turn this mess:
wget --quiet --output-document=- "https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.x86_64.tar.xz" \
    | tar --extract --xz --directory=/usr/local/bin --strip-components=1 --wildcards 'shellcheck*/shellcheck' \
    && chmod +x /usr/local/bin/shellcheck

wget --quiet --output-document=/usr/local/bin/shfmt "https://github.com/mvdan/sh/releases/download/v3.2.1/shfmt_v3.2.1_linux_amd64" \
    && chmod +x /usr/local/bin/shfmt

# Into this:
pip3 install gh-release-install

gh-release-install \
      "koalaman/shellcheck" \
      "shellcheck-{tag}.linux.x86_64.tar.xz" --extract "shellcheck-{tag}/shellcheck" \
      "/usr/bin/shellcheck"

gh-release-install \
      "mvdan/sh" \
      "shfmt_{tag}_linux_amd64" \
      "/usr/bin/shfmt"

Features:

  • Download releases from Github.
  • Extract zip or tarball on the fly.
  • Pin to a desired version or get the latest version.
  • Keep track of the local tools version using a version file.

Installation

Install the package from pip:

pip install gh-release-install
gh-release-install --help

Or with with pipx:

pipx install gh-release-install
gh-release-install --help

Usage

Usage: gh-release-install [OPTIONS] REPOSITORY ASSET DESTINATION

  Install GitHub release file on your system.

  The REPOSITORY argument define the Github REPOSITORY org/repo to get the
  release from.

  Examples:
      mvdan/sh
      prometheus/prometheus

  The ASSET argument define the release ASSET filename. Note that ASSET may
  contain variables such as '{version}' or '{tag}'.

  Examples:
      shfmt_{tag}_linux_amd64
      prometheus-{version}.linux-amd64.tar.gz

  The DESTINATION argument define the DESTINATION path for the downloaded
  file. Note that DESTINATION may contain variables such as '{version}' or
  '{tag}'.

  Examples:
      /usr/bin/local/shfmt
      /opt/prometheus/prometheus

  If the release asset is an archive, use the --extract flag to extract the
  <filename> from the archive and install the extracted file instead. Note
  that <filename> may contain variables such as '{version}' or '{tag}'.

  Examples:
      --extract prometheus-{version}.linux-amd64/prometheus

  To install a specific version, use the --version flag to set the desired
  version. With 'latest' the installer will ask the Github API to find the
  latest version. The default is 'latest'.

  Examples:
      latest
      v2.28.1

  To track the version installed on the system, use the --version-file flag to
  define the <filename> where the version should be saved. The default is not
  to save this version file. Note that <filename> may contain variables such
  as '{destination}'.

  Examples:
      --version-file /opt/versions/prometheus.version
      --version-file {destination}.version

  Some full examples:

  gh-release-install \
      'mvdan/sh' \
      'shfmt_{tag}_linux_amd64' \
      '/usr/bin/local/shfmt' \
      --version 'v3.3.1'

  gh-release-install \
      'prometheus/prometheus' \
      'prometheus-{version}.linux-amd64.tar.gz' \
      --extract 'prometheus-{version}.linux-amd64/prometheus' \
      '/usr/local/bin/prometheus' \
      --version-filename '{destination}.version'

Options:
  --extract <filename>       Archive member to extract.
  --version <version>        Release version to install.
  --version-file <filename>  File to track the version installed.
  --help                     Show this message and exit.
Owner
Jonas L.
Jonas L.
Lets you view, edit and execute Jupyter Notebooks in the terminal.

Lets you view, edit and execute Jupyter Notebooks in the terminal.

David Brochart 684 Dec 28, 2022
Several tools that can be added to your `PATH` to make your life easier.

CK-CLI Tools Several tools that can be added to your PATH to make your life easier. prettypath Prints the $PATH variable in a human-readable way. It a

Christopher Kumm 2 Apr 21, 2022
Python commandline tool for remembering linux/terminal commands

ehh Remember linux commands Commandline tool for remembering linux/terminal commands. It stores your favorite commands in ~/ehh.json in your homedir a

56 Nov 10, 2022
pwy - A simple weather tool.

A simple weather tool. I made this as a way for me to learn Python, API, and PyPi packaging. Name changed from wwy to pwy.

Clint 105 Dec 31, 2022
Program Command Line Interface (CLI) Sederhana: Pemesanan Nasi Goreng Hekel

Program ini merupakan aplikasi yang berjalan di dalam command line (terminal). Program ini menggunakan built-in library python yaitu argparse yang dapat menerima parameter saat program ini dijalankan

Habib Abdurrasyid 5 Nov 19, 2021
A Command Line Error Parser Built using Python.

"Stalk Overflow with debuggy" Error Parser Everything is done in Python so it's extremely easy to install and use. Supports Python 3. Debuggy is used

Derhnyel 22 Nov 10, 2022
Password manager for the CLI simps.

CLI Password Manager Password manager for the CLI simps. Free software: MIT license

1 Dec 30, 2021
🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. 🌈

🌈 Colorist for Python 🌈 Lightweight Python package that makes it easy and fast to print terminal messages in colors. Prerequisites Python 3.9 or hig

Jakob Bagterp 1 Feb 05, 2022
doq (python docstring generator) extension for coc.nvim

coc-pydocstring doq (python docstring generator) extension for coc.nvim Install CocInstall: :CocInstall coc-pydocstring vim-plug: Plug 'yaegassy/coc-p

yaegassy 27 Jan 04, 2023
A simple web-based SSH client.

Kommander A simple web-based SSH client. It supports: entering SSH login details (including private key and custom ports) and connecting user authenti

KingWaffleIII 2 Jan 01, 2022
An interactive aquarium for your terminal.

sipedon An interactive aquarium for your terminal, written using pytermgui. The project got its name from the Common Watersnake, also known as Nerodia

17 Nov 07, 2022
A CLI password generator

passgen - A CLI password generator Usage python3 main.py arguments Arguments Argument Short Description --length -l The length of the password to ge

1 Nov 13, 2021
Modern line-oriented terminal emulator without support for TUIs.

Modern line-oriented terminal emulator without support for TUIs.

10 Jun 12, 2022
A CLI Application to detect plagiarism in Source Code Files.

Plag Description A CLI Application to detect plagiarism in Source Code Files. Features Compare source code files for plagiarism. Extract code features

default=dev 2 Nov 10, 2022
A minimal todo list for your terminal.

todo A minimal todo list for your terminal. Installation Run the following command. pip install git+https://github.com/piero-vic/todo.git Usage todo

Piero Lescano 7 Aug 08, 2022
A Neat Application To Manage Your To-Do Lists.

WTD - What To Do? A Neat Application To Manage Your To-Do Lists. One folder can only have one to-do file. Running wth without any subcommands executes

Adam Vajda 1 Oct 24, 2021
My dotfiles -My configuration, with installations steps.

.dotfiles My configuration, with installations steps. Installation Oh My ZSH Install with this command: sh -c "$(curl -fsSL https://raw.githubusercont

Luca Angioloni 4 Dec 14, 2022
Python implementation of SSH file transfer across servers.

SSH Transfer Python implementation of SSH file transfer across servers. Requirements paramiko=2.7.2 Usage Config Preparation Configure some informatio

Zhe Kong 1 Nov 23, 2021
:computer: tmux session manager. built on libtmux

tmuxp, tmux session manager. built on libtmux. We need help! tmuxp is a trusted session manager for tmux. If you could lend your time to helping answe

python utilities for tmux 3.6k Jan 01, 2023
Python3 library for multimedia functions at the command terminal

TERMINEDIA This is a Python library allowing using a text-terminal as a low-resolution graphics output, along with keyboard realtime reading, and a co

Joao S. O. Bueno 89 Dec 17, 2022