Skip to content

iamyoki/committier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

icon committier - Make your commits PRO with ease

Release Docs Website NPM Version (with dist tag)

committier ❀️ commitlint

Check out the website πŸ”—

🌟 AI commit generator is now available in Beta (Free, Local, Light, Zero-Deploy, Fast, CPU friendly)

demo

Features

committier

  • Fix and format rough commit messages into conventioanl commits
  • Adopt commitlint
  • Automatically format once git commit -m '...', see Git hook setup
  • Automatically append emoji, scope, and default commit messages
  • User-friendly commit CLI tool
  • AI commits generator

committier ai (Beta)

A completely free, local, light, cpu, zero-deploy AI assitant. Use AI with just one command. No API, no prerequisites and no setup needed.

  • ✨ Generate commit message
  • πŸ“ Summarize changes
  • 🧠 Provide suggestions for improvement
  • πŸ” Find bugs
  • πŸ’¬ Ask AI

What is committier

committier fixes and formats your git commit messages meet the conventional commit format. Unlike commitlint, it only attempts to format and fix formatting styles without performing strict rules validation. Similar to Prettier and ESLint, it integrates well with both.

It does:

  • Attemps to format and fix
  • Attemps to infer the type, scope, breaking change mark(!), description
  • Infer the scope from workspace package names
  • Remove extra spaces in the body and footer
  • And more...

Install

pnpm add committier -D

yarn add committier -D

npm i committier -D

Or install globally

pnpm add -g committier

Or directly execute

npx committier <command>

pnpm dlx committier <command>

NOTE: committier ai is now in Beta pnpm add committier@beta -D

Usage

Format

committier format <message>

Format and preview the message

Git Hook

committier edit <file>

Using a git hooks manager

Checkout husky official documentation

pnpm add husky -D
pnpm husky init

Add hook

Edit .husky/commit-msg, add npx --no -- committier edit $1

+ npx --no -- committier edit $1
npx --no -- commitlint --edit $1

Note, there is no '--' before 'edit' command in committier but commitlint.

AI

committier ai

ai

ai2

Commit CLI Tool

committier commit

commit cli

pnpm committier commit

Or you can add a script in package.json

{
  "scripts": {
    "commit": "committier commit",
    "commit:ai": "committier ai"
  }
}

Then

pnpm commit

Test and preview commit with dry-run mode

It's useful if you only want to test the commit experience.

committier commit --dry-run

dry run

Integrate commitlint

Make sure commitier runs before commitlint

.husky/commit-msg

npx --no -- committier edit $1
npx --no -- commitlint --edit $1

If your enabled autoEmoji: true (default: true), make sure to set our commitlintEmojiParser, because commitlint doesn't accept any emoji by default.

commitlint.config.js

import { commitlintEmojiParser } from "committier/commitlint-emoji-parser"";

export default {
  extends: ["@commitlint/config-conventional"],
  parserPreset: commitlintEmojiParser,
};

API

Config

Create a .committerrc.json file at root, you can partially add fields to override the default config.

Default config:

{
  "autoEmoji": true, // boolean
  "autoScope": false, // boolean | 'replaceToPackageName' (true) | 'defaultToPackageName'
  "defaultType": "fix",
  "defaultDescription": false, // boolean | "fileName" (true) | "fileBasename" | "filePath"
  "types": {
    "feat": {
      "emoji": "✨",
      "title": "Feature",
      "description": "A new feature"
    },
    "fix": {
      "emoji": "πŸ›",
      "title": "Bug Fixes",
      "description": "A bug fix"
    },
    "refactor": {
      "emoji": "♻️",
      "title": "Code Refactoring",
      "description": "A code change that neither fixes a bug nor adds a feature"
    },
    "perf": {
      "emoji": "⚑️",
      "title": "Performance Improvements",
      "description": "A code change that improves performance"
    },
    "chore": {
      "emoji": "🎨",
      "title": "Chores",
      "description": "Other changes that don't modify src or test files",
      "scopes": [
        {
          "match": "release",
          "emoji": "πŸš€",
          "title": "Release",
          "description": "A new release"
        }
      ]
    },
    "test": {
      "emoji": "πŸ§ͺ",
      "title": "Tests",
      "description": "Adding missing tests or correcting existing tests"
    },
    "style": {
      "emoji": "πŸ’„",
      "title": "Styles",
      "description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"
    },
    "docs": {
      "emoji": "πŸ“",
      "title": "Documentation",
      "description": "Documentation only changes"
    },
    "revert": {
      "emoji": "βž–",
      "title": "Reverts",
      "description": "Reverts a previous commit"
    },
    "build": {
      "emoji": "πŸ“¦οΈ",
      "title": "Builds",
      "description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)"
    },
    "ci": {
      "emoji": "πŸ‘·",
      "title": "Continuous Integrations",
      "description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)"
    },
    "breakingChange": {
      "emoji": "πŸ’₯",
      "title": "Breaking Changes",
      "description": "Introduce breaking changes."
    }
  }
}

License

ISC

About

Fix and format commit messages.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •