gcli
(formerly cli-init
) generates the codes and its directory structure you need to start building CLI tool right out of the box.
All you need is to provide name, commands and framework you want to use.
To start new command line tool,
$ gcli new [options] NAME
It generates new cli skeleton project. At least, you must provide executable name.
See more usage,
$ gcli help
If you want to create todo
CLI application which has add
, list
and delete
command with
mitchellh/cli framework,
$ cd $GOPATH/src/github.com/YOUR_NAME
$ gcli new -F mitchellh_cli -c add -c list -c delete todo
You can run go build
todo application from beginning.
gcli
supports bellow cli frameworks,
- codegangsta_cli
- mitchellh_cli
- go_cmd (Standard
go
command style) - flag
gcli
has tempaltes of these frameworks. Template file includes best practices of each frameworks like
how to separate file or how to set directory structure and so on.
In future, we will also suppport other CLI frameworks like below (Need help),
To install, use go get
and make install
. We tag versions so feel free to checkout that tag and compile.
$ go get -d github.com/tcnksm/gcli
$ cd $GOPATH/src/github.com/tcnksm/gcli
$ make install
gcli
was re-written from scratch. If you prefer old version of gcli
, checkout,
$ git checkout v0.1.0
- Fork (https://github.com/tcnksm/gcli/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
make test
command and confirm that it passes - Run
gofmt -s
- Create a new Pull Request