19 unstable releases (3 breaking)

0.4.17 Jan 31, 2023
0.4.16 Jan 30, 2023
0.4.15 Sep 23, 2022
0.3.10 Sep 22, 2022
0.1.7 Sep 22, 2022

#2061 in Command line utilities

29 downloads per month

MIT/Apache

11KB
180 lines

rcz

A tool to write a commit message based on Conventional Commits
inspired by git-cz

GitHub CI

Installation

cargo install rcz

Example

# bash
function gitz() {
  local output
  if output=$(rcz); then
    git commit -m "${output}"
  else
    echo "Err: failed to generate a commit message"
  fi
}

or

.gitconfig

[alias]
  cz = "!gitz() { if local output= ...}; gitz"

gif

gif

Configuration

The configuration file will be automatically generated on:

  • Linux: ~/.config/rcz
  • Windows: {FOLDERID_RoamingAppData}\rcz
  • Mac OS: ~/Library/Preferences/rs.rcz
Default configuration
format = '''
{type}: {subject}'''

[[types]]
description = 'A bug fix'
value = 'fix'
emoji = '๐Ÿ›'

[[types]]
description = 'A new feature'
value = 'feat'
emoji = 'โœจ'

[[types]]
description = 'Changes that introduces a breaking API change'
value = 'BREAKING CHANGE'
emoji = '๐Ÿ’ฅ'

[[types]]
description = 'build system or external dependencies'
value = 'chore'
emoji = '๐Ÿ› ๏ธ'

[[types]]
description = 'CI related changes'
value = 'ci'
emoji = '๐Ÿ’ซ'

[[types]]
description = 'Documentation only changes'
value = 'docs'
emoji = 'โœ๏ธ'

[[types]]
description = 'Changes that do not affect the meaning of the code'
value = 'style'
emoji = '๐Ÿ’„'

[[types]]
description = 'A code change that neither fixes a bug nor adds a feature'
value = 'refactor'
emoji = '๐Ÿงน'

[[types]]
description = ' A code change that improves performance'
value = 'perf'
emoji = '๐Ÿš„'

[[types]]
description = 'Adding or correcting tests'
value = 'test'
emoji = '๐Ÿงช'

Format

All section etc {scope} that you can add on the format are bellow.

  • {type}
  • {emoji}
  • {description}

โš ๏ธ The string that enclosed in double brackets ({{echo 'foo'}}, {{date}} etc) is interpreted as shell script.

Other strings ({body}, {footer}, {header} etc) is interpreted as a custom input.
The string is used as a prompt message.

Sometimes you don't have a scope and have to delete the brackets. If a space is entered for scope, brackets are removed altogether. #6

A example for your customize is bellow.

format = '''
{type}{scope}: {emoji}{subject}
{body}
{footer}'''

Dependencies

~1โ€“11MB
~87K SLoC