Skip to content

Easily install, update and manage any CLI tool directly from github releases

License

Notifications You must be signed in to change notification settings

Rishang/install-release

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Install Release πŸš€

Python Version Downloads

install-release is a CLI tool to install any tool for your device directly from their GitHub releases and keep them updated. Consider it as a small package manager to install tools from GitHub releases.

This can be any tool you want to install, which is pre-compiled for your device and present on GitHub releases.

INFO: It's mainly for installing tools that are not directly available officially by package managers like apt, yum, pacman, brew etc.

Table of Contents

Getting started

# Install install-release
pip install -U install-release
# Example Installation a tool named `gron` directly from its GitHub releases

# install-release get [GITHUB-URL]

❯ install-release get https://github.com/tomnomnom/gron 

demo

Checking for gron is installed using installed-release:

❯ which gron
/home/noobi/bin/gron

❯ gron --help
Transform JSON (from a file, URL, or stdin) into discrete assignments to make it greppable
... # more

Prerequisites

  • python3.8 or higher

  • libmagic

  • Default releases Installation Path is: ~/bin/, This is the path where installed tools will get stored.

  • In order to run installed tools, you need to add the following line to your ~/.bashrc or ~/.zshrc file:

export PATH=$HOME/bin:$PATH

Install install-release package

pip install -U install-release

Updating install-release

For seeing version:

install-release me --version

For updating:

install-release me --upgrade

Example usage install-release --help

# Help page

❯ install-release --help
Usage: install-release [OPTIONS] COMMAND [ARGS]...

  GitHub Release Installer, based on your system

  Commands:
    get      | Install GitHub release, cli tool
    ls       | list all installed releases, cli tools
    rm       | remove any installed release, cli tools
    upgrade  | Upgrade all installed releases, cli tools
    state    | show currently stored state
    config   | Set configs for tool
    pull     | Install tools from a remote state
    hold     | Keep updates a tool on hold.
    me       | Update install-release tool.

For sub-command help use: install-release <sub-command> --help

Example: install-release get --help

You can shorten the command by setting the alias to your .bashrc or .zshrc

alias ir="install-release"

after this you can you alias directly for easiness

Example: ir get --help

Install completion for cli

# install-release --install-completion [SHELL: bash|zsh|fish|powershell]
# Example for zsh:
install-release --install-completion zsh

Install tool from GitHub releases

❯ install-release get "https://github.com/ahmetb/kubectx"

πŸ“‘ Repo     : ahmetb/kubectx
🌟 Stars    : 13295
✨ Language : Go
πŸ”₯ Title    : Faster way to switch between clusters and namespaces in kubectl

                              πŸš€ Install: kubectx                               
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━┓
┃ Name    ┃ Selected Item                      ┃ Version ┃ Size Mb ┃ Downloads ┃
┑━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━┩
β”‚ kubectx β”‚ kubectx_v0.9.4_linux_x86_64.tar.gz β”‚ v0.9.4  β”‚ 1.0     β”‚ 43811     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Install this tool (Y/n): y
 INFO     Downloaded: 'kubectx_v0.9.4_linux_x86_64.tar.gz' at /tmp/dn_kubectx_ph6i7dmk                                                               utils.py:159
 INFO     install /tmp/dn_kubectx_ph6i7dmk/kubectx /home/noobi/bin/kubectx                                                                  core.py:132
 INFO     Installed: kubectx
# checking if kubectx is installed
❯ which kubectx
/home/noobi/bin/kubectx

❯ kubectx --version
0.9.4

List installed tools

❯ install-release ls

                       Installed tools                        
┏━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name      ┃ Version ┃ Url                                  ┃
┑━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ terrascan β”‚ v1.15.2 β”‚ https://github.com/tenable/terrascan β”‚
β”‚ gron      β”‚ v0.7.1  β”‚ https://github.com/tomnomnom/gron    β”‚
β”‚ kubectx   β”‚ v0.9.4  β”‚ https://github.com/ahmetb/kubectx    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    

Remove installed release

# Remove installed release

❯ install-release rm gron
    
INFO     Removed: gron           

Update all previously installed tools to the latest version

❯ install-release upgrade

Fetching: https://github.com/tenable/terrascan#terrascan
Fetching: https://github.com/ahmetb/kubectx#kubectx

Following tools will be upgraded:

terrascan

Upgrade these tools, (Y/n): y

Updating: terrascan, v1.15.0 => v1.15.2
 INFO     Downloaded: 'terrascan_1.15.2_Linux_x86_64.tar.gz' at /tmp/dn_terrascan_0as71a6v
 INFO     install /tmp/dn_terrascan_0as71a6v/terrascan ~/bin/terrascan
 INFO     Installed: terrascan

Progress... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 

Pull state templates for installing tools.

You can push your state to somewhere like GitHub and use it for any other device, to make a sync for tools installed via install-release

❯ install-release pull --url https://raw.githubusercontent.com/Rishang/dotFiles/main/templates/install-release/state.json

Hold Update to specific installed tool.

In case you want to hold an update to the specific tool, you can use hold {tool-name} command which will pause update for that tool.

Example: keep tool named k9s update on hold

❯ install-release hold k9s
 INFO     Update on hold for, k9s to True

You can list tools on hold updates by ls --hold command

❯ install-release ls --hold
             Installed tools kept on hold             
┏━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name ┃ Version ┃ Url                               ┃
┑━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ k9s  β”‚ v0.26.7 β”‚ https://github.com/derailed/k9s   β”‚
β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

In case you want to unhold update to the specific tool, you can use hold --unset {tool-name} command by which it will pause update for that tool.

❯ install-release hold --unset k9s
 INFO     Update on hold for, k9s to False

Config tool installation path

❯ install-release config --path ~/.local/bin

INFO   updated path to:  ~/.local/bin
INFO   Done

Config updates for pre-release versions

This is useful when you want to install pre-release versions of tools like beta or alpha releases. By default, it is set to False in which case it will only check for latest release.

❯ install-release config --pre-release

Configure GitHub token for higher rate limit

❯ install-release config --token [your github token]

INFO: Update token
INFO: Done.