Configurable CLI with conventional commits, changelog, git hooks all in one
Usage
If you have Go
setup on your machine, get and install by:
$ go get -u github.com/Roytangrb/gitwok
gitwok
executable should be available if $GOPATH/bin
is already in your PATH
, otherwise put the binary in one of your PATH
directories
To install on a Mac with homebrew installed, run:
$ brew tap roytangrb/gitwok
$ brew install gitwok
Usage:
gitwok [flags]
gitwok [command]
Available Commands:
add stage changes
commit build and make conventional commit
help Help about any command
version print version
Flags:
--config string config file (default is ./gitwok.yaml)
-n, --dry-run dry run all git exec actions
-h, --help help for gitwok
-v, --verbose verbose output
Use "gitwok [command] --help" for more information about a command.
For git related commands, you may run
gitwok [command] [--verbose | -v] [--dry-run | -n]
to see verbose output without actually applying changes.
The add subcommand prompts for selecting unstaged changes of the current directory to be added for commiting.
$ gitwok add
The commit
subcommand is used for building the commit message following specification, and execute git commit -m <msg>
.
You can build the commit message using flags for subcommand commit
, example:
$ gitwok commit -t docs -s readme.md -d "commit command usage"
which commits with a simple and valid message:
docs(readme.md): commit command usage
You can check all flags by gitwok commit --help
You may also build the commit message interactively by running:
$ gitwok commit
You will be prompted for selecting/entering each commit message component.
Configuration allows you to customize subcommands for more handy usage and avoid repeating dummy input.
For example, you could provide a preset of commit scope
to choose from while commiting, or skip the body
and footers
prompts by default.
Examples and full options could be found in docs/config
.
To apply a config file, you may specify a full path and name, i.e.:
$ gitwok commit --config "/path/to/your/config.yaml"
When no file path is set explictly by --config
flag, it will look for a default gitwok.yaml
file in the current working directory and then in your home directory.
In the absence of a config file, default config will apply.
- Toggle prompt of the optional fields in a commit msg, with boolean value
- Set
type
options for selecting, default types are:fix
,feat
,build
,chore
,ci
,docs
,perf
,refactor
,style
,test
. - Set
scope
options for selecting. If no option is given, the prompt will become a single line input instead of a select.
# yaml
gitwok:
commit:
prompt:
scope: true # default true
breaking: true # default true
body: true # default true
footers: true # default true
type:
- fix
- feat
# ...
scope:
- readme.md
- release
# ...
coming soon