npm-like tool for managing Go dependencies
Go Makefile
Latest commit 17735bf May 10, 2016 @dkulchenko bump vers


An npm-like tool for easily managing Go (golang) dependencies.

Release Build Status


go get is very good. But managing multiple packages, locking versions down for reproducible builds, and changing GOPATH or rewriting package imports is an exercise left to the developer. bunch tackles this issue by providing a comprehensive tool for managing Go dependencies similar to npm for Node, supporting installing, uninstalling, pruning, listing outdated packages, and much more.


go get

Alternatively, precompiled binaries for supported operating systems are available.

You can pin bunch itself, if you'd like to lock the version of bunch down. If bunch finds a version of itself in the vendored environment (that is, .vendor/bin/bunch exists), it will use that version instead.


See this repo's Bunchfile as an example. !self

# comments are fun! v2 # can be a branch, tag, or commit a2b5va78d >= 1.0 ~> 1.4.x > 1.0, < 1.4


Managing packages

(optional) Generate a Bunchfile based on your existing imports to get you started:

bunch generate

Install all packages listed in Bunchfile to .vendor directory:

bunch install

Install a specific package and save it to the Bunchfile:

bunch install
bunch install --save
bunch install --save
bunch install

Update all packages to latest versions matching Bunchfile:

bunch update

Remove a package and save the change to the Bunchfile:

bunch uninstall
bunch uninstall --save

Prune unused packages from vendor directory (similar to npm prune):

bunch prune

List outdated packages:

bunch outdated

Lock down the commits currently in use (creates Bunchfile.lock; similar to npm shrinkwrap):

bunch lock

Rebuild (recompile) all packages:

bunch rebuild

Using the vendored environment

Run commands/builds within the vendored environment (sets $GOPATH and $PATH):

bunch go build .
bunch go fmt
bunch exec make
bunch shell

You can also add this to your .bash_profile to make the go command automagically be bunch-aware (e.g. go build will automatically have the correct $GOPATH set if a Bunchfile is present):

if which bunch > /dev/null; then eval "$(bunch shim -)"; fi


For basic operations like installing/uninstalling/updating/pruning packages, all VCSes supported by go get are supported by bunch (git, hg, svn, and bzr).

For more advanced operations, packages using Git are fully supported. Mercurial has mostly full support (does not support version ranges in the Bunchfile). Bazaar has some support (does not support version ranges, "bunch outdated", or "bunch install" caching up-to-date packages). Subversion has rudimentary support (only install/update/uninstall/prune).


Patches welcome :)

  • Fork repository
  • Create a feature or bugfix branch
  • Open a new pull request


The MIT License (MIT)

Copyright (c) 2015 Daniil Kulchenko