Skip to content
main
Switch branches/tags
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Commity

Build status

Commity is a command line tool that will help you with commits conventions. You can configure Commity fast & easily so every collaborators can follow the commit convention you need.

usage screenshot

Requirement

node >= 14.16.0

Installation

I highly recommand to use it globally.

npm i -g @pierred/commity

Get started

  • npm i -g @pierred/commity
  • commity init
  • commity

Usage

Commands:

Command Description
commity Execute commity
💡 project need to be commity friendly, see below
commity init Make your repo commity friendly creating a commity.json file

Options:

Option Alias Description
--addAll -a Add all changes to the index (git add --all) before commit
--push -p Push after commit
💡 if cannot push e.g. because your branch has no upstream branch, commity will be able to commit anyway

Configuration

As You may see in commity.json, there are 2 parts you can configure: fields and render

{
  "fields": [
    {
      "scope": {
        "label": "Select the type of change that you're committing",
        "type": "select",
        "selectOptions": [
          {
            "value": "feat",
            "description": "A new feature"
          },
          {
            "value": "fix",
            "description": "A bug fix"
          },
          {
            "value": "docs",
            "description": "Documentation only changes"
          },
          {
            "value": "refactor",
            "description": "Changes that neither fixes a bug or adds a feature"
          }
        ]
      }
    },
    {
      "message": {
        "label": "Choose the commit message"
      }
    },
    {
      "ticket": {
        "label": "What is the issue id"
      }
    }
  ],
  "render": "$+scope #$+ticket: $+message"
}

Your fields take a field's key, in the above example there are two field's key : scope, message and ticket.

You can choose 2 types of field:

  • simple input where you just need a label
  • select input where you have to add "type": "select" and provide selectOptions

render take the formatted string, replacing $+<commit field's key> with the user input.

More features incoming 🎉