Skip to content

Commit 98337e2

Browse files
committed
Docs(README): Configure OpenAI API key
1 parent 0235478 commit 98337e2

3 files changed

Lines changed: 84 additions & 16 deletions

File tree

README-zh_CN.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,74 @@
2323

2424
### 直接下载 [ai-commit](./builds/ai-commit) 文件
2525

26-
```bash
26+
```shell
2727
curl 'https://raw.githubusercontent.com/guanguans/ai-commit/main/builds/ai-commit' -o ai-commit --progress
2828
chmod +x ai-commit
2929
```
3030

3131
### 通过 Composer 安装
3232

33-
```bash
34-
# 全局安装
33+
```shell
34+
# 全局
3535
composer global require guanguans/ai-commit --dev -v
3636

37-
# 本地安装
37+
# 本地
3838
composer require guanguans/ai-commit --dev -v
3939
```
4040

4141
## 使用
4242

43-
### 首次使用需配置 [OpenAI API key](https://platform.openai.com/account/api-keys)
43+
### 配置 [OpenAI API key](https://platform.openai.com/account/api-keys)
4444

45-
```bash
45+
```shell
4646
./ai-commit config set generators.openai.api_key sk-... --global
4747
```
4848

4949
### 生成且提交信息
5050

51-
```bash
51+
```shell
5252
./ai-commit commit
5353
```
5454

55+
```shell
56+
╰─ ./ai-commit commit ─╯
57+
1. Checking run environment: ✔
58+
2. Generating commit messages: generating...
59+
60+
[
61+
{
62+
"id": 1,
63+
"subject": "Docs(README): Configure OpenAI API key",
64+
"body": "- Update README-zh_CN.md\n- Update README.md\n- Explain how to configure OpenAI API key"
65+
},
66+
{
67+
"id": 2,
68+
"subject": "Install(Composer): Add global and local install instructions",
69+
"body": "- Update README.md\n- Add instructions for global and local install via Composer"
70+
},
71+
{
72+
"id": 3,
73+
"subject": "Usage(Commit Messages): Add best practices",
74+
"body": "- Update README.md\n- Add best practices for writing commit messages"
75+
}
76+
]
77+
78+
2. Generating commit messages: ✔
79+
3. Choosing commit message: choosing...
80+
81+
Please choice a commit message:
82+
[1] Docs(README): Configure OpenAI API key
83+
[2] Install(Composer): Add global and local install instructions
84+
[3] Usage(Commit Messages): Add best practices
85+
>
86+
87+
```
88+
5589
![](docs/ai-commit.gif)
5690

5791
## 测试
5892

59-
```bash
93+
```shell
6094
composer test
6195
```
6296

README.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,74 @@
2323

2424
### Download the [ai-commit](./builds/ai-commit) file
2525

26-
```bash
26+
```shell
2727
curl 'https://raw.githubusercontent.com/guanguans/ai-commit/main/builds/ai-commit' -o ai-commit --progress
2828
chmod +x ai-commit
2929
```
3030

3131
### Install via Composer
3232

33-
```bash
34-
# Global
33+
```shell
34+
# global
3535
composer global require guanguans/ai-commit --dev -v
3636

37-
# Local
37+
# local
3838
composer require guanguans/ai-commit --dev -v
3939
```
4040

4141
## Usage
4242

43-
### First use requires configuration [OpenAI API key](https://platform.openai.com/account/api-keys)
43+
### Config [OpenAI API key](https://platform.openai.com/account/api-keys)
4444

45-
```bash
45+
```shell
4646
./ai-commit config set generators.openai.api_key sk-... --global
4747
```
4848

4949
### Generate and commit message
5050

51-
```bash
51+
```shell
5252
./ai-commit commit
5353
```
5454

55+
```shell
56+
╰─ ./ai-commit commit ─╯
57+
1. Checking run environment: ✔
58+
2. Generating commit messages: generating...
59+
60+
[
61+
{
62+
"id": 1,
63+
"subject": "Docs(README): Configure OpenAI API key",
64+
"body": "- Update README-zh_CN.md\n- Update README.md\n- Explain how to configure OpenAI API key"
65+
},
66+
{
67+
"id": 2,
68+
"subject": "Install(Composer): Add global and local install instructions",
69+
"body": "- Update README.md\n- Add instructions for global and local install via Composer"
70+
},
71+
{
72+
"id": 3,
73+
"subject": "Usage(Commit Messages): Add best practices",
74+
"body": "- Update README.md\n- Add best practices for writing commit messages"
75+
}
76+
]
77+
78+
2. Generating commit messages: ✔
79+
3. Choosing commit message: choosing...
80+
81+
Please choice a commit message:
82+
[1] Docs(README): Configure OpenAI API key
83+
[2] Install(Composer): Add global and local install instructions
84+
[3] Usage(Commit Messages): Add best practices
85+
>
86+
87+
```
88+
5589
![](docs/ai-commit.gif)
5690

5791
## Testing
5892

59-
```bash
93+
```shell
6094
composer test
6195
```
6296

docs/ai-commit.gif

-813 KB
Loading

0 commit comments

Comments
 (0)