Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

czg

Zhengqbbb81kMIT1.11.1TypeScript support: included

Interactive Commitizen CLI that generate standardized git commit message

openai, commit, commit CLI, commit message, commitizen, commitizen-cli, cli, cz-git, cz-customizable

readme

czg

Interactive Commitizen CLI that generate standardized git commit message

CLI-Link awesome-cli-app
GitHub Repo stars
npm homebrew

GitHub   |   Installation   |   Website   |   简体中文文档



  • ⚡️ Lightweight : Zero Dependencies (1.32MB)
  • 🤗 Simpler and Faster : No plugin, No adapter, No extra steps, You can use npx | npm script | global install... quick start CLI in your any project
  • 😎 Highly Customizable : Internally contains the core of cz-git. Extend all the features of cz-git. Same behavior, Same configuration loader... You can customize the commit CLI according to your need
  • 🤖 OpenAI Support. Let the AI generate your git commit message description.

demo

Quick start

  1. Now try it out, use npx czg in your any projects
  2. And then, let's try to simply configure it. Create a .czrc file in the project root directory
{
  "scopes": [
    "hello",
    "world"
  ]
}

Note More information about configure file and options. See → Config

Features and Help

$ czg --help
NAME:
    czg - Interactive Commitizen CLI that generate standardized git commit message

WEBSITE:
    https://cz-git.qbb.sh/cli/
    https://github.com/Zhengqbbb/cz-git

SYNOPSIS:
    czg [subcommand...] [options...] [git-commit-options...]

SUBCOMMAND:
    ai               Turn on OpenAI generate subject mode
    break            Turn on appends a ! after the type/scope
    emoji            Turn on output message with emoji mode
    checkbox         Turn on scope checkbox mode
    gpg              Turn on use GPG sign commit message

OPTIONS:
    :, --alias=      Directly submit the defined commit message
    --config=        Specify the configuration file to use

  OpenAI:
    -N=,--ai-num=    Sets AI return multiple subjects and Turn on choose mode
    -M=,--ai-model=  Sets AI model in this session
                     [default: "gpt-4o-mini"]
                     [example: "gpt-3.5-turbo", "gpt-4o", "gpt-4o-mini" ...]
    --api-key=       Setup request OpenAI API secret key to local (.config/.czrc)
    --api-model=     Setup request OpenAI API model      to local (.config/.czrc)
    --api-proxy=     Setup request OpenAI API proxy      to local (.config/.czrc)
    --api-endpoint=  Setup request OpenAI API endpoint   to local (.config/.czrc)
                     [default: "https://api.openai.com/v1"]

FLAG:
    -r, --retry      Directly retry submit by the last message
    --no-ai          Turn off AI prompt mode in this session
    --unset-proxy    Unset request API proxy on local configure
    -h, --help       Show help
    -v, --version    Show version

EXAMPLES:
    czg
    czg emoji
    czg :fd
    czg --config="./config/cz.json"
    czg --api-key="sk-XXXXX"
    czg ai -N=3 -M="gpt-4o"

Extends 'git commit' options.
See 'git commit --help' for more information.

Installation

「czg」 requires Node >=v12.20

npm install -g czg

MacOS:

brew install czg

⇒ Get Started (more installation and usage)

Configure

⇒ Configure Template

⇒ Show Related

⇒ Engineering Related

Recipes

⇒ Recipes

FAQ

⇒ FAQ

Projects using czg CLI

Nx logo
Nx
Element Plus logo
Element Plus
TDesign-Vue-Next logo
TDesign-Vue-Next
Vben-Admin logo
Vben-Admin

LICENSE

MIT Copyright (c) 2022-present Qiubin Zheng zhengqbbb@gmail.com (https://github.com/Zhengqbbb)


I just try my best to make thing well.
Could you give a star ⭐ to encourage me 🤗
If possible, can to be my 💖 Sponsor 💖 to support my work

changelog

1.11.2 (2025-06-13)

Bug Fixes

  • cz-git: without scope calc maxSubjectLength error (#230) (1a9b61c)

1.11.1 (2025-03-03)

Bug Fixes

  • cz-git: default option types add undefined keyword (c7a2d5d), closes #206
  • docs: Fixed typo 'userEmoji -> useEmoji (#212) (f0231ae)
  • plugin-loader: loading ESM configure using URL format (#219) (50d7675), closes #216 #217
  • plugin-loader: when CZ_DEBUG=1 --config specify config file not show (8557221), closes #207

1.11.0 (2024-11-08)

Bug Fixes

  • cz-git,cli: node v12 v14 startup error (#200) (a760f62)
  • plugin-inquirer: press tab or right key exit error when input no complete value (4cffb1a)

Features

  • cz-git,czg: provide config file type helper fn defineConfig and definePrompt (#196) (c6589de), closes #193
  • plugin-loader: support esm and ts(experiment) configure load (#197) (1288093)

1.10.1 (2024-10-06)

Bug Fixes

  • cz-git: rollback max_token to avoid AI message sliced (ea9dc0c), closes #189

1.10.0 (2024-09-28)

Bug Fixes

  • cli: upgrade commitlint version to resolve config extension issue (#187) (dee8b44), closes #186

Features

  • cz-git,cli: add aiModel option to support multiple OpenAI models (#185) (241577b), closes #180
  • cz-git: add env CZ_EDITOR to change editor during confirm (#174) (0fad291)

Performance Improvements

  • cli: remove fs-extra. bundle size -100KB (79a7833)

1.9.4 (2024-07-19)

Bug Fixes

  • suppress node 22 deprecated error messages (#179) (9f4ff58)

1.9.3 (2024-06-11)

Bug Fixes

  • cli: czg export type can not be used (#175) (4fe94cf)

1.9.2 (2024-05-26)

Bug Fixes

  • cz-git: incorrect maxSubjectLength on custom scope (#173) (baa58ae)

1.9.1 (2024-03-30)

Bug Fixes

1.9.0 (2024-03-03)

Bug Fixes

  • loader: support commitlint v19 esm plugin extends config (#161) (e410465), closes #160

1.8.0 (2023-12-06)

Features

  • cz-git,cli: defaultScope support string[] to default-select for checkbox mode (#148) (a02b7d1), closes #140

1.7.1 (2023-08-08)

Bug Fixes

1.7.0 (2023-07-09)

Bug Fixes

  • windows system is unable to load the global configuration (#133) (d09fee4), closes #132

Features

  • cz-git,cli: allow set scope as direct input to use (#113) (a2a4443)
  • cli: add --api-endpoint | rename --api-key (#136) (4bd33f5)
  • cli: add type for js config (#135) (9ca09aa)
  • cz-git,cli: confirm message subject colorizen themeColorCode (723dfe8)

Performance Improvements

  • cz-git,czg: reduce duplicate deps in bundle (#111) (2a52479)

1.6.1 (2023-03-22)

Bug Fixes

  • cz-git: allowEmptyScopes not work when not provide scopes (ee0f045), closes #109

1.6.0 (2023-03-11)

Features

  • cz-git,cli: add aiType option to switch openAI model (#102) (e956ca0), closes #101
  • cz-git,cli: add JSON schema provide to JSON configure e.g .czrc (c113e53)
  • cz-git,czg: add modify message with prompt on AI confirm (#103) (59b55c7)

1.5.3 (2023-03-04)

Features

  • cz-git,cli: add --api-proxy to setup openai api http proxy (close #98)(#100) (f673262)

1.5.2 (2023-03-04)

Features

  • cz-git,cli: add HTTPS proxy support for OpenAI API requests (#97) (0de320a)

1.5.1 (2023-03-02)

Features

  • cz-git,cli: use gpt-3.5-turbo openai model (#96) (5018654)

1.5.0 (2023-02-18)

Features

  • cz-git.czg: support use OpenAI to generate commit subjects (#93) (3184e19), closes #92

1.4.1 (2022-12-11)

Features

  • cz-git,cli: add confirmCommit in skipQuestions #86 (#88) (1167109)

1.4.0 (2022-12-04)

Bug Fixes

  • fix(cz-git,czg)!: fix typo option issuePrefixs field #82 (#84) (febeba9)

Features

  • cz-git,czg: add scopesSearchValue boolean option field #83 (#85) (867eb87)

⚠ BREAKING CHANGES

  • cz-git,czg: rename option typesSearchValueKey to typesSearchValue
    • Already processed for normal compatibility
  • cz-git,czg: main fix issuePrefixs typo field
    • Current version has been already processed for normal compatibility
    • But I also hope that you can modify this message as soon as possible
{
  message: {
-   footerPrefixsSelect
+   footerPrefixesSelect

-   customFooterPrefixs
+   customFooterPrefix
 }

-   issuePrefixs
+   issuePrefixes

-   customIssuePrefixsAlign
+   customIssuePrefixAlign

-   emptyIssuePrefixsAlias
+   emptyIssuePrefixAlias

-   customIssuePrefixsAlias
+   customIssuePrefixAlias

-   allowCustomIssuePrefixs
+   allowCustomIssuePrefix

-   allowEmptyIssuePrefixs
+   allowEmptyIssuePrefix
}

Co-authored-by: Chris

1.3.12 (2022-10-21)

Bug Fixes

  • cz-git,czg: add ignore commitlint warning max length rule #72 (closed #71) (46346b4)

Features

  • plugin-loader: add cz.config.cjs config profiles (#73) (a915085)

⚠ BREAKING CHANGES

  • plugin-loader: remove .cz.js default loaded configure file The configuration items. see: Configure Template

1.3.11 (2022-08-21)

Bug Fixes

  • cz-git: fix breaking change break line default format (c073ec7)
  • cz-git: fix empty custom output 'CUSTOM' value (d1475d5), closes #55

Features

  • cli: support GPG sign commit message (c9caa97), closes #58
  • cz-git: add formatMessageCB can custom finally commit message (754c738), closes #57
  • cz-git: support types fuzzy search types[name] options (ba4ce71), closes #57

1.3.10 (2022-07-23)

Features

  • cli: add git-czg git enter command (de4d7ed)
    • Can use git czg to start czg CLI
  • cli: optimize czg retry option cache error message (#48) (757517b)
  • cz-git,cli: optimize the prompt msg when alias undefined (40bd1a2)

Other

1.3.9 (2022-07-01)

Features

1.3.8 (2022-06-26)

Bug Fixes

  • cli: remove BREAKINGCHANGE question limit when czg break (1bf9a72)

1.3.7 (2022-06-25)

Bug Fixes

  • cz-git: remove markBreakingChangeMode restrictions on BREAKINGCHANGE footer (a745bf2), closes #38

1.3.6 (2022-06-25)

Features

Performance Improvements

  • cz-git: cz-git packages size 1.7MB => 1.5MB (665d509)
  • cz-git: change bundle strategy | reduce 0.14MB (1f1e746), closes #37

1.3.5 (2022-06-16)

Features

  • cz-git: optimize scope list for empty #35 (#34) (4a38b92)

  • cz-git: add defaultFooterPrefix provide custom footer prefix (90f473b)

Refactor

  • site: new website deploy | use vitepress (d2a310e)

see: https://cz-git.qbb.sh/

1.3.4 (2022-06-04)

Features

  • cz-git: use complete-input inquirer plugin replace input (ca133bf), closes #32
  • plugin-inquirer: add ansiEscapes to control corsor move (e8dac95), closes #32
  • plugin-inquirer: add complete-input inquirer plugin (b20bbc1), closes #32
  • plugin-inquirer: checkbox and list support use tab key move down list (e38ed9f), closes #32

1.3.3 (2022-05-28)

Features

  • cz-git: add defaultType options (51f79c8), closes #30
  • cz-git: add scopeFilters options to filter scopes item (86e95a7), closes #30
  • plugin-loader: add more configure file to enhance js define (54bd3ab), closes #30
  • plugin-loader: support function option and can custom define config path (4db5914), closes #30
$ npm i -D cz-git

+ cz-git@1.3.2
added 1 package from 1 contributor and audited 1 package in 0.461s

$ du -sh ./node_modules
1.7M ./node_modules/cz-git/

1.3.2 (2022-05-21)

Features

  • cz-git: add theme color for prompt inquirer (d776149), closes #28
  • cz-git: use search-list replace autocomplete (5dbe4e2), closes #28
  • plugin-inquirer: checkbox support theme color configure (8c2effe)
  • plugin-inquirer: done search-list inquirer plugin (ad12f75), closes #28

Performance Improvements

  • :zap: update tsup bundle build cz-git (0e15e1c)
$ npm i -D cz-git

+ cz-git@1.3.2
added 1 package from 1 contributor and audited 1 package in 0.47s

$ du -sh ./node_modules
1.8M ./node_modules/cz-git/

1.3.1 (2022-05-14)

$ npm i -D cz-git

+ cz-git@1.3.1
added 1 package from 1 contributor and audited 1 package in 0.611s

$ du -sh ./node_modules
5.6M ./node_modules/cz-git/

Bug Fixes

  • plugin-inquirer: bump inquirer version (1111fda)

1.3.0 (2022-05-14)

Bug Fixes

  • cz-git: fix emoji and checkbox subcmd usage (9efe275)

Features

  • cz-git: add get command arg to set useEmoji and enableMultipleScopes (2cebeea)
  • cz-git: configure loader extract, perf load speed (d4ec683), closes #24 #25
  • cz-git: update ci defalut emoji code: ferris_wheel (4df8de8)

BREAKING CHANGES

  • cz-git: No supprt typescript config define file. commitlint.config.ts

1.2.9 (2022-05-12)

Bug Fixes

  • cz-git: fix empty scope err validate for not allow empty (654f75f)

Features

  • cz-git: add multiple scopes mode (89470d9), closes #14
  • plugin-inquirer: add figures symbols (3eea116)
  • plugin-inquirer: add separator option for checkbox multiple (3eaab45)
  • plugin-inquirer: add style util Fuc to output colorizen of prompt (9c48ace)
  • plugin-inquirer: done checkbox inquirer plugin for multiple (26b54c5), closes #14
  • plugin-inquirer: done the checkbox core render (2849162), closes #14

1.2.8 (2022-04-30)

Features

  • cz-git: use fuzzy search for type, scope and issues list (b82fbf9), closes #22
  • plugin-inquirer: add fuzzy match str util funtion (efde652), closes #22
  • plugin-inquirer: add fuzzyFilter util Fuc provide cz-git (83f773e), closes #22

1.2.7 (2022-04-27)

Bug Fixes

1.2.6 (2022-04-27)

Bug Fixes

  • cz-git: fix breaking char priority than maxNumber (4f463fa)

Features

  • cz-git: support single item intelligent filter ouput of scope and issueprefix (73f688c), closes #12
  • cz-git: upgrade inquirer dep version 8.2.2 (fbbf429)

Reverts

  • cz-git: fix getSingleParams use error param (3c32415)

1.2.5 (2022-04-23)

Bug Fixes

  • cz-git: both check the scope empty rule use ruleIsNotApplicable (3545cce), closes #15
  • cz-git: use strict empty scope strategy (ba44c8d), closes #12 #15

1.2.4 (2022-04-23)

Bug Fixes

  • cz-git: fix custom scope skip allowEmptyScopes check (f0d8c53), closes #16
  • cz-git: fix minor issues in default messages (99d8cc4)

Features

  • cz-git: add strict issuePrefixs configure (f2d11a9), closes #12
  • cz-git: allowEmptyScopes can base on ["scope-empty"] rule (4d3eff9), closes #15
  • cz-git: use defaultScope can star item of scope list (b899d2c), closes #16

1.2.3 (2022-04-07)

Features

  • cz-git: add typesAppend options to add extra types to default types (8e8d4cc)

1.2.2 (2022-03-30)

Features

  • cz-git: add max string number to break line for Body and BreakingChange (e9fe6ae), closes #6

1.2.1 (2022-03-11)

Bug Fixes

  • cz-git: fix limit length defind commitlint config (f602c9e)

1.2.0 (2022-03-06)

Features

  • guide: done cz-git website page and guide document (941bbe7), closes #4

1.1.8 (2022-03-04)

Features

  • cz-git: add auto get issue id (05ae340)

BREAKING CHANGES

1.1.7 (2022-03-03)

Features

  • cz-git: keep inquirer dep version same lerna inquirer version (a2de902)

1.1.3 (2022-03-03)

Features

  • cz-git: init monorepo project (ef6f30d), closes #2
  • cz-git: reduce commitizen dev number and lock commitilint load (2b207be), closes #2
  • cz-git: reduce commitlint type dev (8427b2b)
  • cz-git: reduce editor dev (d709130)
  • cz-git: reduce inquirer dev number (7efb64f)
  • cz-git: reduce word-wrap and temp dev number (e94f05a), closes #2

1.1.2 (2022-03-03)

Features

  • cz-git: init monorepo project (ef6f30d), closes #2
  • cz-git: reduce commitizen dev number and lock commitilint load (2b207be), closes #2
  • cz-git: reduce commitlint type dev (8427b2b)
  • cz-git: reduce editor dev (d709130)
  • cz-git: reduce word-wrap and temp dev number (e94f05a), closes #2

1.1.2 (2022-03-03)

Features

  • cz-git: init monorepo project (ef6f30d), closes #2
  • cz-git: reduce commitizen dev number and lock commitilint load (2b207be), closes #2
  • cz-git: reduce commitlint type dev (8427b2b)
  • cz-git: reduce editor dev (d709130)
  • cz-git: reduce word-wrap and temp dev number (e94f05a), closes #2

1.1.1 (2022-02-28)

Bug Fixes

  • cz-git: fix footerPrefix custom (fc8dc78)

1.1.0 (2022-02-28)

Features

  • cz-git: done document README.Marks the official version release (31e8b4d), closes #1

1.0.9 (2022-02-27)

⚠ BREAKING CHANGES

  • cz-git: - customScopesAlign and customIssuePrefixsAlign: can change align in selet
  • emptyScopesAlias, customScopesAlias, emptyIssuePrefixsAlias, customIssuePrefixsAlias: can change name of the prompt show

Features

  • cz-git: add align and alias option for selector (5be93a5), closes #1
  • cz-git: add allowEmptyScopes, allowCustomScopes to control disable (e0becb6), closes #1

Bug Fixes

  • cz-git: fixed use both maxHeaderLength and maxSubjectLengt (659b8eb), closes #1

1.0.8 (2022-02-24)

⚠ BREAKING CHANGES

  • feat: allowCustomScopes and allowCustomScopes control disable
  • feat: scopes can auto load value from commitlint
  • cz-git: - customScopesAlign and customIssuePrefixsAlign: can change align in selet
  • emptyScopesAlias, customScopesAlias, emptyIssuePrefixsAlias, customIssuePrefixsAlias: can change name of the prompt show

Features

  • cz-git: add align and alias option for selector (5be93a5), closes #1
  • cz-git: add allowEmptyScopes, allowCustomScopes to control disable (e0becb6), closes #1

1.0.7 (2022-02-22)

⚠ BREAKING CHANGES

  • cz-git: confirmColorize option: Prompt final determination whether to display the color

Features

  • cz-git: add confirmColorize option to handle confirm colorize (68b2629), closes #1

1.0.6 (2022-02-21)

⚠ BREAKING CHANGES

  • cz-git: add option breaklineChar

Features

  • cz-git: add breaklineChar option to make new line for body and BreakingChanges (6691c26), closes #1

1.0.5 (2022-02-21)

Features

  • cz-git: support both head and subject max rules (2444724), closes #1

1.0.4 (2022-02-19)

⚠ BREAKING CHANGES

  • cz-git: Need open option useEmoji

Features

  • cz-git: :sparkles: support commit add emoji (dd7d9e0), closes #1

1.0.3 (2022-02-19)

⚠ BREAKING CHANGES

  • cz-git: e.g: { value: "cz-git", name: "cz-git: core control" }

Features

  • cz-git: scopes config support value to add descrition for selector (980f163), closes #1

1.0.2 (2022-02-18)

⚠ BREAKING CHANGES

1.0.1 (2022-02-18)

Features

  • config: add standard-version to generate CHANGELOG (08f5b77)

Bug Fixes

  • cz-git: fix package main enter file path (a1ec4e0)

1.0.0 (2022-02-18)

Features

  • cz-git: done commit prompt overall process (bfb969c), link #1