GoGitCli (newrepo)

A CLI tool incorporated into Google's official Github repo: go-github.


go-github is a great project but their documentations of use cases was fairly sparse and several users had left issues requesting further examples. To that end I turned it into a CLI which generates a new repo on the user's github: GoGitCli.


Brief

As an use case example GoGitCli had to be simple, useful and 'Go-like'.

The first two points were satisfied by the concept: A command which took variables (at minimum a name for the repo to be created) and produced a result: A new repo on the user's Github.

As to being 'Go-like' I was fortunate to receive guidance form one of the repo's most prolific contributors: gmlewis. He kindly suggested conforming to Go's stylistic principles in terms of structuring comments for Godocs automated parsing and utilizing flags instead of command line arguments.


Instillation

While this was designed to be incorporated into the go-github repo is also exists as a stand-alone project and can be installed as such:

go get github.com/fenwickelliott/newrepo


Usage

In order to narrow the scope of this example to utilization of the go-github package authorization is not included. Instead it is assumed that the user has a valid Github auth token saved as an environment variable.

newrepo must be called with at minimum a name flag:

newrepo -name=example

Other optional flags include 'description' and 'private':

newrepo -name=example -description="An example repo" -private=true