Grab is a tool that downloads source code repositories into a convenient directory layout created from the repo’s URL’s domain and path. It supports Git, Mercurial (hg), Subversion, and Bazaar repositories.

$ grab # also works.

$ ls ~/src/
LICENSE go.mod    go.sum    grab      main.go

By default, grab downloads into $HOME/src (overridable with the env var GRAB_HOME). The repo was stored in it with the domain ( as the top-level directory, and jmhodges and grab created as subdirectories down the path.

Also, the input to grab doesn’t have to contain a scheme (e.g. https://) to work.


Grab can be installed by running go install