Skip to content

Commit 3184e19

Browse files
authored
feat(cz-git.czg): support use OpenAI to generate commit subjects (#93)
close #92
1 parent 7ae8321 commit 3184e19

53 files changed

Lines changed: 1066 additions & 159 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.commitlintrc.cjs‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,20 @@ module.exports = {
3030
prompt: {
3131
// @see: https://github.com/Zhengqbbb/cz-git#options
3232
alias: {
33-
'b': 'chore: bump dependencies' + coAuthoredBy,
34-
'c': 'chore: update config files' + coAuthoredBy,
35-
'f': 'docs: fix typos' + coAuthoredBy,
36-
':': 'docs: update README' + coAuthoredBy,
37-
'table:data': 'chore: :hammer: update project using table data' + coAuthoredBy,
38-
'table:docs': 'docs: update project using table' + coAuthoredBy,
33+
'b': 'chore: bump dependencies',
34+
'c': 'chore: update config files',
35+
'f': 'docs: fix typos',
36+
':': 'docs: update README',
37+
'table:data': 'chore: :hammer: update project using table data',
38+
'table:docs': 'docs: update project using table',
3939
},
4040
themeColorCode: '38;5;043',
4141
issuePrefixes: [
4242
{ value: 'link', name: 'link: Work in processing to ISSUES' },
4343
{ value: 'closed', name: 'closed: ISSUES has been processed' },
4444
],
45+
aiNumber: 5,
46+
aiDiffIgnore: [ 'pnpm-lock.yaml', 'docs/public' ],
4547
customIssuePrefixAlign: !issue ? 'top' : 'bottom',
4648
defaultIssues: !issue ? '' : `#${issue}`,
4749
formatMessageCB: ({ defaultMessage }) => defaultMessage + coAuthoredBy,

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ body:
2222
attributes:
2323
label: 📄 System Info
2424
description: Output of `npx envinfo --system --binaries --npmPackages cz-git --npmPackages commitizen --npmPackages czg --npmGlobalPackages cz-git --npmGlobalPackages commitizen --npmGlobalPackages czg`
25-
render: shell
25+
render: Shell
2626
placeholder: System, Binaries, Terminal, czg --version
2727
validations:
2828
required: true

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ node_modules
66
sitemap.xml
77
urls.txt
88
dist
9+
.note
10+
.temp
911
docs/.vitepress/cache
1012

1113
# Mac OS

‎README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
## Introduction
5353

54-
More engineered, lightweight, customizable, standard output format [commitizen adapter](https://github.com/commitizen/cz-cli) and [CLI](https://cz-git.qbb.sh/cli/).
54+
Support OpenAI, and more engineered, lightweight, customizable, standard output format [Commitizen adapter](https://github.com/commitizen/cz-cli) and [Git commit CLI](https://cz-git.qbb.sh/cli/).
5555

5656
![demo-gif](https://user-images.githubusercontent.com/40693636/188255006-b9df9837-4678-4085-9395-e2905d7ec7de.gif)
5757

@@ -60,17 +60,18 @@ More engineered, lightweight, customizable, standard output format [commitizen a
6060
6161
## Feature
6262

63+
- 🤖 **OpenAI support.** Let the AI generate your git commit message.
6364
- 💪 Just to be a **lazy man** !!! Friendly command line tool, Supports **search and selection** on the command line, reducing spelling errors.
64-
- ⚡️ **Lightweight**, **Highly Customizable**, but the output format follows the standard [Angular commit](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) specification.
65+
- ⚡️ **Lightweight**, **Highly Customizable**, but the output format follows the standard [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
6566
- 🔨 [Better for monorepo engineering](https://cz-git.qbb.sh/recipes/#scopes) and **commitlint** project to give relevant verification information to the command line.
6667
- ✅ Support commit with **emoji** | Better linking with [issuePrefix](https://cz-git.qbb.sh/recipes/default-issues.html) **for issue**
6768

6869
[⇒ Why cz-git](https://cz-git.qbb.sh/guide/why.html)
6970

7071
```bash
7172
$ npm i -D cz-git
72-
+ cz-git (1.6 MB)
73-
added 1 package in 0.482s
73+
+ cz-git (1.9 MB)
74+
added 1 package in 0.582s
7475
```
7576

7677
## Usage

‎docs/.vitepress/build/plugins/unocss.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ export const unocssPlugin = Unocss({
2727
presetAttributify(),
2828
presetIcons({
2929
scale: 1.2,
30+
extraProperties: {
31+
'display': 'inline-block',
32+
'vertical-align': 'text-bottom',
33+
},
3034
}),
3135
// presetWebFonts({
3236
// fonts: {

‎docs/.vitepress/config/navbar/en.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const nav: DefaultTheme.NavItem[] = [
1414
},
1515
{
1616
text: 'Recipes',
17-
link: '/recipes/',
17+
link: '/recipes/openai',
1818
activeMatch: '/recipes/',
1919
},
2020
{

‎docs/.vitepress/config/navbar/zh.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const nav: DefaultTheme.NavItem[] = [
1414
},
1515
{
1616
text: '窍门',
17-
link: '/zh/recipes/',
17+
link: '/zh/recipes/openai',
1818
activeMatch: '/zh/recipes/',
1919
},
2020
{

‎docs/.vitepress/config/sidebar/en.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export const sidebar: DefaultTheme.Sidebar = {
2424
text: 'Subcommands',
2525
collapsed: false,
2626
items: [
27+
{
28+
text: 'ai',
29+
link: '/cli/ai',
30+
},
2731
{
2832
text: 'break',
2933
link: '/cli/break',
@@ -102,6 +106,10 @@ export const sidebar: DefaultTheme.Sidebar = {
102106
text: 'Recipes',
103107
collapsed: false,
104108
items: [
109+
{
110+
text: 'OpenAI',
111+
link: '/recipes/openai',
112+
},
105113
{
106114
text: 'scopes',
107115
link: '/recipes/',

‎docs/.vitepress/config/sidebar/zh.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export const sidebar: DefaultTheme.Sidebar = {
2424
text: '子命令',
2525
collapsed: false,
2626
items: [
27+
{
28+
text: 'ai',
29+
link: '/zh/cli/ai',
30+
},
2731
{
2832
text: 'break',
2933
link: '/zh/cli/break',
@@ -102,6 +106,10 @@ export const sidebar: DefaultTheme.Sidebar = {
102106
text: '窍门',
103107
collapsed: false,
104108
items: [
109+
{
110+
text: 'OpenAI',
111+
link: '/zh/recipes/openai',
112+
},
105113
{
106114
text: 'scopes',
107115
link: '/zh/recipes/',

‎docs/.vitepress/meta.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export const siteCN = 'https://cz-git.qbb.sh/zh/'
55
export const logo = 'https://cz-git.qbb.sh/images/logo.png'
66
export const keywords = 'cz-git, czg, cli, commitizen, commitizen cli,commitizen adapter, git-cz'
77
export const descriptionEN
8-
= 'More engineered, lightweight, customizable, standard output format commitizen adapter and CLI.'
8+
= 'Support OpenAI, and more engineered, lightweight, customizable, standard output format commitizen adapter and Git commit CLI'
99
export const descriptionCN
10-
= '工程性更强,轻量级,高度自定义,输出标准格式的 commitizen 适配器与 git commit 命令行工具。'
10+
= '支持 OpenAI 自动生成描述,且工程性更强,轻量级,高度自定义,输出标准格式的 commitizen 适配器与 git commit 命令行工具。'
1111

1212
/** social links */
1313
export const ogTitle = 'cz-git - commitizen adapter and CLI'

0 commit comments

Comments
 (0)