 <p>There's no "one way", but the common approach is to make your top-level repo your library - i.e. <code>github.com/you/somelib</code> and then have a <code>cmd</code> directory underneath that contains your CLI (package mains) - there may even be many.</p> <p>e.g.</p> <pre><code>yourlib/ api.go api_test.go handler.go handler_test.go cmd/ command-name/ main.go // Builds a "command-name" binary other-command/ main.go // Builds a "other-command" binary </code></pre> <p>Your CLI apps are just consumers of your library. Users can retrieve it via <code>go get github.com/you/yourlib/...</code> which will install the lib and the binaries onto their GOPATH.</p> <p>The Go <a href="https://github.com/golang/go/tree/master/src/cmd" rel="nofollow">source itself</a>, <a href="https://github.com/camlistore/camlistore" rel="nofollow">Camlistore</a> and <a href="https://github.com/boltdb/bolt" rel="nofollow">BoltDB</a> all use this approach (amongst many other libs).</p>