Skip to content

Commit

Permalink
docs: 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
a145789 committed Feb 18, 2024
1 parent 7796e23 commit 8e39f05
Showing 1 changed file with 47 additions and 10 deletions.
57 changes: 47 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,72 @@
> `fork`[aicommits](https://github.com/Nutlope/aicommits),使用 [智谱AI · GML4](https://open.bigmodel.cn/) 生成 `git commit message`,大部分 `API` 兼容 [aicommits 文档](https://github.com/a145789/aicommits-glm#usage)
## 不同

- 使用流程
1. Install

```sh
pnpm add aicommits-glm -g
```

2. 在 [此处](https://open.bigmodel.cn/usercenter/apikeys) 获取 `智谱AI API Key`

3. 配置 `API KY`

```sh
aicommits config set AI_KEY=<your token>
```

- 可配置工作区 `.aicommits`

```sh
aicommits config set AI_KEY=<your token>
```

将会在全局创建 `.aicommits` 文件,用作全局配置。可使用 `-w`

```sh
aicommits config set AI_KEY=<your token> -w
aicommits config set type=conventional -w
```
可在工作区生成配置文件,文件项会覆盖全局配置。

> **注意!!!谨慎保存你的 AI KEY, 不要把 KEY 写到工作区配置中,一旦上传至远程仓库,很容易造成泄露。**

---

<div align="center">
<div>
<img src=".github/screenshot.png" alt="AI Commits"/>
<h1 align="center">AI Commits</h1>
</div>
<p>A CLI that writes your git commit messages for you with AI. Never write a commit message again.</p>
<a href="https://www.npmjs.com/package/aicommits"><img src="https://img.shields.io/npm/v/aicommits" alt="Current version"></a>
<a href="https://www.npmjs.com/package/aicommits-glm"><img src="https://img.shields.io/npm/v/aicommits-glm" alt="Current version"></a>
</div>

---

## Setup
## ~~Setup~~

> The minimum supported version of Node.js is the latest v14. Check your Node.js version with `node --version`.
> ~~The minimum supported version of Node.js is the latest v14. Check your Node.js version with `node --version`.~~

1. Install _aicommits_:
1. ~~Install _aicommits_:~~

```sh
npm install -g aicommits
#npm install -g aicommits
```

2. Retrieve your API key from [AI](https://platform.openai.com/account/api-keys)
2. ~~Retrieve your API key from [AI](https://platform.openai.com/account/api-keys)~~

> Note: If you haven't already, you'll have to create an account and set up billing.
> ~~Note: If you haven't already, you'll have to create an account and set up billing.~~

3. Set the key so aicommits can use it:
3. ~~Set the key so aicommits can use it:~~

```sh
aicommits config set OPENAI_KEY=<your token>
#aicommits config set OPENAI_KEY=<your token>
```

This will create a `.aicommits` file in your home directory.
~~This will create a `.aicommits` file in your home directory.~~

### Upgrading

Expand Down

0 comments on commit 8e39f05

Please sign in to comment.