gobin-info lists your locally installed Go binaries alongside their version and original Git repository.
It's kind of like a convenience wrapper around go version -m ... with some niceties on top, like vanity URL resolving.
go install github.com/philippgille/gobin-info@latest
You can run gobin-info in several modes:
gobin-info /path/to/dirlists info about the Go binaries in a given directory (relative or absolute)gobin-info -wdlists info about the Go binaries in your working directorygobin-info -gobinlists info about the Go binaries in your$GOBINdirectorygobin-info -gopathlists info about the Go binaries in your$GOPATH/bindirectory- 🚧
gobin-info -pathlists info about the Go binaries in your$PATH(not implemented yet)
It prints a (❓) after the URL in case the URL couldn't be reliably determined.
Note:
gobin-infodoesn't recurse into subdirectories. This might be added with an optional flag in the future.
$ gobin-info -gopath
Scanning /home/johndoe/go/bin
arc v3.5.1 https://github.com/mholt/archiver
gopls v0.11.0 https://go.googlesource.com/tools
mage (devel) https://github.com/magefile/mage
staticcheck v0.3.3 https://github.com/dominikh/go-tools
Most of your CLI tools were probably installed with a package manager like apt or dnf on Linux, Homebrew on macOS, or Scoop on Windows. Then if you want to get the list of your installed tools, you can run apt list --installed, brew list or scoop list to list them, and if you want to know more about one of them you can run apt show ..., brew info ... or scoop info ....
But what about the ones you installed with Go? You installed them with go install ... and they live in $GOPATH/bin or $GOBIN or maybe you move/symlink them to /usr/local/bin or so.
- Now you don't immediately know the origin of the tools. For example if there's a binary called
arc, is itgithub.com/mholt/archiver/v3/cmd/arcorgithub.com/evilsocket/arc/cmd/arc? - You could run
arc --helpand it might give a hint what exactly it is, but it's not reliable - Or you run
go version -m /path/to/arcand among the dozens of output lines you check thepathormod- But their values are not
https://-prefixed, so you can't click them in your terminal and have to copy paste them into your browser - Then for example
archas the module pathgithub.com/mholt/archiver/v3, which leads to a404 Not Founderror on GitHub because of thev3 - And for
staticcheckthe module path ishonnef.co/go/tools, which is a vanity URL that doesn't point to the original Git repository (https://github.com/dominikh/go-tools) and the browser also doesn't redirect to it
- But their values are not
gobin-info makes all of this much easier.