5
5
6
6
[ 简体中文] ( README-zh_CN.md ) | [ ENGLISH] ( README.md ) | [ 日本語] ( README-ja.md ) | [ 繁體中文] ( README-zh_TW.md )
7
7
8
- > Automagically generate conventional git commit message with AI. - 使用 AI 自動生成約定式 git 提交訊息 。
8
+ > Automagically generate conventional git commit message with AI. - 使用 AI 自动生成约定式 git 提交信息 。
9
9
10
10
[ ![ tests] ( https://github.com/guanguans/ai-commit/workflows/tests/badge.svg )] ( https://github.com/guanguans/ai-commit/actions )
11
11
[ ![ check & fix styling] ( https://github.com/guanguans/ai-commit/actions/workflows/php-cs-fixer.yml/badge.svg )] ( https://github.com/guanguans/ai-commit/actions )
21
21
- [x] [ ERNIE-Bot-turbo] ( https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu#ernie-bot-turbo )
22
22
- [x] [ ERNIE-Bot] ( https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu#ernie-bot )
23
23
- [x] [ GitHub Copilot CLI] ( https://github.com/github/gh-copilot )
24
+ - [x] [ GitHub Models CLI] ( https://github.com/github/gh-models )
24
25
- [x] [ Moonshot] ( https://platform.moonshot.cn/docs/api-reference )
25
26
- [x] [ OpenAI Chat] ( https://platform.openai.com/docs/api-reference/chat )
26
27
- [x] [ OpenAI] ( https://platform.openai.com/docs/api-reference/completions )
@@ -51,50 +52,74 @@ composer require guanguans/ai-commit --dev -v # 本地安裝
51
52
### 快速開始
52
53
53
54
``` shell
54
- ./ai-commit config set generators.bito_cli.binary bito-cli-binary... --global # 設定 Bito cli 執行檔(可選)
55
- ./ai-commit config set generators.ernie_bot.api_key api-key... --global # 設定 Ernie API 金鑰
56
- ./ai-commit config set generators.ernie_bot_turbo.api_key api-key... --global # 設定 Ernie API 金鑰
57
- ./ai-commit config set generators.github_copilot_cli.binary gh-cli-binary... --global # 設定 Github cli 執行檔(可選)
58
- ./ai-commit config set generators.moonshot.api_key sk-... --global # 設定 Moonshot API 金鑰
59
- ./ai-commit config set generators.openai.api_key sk-... --global # 設定 OpenAI API 金鑰
60
- ./ai-commit config set generators.openai_chat.api_key sk-... --global # 設定 OpenAI API 金鑰
61
-
62
- ./ai-commit config set generator openai_chat --global # 設定預設生成器(可選)
63
- ./ai-commit commit # 使用預設生成器產生並提交訊息
64
- ./ai-commit commit --generator=github_copilot_cli # 使用指定的生成器產生並提交訊息
55
+ ./ai-commit config set generators.bito_cli.binary bito-cli-binary... --global # Config Bito CLI binary(Optional)
56
+ ./ai-commit config set generators.ernie_bot.api_key api-key... --global # Config Ernie API key
57
+ ./ai-commit config set generators.ernie_bot_turbo.api_key api-key... --global # Config Ernie API key
58
+ ./ai-commit config set generators.github_copilot_cli.binary gh-cli-binary... --global # Config Github CLI binary(Optional)
59
+ ./ai-commit config set generators.github_models_cli.binary gh-cli-binary... --global # Config Github CLI binary(Optional)
60
+ ./ai-commit config set generators.moonshot.api_key sk-... --global # Config Moonshot API key
61
+ ./ai-commit config set generators.openai.api_key sk-... --global # Config OpenAI API key
62
+ ./ai-commit config set generators.openai_chat.api_key sk-... --global # Config OpenAI API key
63
+
64
+ ./ai-commit config set generator openai_chat --global # Config default generator(Optional)
65
+ ./ai-commit commit # Generate and commit message using the default generator
66
+ ./ai-commit commit --generator=github_copilot_cli # Generate and commit message using the specified generator
65
67
```
66
68
67
69
``` shell
68
- ╰─ ./ai-commit commit --generator=openai_chat --no-edit --no-verify --ansi ─╯
69
- 1. 產生提交訊息中:正在產生...
70
- {
71
- " subject" : " chore(ai-commit): update settings and commands" ,
72
- " body" : " - Set Width to 1200\n- Set Height to 742\n- Set TypingSpeed to 10ms\n- Set PlaybackSpeed to 0.2\n- Update git commands and sleep times"
73
- }
74
- 1. 產生提交訊息:✔
75
-
76
- 2. 確認提交訊息:確認中...
77
- +------------------------------------------------+---------------------------------------+
78
- | subject | body |
79
- +------------------------------------------------+---------------------------------------+
80
- | chore(ai-commit): update settings and commands | - Set Width to 1200 |
81
- | | - Set Height to 742 |
82
- | | - Set TypingSpeed to 10ms |
83
- | | - Set PlaybackSpeed to 0.2 |
84
- | | - Update git commands and sleep times |
85
- +------------------------------------------------+---------------------------------------+
86
-
87
- 是否要提交此訊息?(yes/no) [yes]:
70
+ ╰─ ./ai-commit commit --generator=bito_cli --no-edit --no-verify --ansi ─╯
71
+ 1. Generating commit message: generating...
72
+
73
+ Please choose commit type [Automatically generate commit type]:
74
+ [auto ] Automatically generate commit type
75
+ [feat ] A new feature
76
+ [fix ] A bug fix
77
+ [docs ] Documentation only changes
78
+ [style ] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
79
+ [refactor] A code change that neither fixes a bug nor adds a feature
80
+ [perf ] A code change that improves performance
81
+ [test ] Adding missing tests or correcting existing tests
82
+ [build ] Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
83
+ [ci ] Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
84
+ [chore ] Other changes that don' t modify src or test files
85
+ [revert ] Reverts a previous commit
86
+ > chore
87
+
88
+ RUN ' bito'
89
+ ERR Model in use: BASIC
90
+ ERR
91
+ ERR
92
+ OUT {
93
+ OUT "subject": "chore(ai-commit): update tape and gif resources",
94
+ OUT "body": "- Adjusted width and height settings in ai-commit.tape\n- Changed commit command generator from openai_chat to bito_cli\n- Updated ai-commit-vhs.gif file with new binary data"
95
+ OUT }
96
+ OUT
97
+ OUT
98
+ RES Command ran successfully
99
+ 1. Generating commit message: ✔
100
+
101
+ 2. Confirming commit message: confirming...
102
+ +-------------------------------------------------+-----------------------------------------------------------------+
103
+ | subject | body |
104
+ +-------------------------------------------------+-----------------------------------------------------------------+
105
+ | chore(ai-commit): update tape and gif resources | - Adjusted width and height settings in ai-commit.tape |
106
+ | | - Changed commit command generator from openai_chat to bito_cli |
107
+ | | - Updated ai-commit-vhs.gif file with new binary data |
108
+ +-------------------------------------------------+-----------------------------------------------------------------+
109
+
110
+ Do you want to commit this message? (yes/no) [yes]:
88
111
>
89
112
90
- 2. 確認提交訊息:✔
91
113
92
- 3. 提交訊息中:提交中...
114
+ 2. Confirming commit message: ✔
93
115
94
- 3. 提交訊息:✔
116
+ 3. Committing message: committing...
117
+
118
+ 3. Committing message: ✔
95
119
96
120
97
- [OK] 成功產生並提交訊息。
121
+ [OK] Successfully generated and committed message.
122
+
98
123
```
99
124
100
125

@@ -116,13 +141,13 @@ composer require guanguans/ai-commit --dev -v # 本地安裝
116
141
117
142
1.2.5
118
143
119
- 使用方式: ai-commit < command> [options] [arguments]
144
+ USAGE: ai-commit <command> [options] [arguments]
120
145
121
- commit 使用 AI 自動生成約定式提交訊息。
122
- completion 輸出 shell 自動完成腳本
123
- config 管理設定選項。
124
- self-update 允許自我更新建置應用程式
125
- thanks 感謝使用此工具。
146
+ commit Automagically generate conventional commit message with AI.
147
+ completion Dump the shell completion script
148
+ config Manage config options.
149
+ self-update Allows to self-update a build application
150
+ thanks Thanks for using this tool.
126
151
```
127
152
128
153
### 設定操作
@@ -143,46 +168,46 @@ composer require guanguans/ai-commit --dev -v # 本地安裝
143
168
```shell
144
169
╰─ ./ai-commit self-update ─╯
145
170
146
- 檢查新版本 ...
171
+ Checking for a new version ...
147
172
=============================
148
173
149
174
150
- [OK] 已從版本 1.2.4 更新至 v1.2.5。
175
+ [OK] Updated from version 1.2.4 to v1.2.5.
151
176
152
177
```
153
178
154
179
### 指令說明
155
180
156
181
```shell
157
- ╰─ ./ai-commit commit --help ─╯
158
- 描述:
159
- 使用 AI 自動生成約定式提交訊息。
182
+ ╰─ ./ai-commit commit --help ─╯
183
+ Description:
184
+ Automagically generate conventional commit message with AI.
160
185
161
- 用法:
186
+ Usage:
162
187
commit [options] [--] [<path>]
163
188
164
- 參數:
165
- path 工作目錄 [預設值: " /Users/yaozm/Documents/develop/ai-commit" ]
166
-
167
- 選項:
168
- --commit-options[= COMMIT-OPTIONS] 為 ` git commit` 指令附加選項 [預設值: [" --edit" ]] (可多值 )
169
- --diff-options[= DIFF-OPTIONS] 為 ` git diff` 指令附加選項 [預設值: [" :!*-lock.json" ," :!*.lock" ," :!*.sum" ]] (可多值 )
170
- -g , --generator= GENERATOR 指定生成器名稱 [預設值: " openai_chat" ]
171
- -p , --prompt= PROMPT 指定訊息生成的提示名稱 [預設值: " conventional" ]
172
- --no-edit 啟用或停用 git commit ` --no-edit` 選項
173
- --no-verify 啟用或停用 git commit ` --no-verify` 選項
174
- -c , --config[= CONFIG] 指定設定檔
175
- --retry-times= RETRY-TIMES 指定重試次數 [預設值: 3]
176
- --retry-sleep= RETRY-SLEEP 指定重試間隔毫秒數 [預設值: 200]
177
- --dry-run 僅生成訊息而不提交
178
- --diff[= DIFF] 指定差異內容
179
- -h , --help 顯示指定指令的說明。若未指定指令則顯示 list 指令的說明
180
- -q, --quiet 不輸出任何訊息
181
- -V, --version 顯示此應用程式版本
182
- --ansi| --no-ansi 強制(或停用 --no-ansi) ANSI 輸出
183
- -n , --no-interaction 不詢問任何互動問題
184
- --env[= ENV] 指令應在其下執行的環境
185
- -v| vv| vvv, --verbose 增加訊息的詳細程度:1 為正常輸出,2 為較詳細輸出,3 為偵錯輸出
189
+ Arguments:
190
+ path The working directory [default: "/Users/yaozm/Documents/develop/ai-commit"]
191
+
192
+ Options:
193
+ --commit-options[=COMMIT-OPTIONS] Append options for the `git commit` command [default: ["--edit"]] (multiple values allowed )
194
+ --diff-options[=DIFF-OPTIONS] Append options for the `git diff` command [default: [":!*-lock.json",":!*.lock",":!*.sum"]] (multiple values allowed )
195
+ -g, --generator=GENERATOR Specify generator name [default: "openai_chat"]
196
+ -p, --prompt=PROMPT Specify prompt name of message generated [default: "conventional"]
197
+ --no-edit Enable or disable git commit `--no-edit` option
198
+ --no-verify Enable or disable git commit `--no-verify` option
199
+ -c, --config[=CONFIG] Specify config file
200
+ --retry-times=RETRY-TIMES Specify times of retry [default: 3]
201
+ --retry-sleep=RETRY-SLEEP Specify sleep milliseconds of retry [default: 200]
202
+ --dry-run Only generate message without commit
203
+ --diff[=DIFF] Specify diff content
204
+ -h, --help Display help for the given command. When no command is given display help for the list command
205
+ -q, --quiet Do not output any message
206
+ -V, --version Display this application version
207
+ --ansi|--no-ansi Force (or disable --no-ansi) ANSI output
208
+ -n, --no-interaction Do not ask any interactive question
209
+ --env[=ENV] The environment the command should run under
210
+ -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
186
211
```
187
212
188
213
## 測試
0 commit comments