The missing package manager for golang binaries (its homebrew for "go install")

Overview

Bingo: The missing package manager for golang binaries
(its homebrew for "go install")

GitHub repo size All Contributors GitHub stars GitHub forks Twitter Follow

Do you love the simplicity of being able to download & compile golang applications with go install, but wish it were easier to manage the compiled binaries?

Bingo makes installing and managing go install-based packages a lot easier.

Features

  • Keeps a link between the installed binary and the source package
  • Can update / uninstall binaries using the name of the binary (i.e bingo update goimports)
  • Can install binaries to a location of your choice
  • Can control the name of the installed binary
  • Can install multiple versions of the same package (using different names for the binaries)
  • Each binary's source packages are isolated and managed in their own separate $GOROOT

TOC


Using


Compiling + Installing Binaries

To install a binary with bingo, use the golang application's full package path, same as you would with "go install".

hello example

$ bingo install github.com/golang/example/hello

Installing binary hello from package github.com/golang/example/hello
Downloading & compiling package (folder: '~/.bingo/pkg/hello')
go: downloading github.com/golang/example v0.0.0-20170904185048-46695d81d1fa
go: found github.com/golang/example/hello in github.com/golang/example v0.0.0-20170904185048-46695d81d1fa
Installing binary (file: '~/.bingo/bin/hello')
Done

$ ~/.bingo/bin/hello

Hello, Go examples!
Compiling 'Complicated' Packages

TBD

Currently, bingo only supports packages which can be directly downloaded + compiled + installed via go install (or go get for pre v1.16).

Packages that require a more complex build process are not supported at this time.

Installation Folder

See the Work Folders section for details on configuring the various folders needed by bingo, including which folder to install binaries in.

Specifying Package Version

You can specify which version of a package to install.

'@version' Syntax

install example using @version syntax

$ bingo install github.com/golang/example/[email protected]
'--version' Option

install example using --version option

$ bingo install --version v1.2.3 github.com/golang/example/hello
Binary Naming

By default, the installed binary will be named after the last folder element in its package path.

As you saw above, installing the github.com/golang/example/hello package installed a binary named hello.

You can override this behavior and specify the binary name at the time of installation:

install hello example as 'foo'

$ bingo install -n foo -q github.com/golang/example/hello

$ ~/.bingo/bin/foo

Hello, Go examples!
Using Go Get

By default, bingo uses go install to download + compile + install packages.

If you're using a version of go prior to v1.16, you can instruct bingo to use go get:

install example using --useget option

$ bingo install --useget github.com/golang/example/hello

install example using BINGO_USE_GET variable

$ BINGO_USE_GET=1 bingo install github.com/golang/example/hello

NOTE: Both of these work for the bingo update command as well.

Listing Installed Binaries

To see a list of installed binaries, use the installed command:

$ bingo installed -p

Bingo-managed binaries (folder: '~/.bingo/bin')

 - foo github.com/golang/example/hello
 - hello github.com/golang/example/hello
Per-Binary Isolation

As you see above, installing the hello example as foo did not interfere with the example installed as hello.

Each installed binary is managed in a separate $GOROOT, even if it is has the same package path as another binary.

Displaying A Binary's Associated Package

If you need a reminder of which package a binary was compiled/installed from, you can use the package command:

$ bingo package hello

github.com/golang/example/hello

Updating Binaries

To update an installed binary, use the update command:

$ bingo update hello

Updating hello package github.com/golang/example/hello
go: found github.com/golang/example/hello in github.com/golang/example v0.0.0-20170904185048-46695d81d1fa
Done

NOTE: By default, the resulting package version will be determined by Go's version resolution rules.

Specifying Package Version

You can specify which version of a package to update to.

NOTE: The target version does not have to be newer than the existing version. i.e you can update to an older version of the package.

'@version' Syntax

update example using @version syntax

$ bingo update [email protected]
'--version' Option

update example using --version option

$ bingo update --version v1.2.3 hello

Uninstalling Binaries / Packages

Use the uninstall command to uninstall binaries:

$ bingo uninstall foo

Uninstalling binary foo from package github.com/golang/example/hello
Removing binary (file: '~/.bingo/bin/foo')
Removing package (folder: '~/.bingo/pkg/foo')
Done

$ bingo installed -q

hello

NOTE: Uninstalling a binary also removes the associated package folder.


Requirements

Run

Bingo exists as a Runfile, and requires the Run tool to operate:

Bash

Bingo (currently) uses bash for its command scripts.

Readlink

Bingo uses symbolic links to associate binaries to their packages.

The scripts use readlink to resolve symbolic links.


Installing

Releases

See the Releases page for downloadable archives of versioned releases.

Brew Core

TBD

Brew Tap

In addition to working on brew core support, I have also created a tap to ensure the latest version is always available:

install bingo directly from tap

$ brew install tekwizely/tap/bingo

install tap to track updates

$ brew tap tekwizely/tap

$ brew install bingo

Work Folders

Bingo requires the following work folders:

Folder Description
Bin Folder Where compiled binaries are installed. This folder should be in your $PATH. This can be a "shared" folder that also contains non-bingo binaries.
Package Folder Where packages are downloaded / compiled. This should NOT be a "shared" folder.
Cache Folder Where to store Go cache files. This might work as a shared folder but has not been tested.

Configuring Work Folders via Shell Variables

Individual

Each of these folders can be individually configured via shell variables:

  • $BINGO_BIN
  • $BINGO_PKG
  • $BINGO_CACHE

Fallback: $BINGO_HOME

If the $BINGO_HOME variable is defined, bingo will use it as a fall-back for any folder that is not individually configured, i.e:

  • $BINGO_HOME/bin
  • $BINGO_HOME/pkg
  • $BINGO_HOME/cache

Default: $HOME/.bingo

As a final default, bingo will use $HOME/.bingo i.e:

  • $HOME/.bingo/bin
  • $HOME/.bingo/pkg
  • $HOME/.bingo/cache

Contributing

To contribute to Bingo, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin <project_name>/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.


Contact

If you want to contact me you can reach me at [email protected].


License

The tekwizely/bingo project is released under the MIT License. See LICENSE file.

You might also like...
Connect, Subscribe and Publish over MQTT broker to check its status.

MQTT Blackbox Exporter Introduction In each probe it sends a message over MQTT broker and then wait for getting it over subscription. By measuring thi

simple web app that print its environment variable, useful for testing on k8s

Index Sample web app that pints environment variables. Start it: docker-compose up Use it: curl localhost:8080 PATH=/usr/local/sbin:/usr/local/bin:/

A letsencrypt client that uses etcd as its storage.

letsencrypt-with-etcd This is a letsencrypt client that uses etcd as its storage. It stores your (automatically created) LetsEncrypt account in /letse

CetusGuard is a tool that allows to protect the Docker daemon socket by filtering the calls to its API endpoints.

CetusGuard CetusGuard is a tool that allows to protect the Docker daemon socket by filtering the calls to its API endpoints. Some highlights: It is wr

A Golang package for simplifying storing configuration in the OS-provided secret manager.

go-keyconfig A Golang package for simplifying storing configuration in the OS-provided secret manager. Operating System Support OS Secret Manager MacO

A package manager written in Go which uses the LFS Symlink method.

pacsym A package manager powered by symlinks. How to use The package manager assumes that all software installed is installed with /usr/pkg/packagena

Io's package manager
Io's package manager

Amirani Io's package manager Contributors ✨ Thanks goes to these wonderful people (emoji key): an aspirin 💻 📖 🔧 🚧 This project follows the all-con

📦 Package manager for CLI

AFX - Package manager for CLI AFX is a package manager for command-line tools and shell plugins. afx can allow us to manage almost all things availabl

Gologin is Golang (Go) login manager working with RDBMS Databases
Gologin is Golang (Go) login manager working with RDBMS Databases

What is Gologin Gologin is an easy to setup professional login manager for Go web applications. It helps you protect your application resources from u

Releases(v0.3.1)
  • v0.3.1(Aug 25, 2021)

    The switch to go install introduced a bug, as go install requires an explicit @version in order to trigger the newly-added download+compile feature, where as the existing go get silently defaulted to @latest when no version was given.

    This release adds logic to explicitly default the version to @latest if no version tag is provided.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Aug 23, 2021)

    As of go1.1.16, go install is considered the canonical way to download+compile+install packages, with the equivalent functionality of go get being deprecated and slated for eventual removal.

    With this, bingo v0.3.0 moves to using go install by default.

    If you're using a version of go prior to v1.16, you can instruct bingo to use go get:

    install example using --useget option

    $ bingo install --useget github.com/golang/example/hello
    

    install example using BINGO_USE_GET variable

    $ BINGO_USE_GET=1 bingo install github.com/golang/example/hello
    

    NOTE: Both of these work for the bingo update command as well.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Mar 12, 2020)

    Compiling + Installing Binaries

    Specifying Package Version

    You can specify which version of a package to install.

    '@version' Syntax

    install example using @version syntax

    $ bingo install github.com/golang/example/[email protected]
    
    '--version' Option

    install example using --version option

    $ bingo install --version v1.2.3 github.com/golang/example/hello
    

    Updating Binaries

    To update an installed binary, use the update command:

    $ bingo update hello
    
    Updating hello package github.com/golang/example/hello
    go: found github.com/golang/example/hello in github.com/golang/example v0.0.0-20170904185048-46695d81d1fa
    Done
    

    NOTE: By default, the resulting package version will be determined by Go's version resolution rules.

    Specifying Package Version

    You can specify which version of a package to update to.

    NOTE: The target version does not have to be newer than the existing version. i.e you can update to an older version of the package.

    '@version' Syntax

    update example using @version syntax

    $ bingo update [email protected]
    
    '--version' Option

    update example using --version option

    $ bingo update --version v1.2.3 hello
    
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Feb 17, 2020)

Owner
TekWizely
TekWizely
Stop using install.sh! Start using install.yml! DAJE...

Daje - A general purpose Ansible dotfiles installer Configure one time and run everywhere. What is this I've never liked using a big bash script to in

Schrödinger Hat 17 Nov 14, 2022
operator to install cluster manager and klusterlet.

registration-operator Minimum cluster registration and work Community, discussion, contribution, and support Check the CONTRIBUTING Doc for how to con

Open Cluster Management 56 Dec 14, 2022
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)

Terraform Provider for Azure (Resource Manager) Version 2.x of the AzureRM Provider requires Terraform 0.12.x and later, but 1.0 is recommended. Terra

null 0 Oct 16, 2021
gokp aims to install a GitOps Native Kubernetes Platform

gokp gokp aims to install a GitOps Native Kubernetes Platform. This project is a Proof of Concept centered around getting a GitOps aware Kubernetes Pl

Christian Hernandez 25 Nov 4, 2022
Install hubble-ui on GKE Dataplane V2

GKE Hubble Export This is a grpc server wrapper that re-export the cilium agent's observer service and peer service from the local domain socket. And

Rueian 25 Jan 2, 2023
Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install

Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install. The permissions are aggregated from the following sources:

International Business Machines 2 Apr 22, 2022
Use this program to embed sh scripts in binaries

sh2bin Use this program to embed sh scripts in binaries. Feel free to fork this

Carlos Polop 18 Jan 4, 2023
Automatic-Update-Launcher - A general purpose updater for updating program binaries when update folder exists

Automatic Update Launcher A general purpose updater for updating (web) applicati

Toby Chui 4 Jun 27, 2022
Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions required!

A cross-platform package manager for the web! Add, remove, and manage different versions of web-distributed software binaries. No elevated permissions

Andrew Lee 36 Nov 21, 2022
Automatically capture all potentially useful information about each executed command (as well as its output) and get powerful querying mechanism

nhi is a revolutionary tool which automatically captures all potentially useful information about each executed command and everything around, and delivers powerful querying mechanism.

Karol Ołtarzewski 249 Nov 29, 2022