๐Ÿ’Ž Gitta

January 16, 2023 ยท View on GitHub

A simple CLI to generate and format your commit messages with an emoji, type, and scope. Gitta aims to streamline your commit messages to follow consistently with the Conventional Commits specification.

โœจ Features

  • Consistent commit messages every time.
  • Customizable emojis and prefixes.
  • Option to update from default or custom source for newly added emojis/prefixes.
  • Quick lookup for emojis.

๐Ÿš€ Installation

npm i -g gitta

โšก Commands

gitta -c/--commit

Instantly commit you changes by answering a few short prompts.

$ gitta -c

? Select an emoji (Use arrow keys or type to search)
> โœจ :sparkles: - Adding a new feature to the code.
  ๐Ÿ› :bug: - Fixed bug in code.
  ๐Ÿ“’ :ledger: - Updated documentation for project.
  ๐Ÿธ :cocktail: - Updated code formatting and styling.
  ๐ŸŽจ :art: - Refactoring code in project.
  โœ… :white_check_mark: - Adding or updating tests.
  ๐Ÿ”ง :wrench: - Fixing unreported issue in code.
(Move up and down to reveal more choices)
? Select an emoji ๐ŸŽจ :art: - Refactoring code in project.

? Specify file(s) updated constant.ts
? Set commit title Inherit name and version from package.json
? Set commit message (optional)
[master 017b307] :art: refactor(constant.ts): Inherit name and version from package.json 1 file changed, 2 insertions(+), 2 deletions(-)

gitta -e/--edit

Open directory of emoji and prefixes files for editing.

$ gitta -e

Opening emoji/prefix directory...

gitta -h/--help

Display help message.

   ๐Ÿ’Ž Personalized git commit messages.

  Usage
      $ gitta -[cehlrsuv]

  Options
      --commit, -c        An interactive prompt that handles committing your changes.
      --edit, -e          Edit stored emoji/prefix files.
      --help, -h          Display help message.
      --list, -l          List your configured gitta emojis/prefixes.
      --reconfig, -r      Reconfigure gitta settings.
      --search, -s        Search for emoji given keywords.
      --update, -u        Refresh list of emojis/prefixes (does not overwrite custom).
      --version, -v       Display version of gitta.

  Examples
      gitta -l

gitta -l/--list

List configured (default + custom) emojis and prefixes for gitta.

List emojis

$ gitta -l

? What data do you want to list out? (Use arrow keys)
> emojis
  prefixes

? What data do you want to list out? emojis
โœจ :sparkles: (feat) - Adding a new feature to the code.
๐Ÿ› :bug: (fix) - Fixed bug in code.
๐Ÿ“’ :ledger: (docs) - Updated documentation for project.
๐Ÿธ :cocktail: (style) - Updated code formatting and styling.
...

List prefixes

$ gitta -l

? What data do you want to list out? (Use arrow keys)
  emojis
> prefixes

? What data do you want to list out? prefixes
feat (Feature) - Adding new feature to existing project.
bug (Bug Fix) - Fixing existing bugs.
chore (Chore) - Something that just had to be done.
docs (Documentation) - Adding documentation to project.
...

gitta -r/--reconfig

Reconfigure gitta settings.

$ gitta -r

? Automatically add all files to your commit. (Y/n) Y
? Choose how your emojis should be displayed. (Use arrow keys)
> :tada:
  ๐ŸŽ‰

? Choose how your emojis should be displayed. :tada:
? Set if commits should be signed by default. (Y/n) Y
? Set if Conventional Commits standard should be used (specify files affected by commit). (Y/n) Y
? Set Gitta emoji refresh url. (https://raw.githubusercontent.com/Spiderpig86/gitta/master/configuration/emojis.json)
? Set Gitta prefix refresh url. (https://raw.githubusercontent.com/Spiderpig86/gitta/master/configuration/prefixes.json)

Interactive search for emojis.

$ gitta -s

? Search for emoji:  (Use arrow keys or type to search)
> โœจ :sparkles: (feat) - Adding a new feature to the code.
  ๐Ÿ› :bug: (fix) - Fixed bug in code.
  ๐Ÿ“’ :ledger: (docs) - Updated documentation for project.
  ๐Ÿธ :cocktail: (style) - Updated code formatting and styling.
  ๐ŸŽจ :art: (refactor) - Refactoring code in project.
  โœ… :white_check_mark: (test) - Adding or updating tests.
  ๐Ÿ”ง :wrench: (chore) - Fixing unreported issue in code.
(Move up and down to reveal more choices)

gitta -u/--update

Update emojis/prefixes from source specified in your configuration.

$ gitta -u

โœ” Succeeded fetching prefixes!
โœ” Succeeded fetching emojis!

gitta -v/--version

Get verison of gitta.

$ gitta -v

0.0.1

โš™ Configuration

gitta can be configured in 2 places:

  • ~/.gitta - stores emoji and prefix files.
  • ~/gitta-nodejs\Config\config.json - settings handled by Conf when you configre with gitta -r. Note that the path is AppData\Roaming\ for Windows.

You can actually add your own emojis and prefixes. All you need to do is add it to the custom sections. These will never be overwritten when using gitta -u.

Emojis

{
    "default": [
        {
            "emoji": "โœจ",
            "code": ":sparkles:",
            "type": "feat",
            "name": "sparkles",
            "description": "Adding a new feature to the code."
        }
    ],
    "custom": []
}

Prefixes

{
    "default": [
        {
            "name": "Feature",
            "description": "Adding new feature to existing project.",
            "prefix": "feat"
        }
    ],
    "custom": []
}

Default Emojis

emojicodetypedescription
โœจ:sparkles:featAdding a new feature to the code.
๐Ÿ›:bug:fixFixed bug in code.
๐Ÿ“’:ledger:docsUpdated documentation for project.
๐Ÿธ:cocktail:styleUpdated code formatting and styling.
๐ŸŽจ:art:refactorRefactoring code in project.
โœ…:white_check_mark:testAdding or updating tests.
๐Ÿ”ง:wrench:choreFixing unreported issue in code.
๐Ÿš€:rocket:chorePerfoming deployment for code.
๐Ÿ”’:lock:choreFixing security issues.
๐Ÿšง:construction:featWork in progress.
โฌ†๏ธ:arrow_up:choreUpgrading dependecies.
โž•:heavy_plus_sign:choreAdding a dependency.
โž–:heavy_minus_sign:choreRemoving a dependency.
โช:rewind:choreReverting changes.
๐Ÿ”€:twisted_rightwards_arrows:choreMerging branches.
โ—๏ธ:heavy_exclamation_mark:featAdding breaking changes.
๐Ÿท๏ธ:label:choreUpdating type definitions.
๐Ÿ—‘๏ธ:wastebasket:choreRemove deprecated code.
๐ŸŽ‰:tada:featInitial commit.
โšก๏ธ:zap:featPerformance improvement.
๐Ÿ†˜:sos:choreCritical hotfix.
โฌ‡๏ธ:arrow_down:choreDowngrading dependecies.
๐Ÿ’š:green_heart:choreFix CI build.
๐ŸŒ‡:city_sunrise:choreInfrastructure changes.