You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: enhance CLI documentation and installation instructions
- Update the description of the CLI tool for clarity and conciseness.
- Remove several outdated features and replace them with updated descriptions.
- Add new sections for installation instructions on macOS and Windows.
- Introduce a section for pre-compiled binaries with updated instructions.
- Clarify the process for setting the OpenAI API key and environment variables.
- Improve formatting and consistency in section headings.
- Enhance the instructions for changing to various API services, including Azure, Gemini, Anthropic, Groq, and Ollama.
- Update the commit message template and related instructions for better clarity.
Signed-off-by: appleboy <[email protected]>
Copy file name to clipboardexpand all lines: README.md
+62-56
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
English | [繁體中文](./README.zh-tw.md) | [简体中文](./README.zh-cn.md)
10
10
11
-
A CLI written in [Go](https://go.dev) that writes git commit messages or provides a code review summary for you using ChatGPT AI (gpt-4o, gpt-4 model) and automatically installs a [git prepare-commit-msg hook](https://git-scm.com/docs/githooks).
11
+
A CLI tool written in [Go](https://go.dev) that generates git commit messages or provides code review summaries using ChatGPT AI (gpt-4o, gpt-4 model). It also automatically installs a [git prepare-commit-msg hook](https://git-scm.com/docs/githooks).
12
12
13
13
-[繁體中文介紹][1]
14
14
-[繁體中文影片][2]
@@ -21,40 +21,48 @@ A CLI written in [Go](https://go.dev) that writes git commit messages or provide
-Supports Git prepare-commit-msg Hook, see the [Git Hooks documentation](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).
26
-
-Supports customizing generated diffs with n lines of context, the default is three.
27
-
-Supports excluding files from the git diff command.
28
-
-Supports commit message translation into another language (supports `en`, `zh-tw`, or `zh-cn`).
29
-
- Supports socks proxy or custom network HTTP proxy.
30
-
-Supports [model lists](https://github.com/appleboy/CodeGPT/blob/bf28f000463cfc6dfa2572df61e1b160c5c680f7/openai/openai.go#L18-L38)like`gpt-4`, `gpt-4o`, etc.
31
-
-Supports generating a brief code review.
32
-
-Supports customizing prompt template and variables.
24
+
-Adheres to the[conventional commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
25
+
-Integrates with Git prepare-commit-msg Hook, see the [Git Hooks documentation](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).
26
+
-Allows customization of generated diffs with a specified number of context lines (default is three).
27
+
-Enables exclusion of files from the git diff command.
28
+
-Translates commit messages into other languages (supports `en`, `zh-tw`, or `zh-cn`).
29
+
- Supports SOCKS proxy or custom network HTTP proxy.
30
+
-Provides a [model list](https://github.com/appleboy/CodeGPT/blob/bf28f000463cfc6dfa2572df61e1b160c5c680f7/openai/openai.go#L18-L38)including`gpt-4`, `gpt-4o`, etc.
31
+
-Generates brief code reviews.
32
+
-Allows customization of prompt templates and variables.
33
33
34
34

35
35
36
36
## Installation
37
37
38
-
Install from [Homebrew](http://brew.sh/) on macOS
38
+
### macOS
39
+
40
+
Install via [Homebrew](http://brew.sh/):
39
41
40
42
```sh
41
43
brew tap appleboy/tap
42
44
brew install codegpt
43
45
```
44
46
45
-
Install from [Chocolatey](https://chocolatey.org/install) on Windows
47
+
### Windows
48
+
49
+
Install via [Chocolatey](https://chocolatey.org/install):
46
50
47
51
```sh
48
52
choco install codegpt
49
53
```
50
54
51
-
The pre-compiled binaries can be downloaded from [release page](https://github.com/appleboy/CodeGPT/releases). Change the binary permissions to `755` and copy the binary to the system bin directory. Use the `codegpt` command as shown below.
55
+
### Pre-compiled Binaries
56
+
57
+
Download the pre-compiled binaries from the [release page](https://github.com/appleboy/CodeGPT/releases). Change the binary permissions to `755` and copy the binary to the system bin directory. Use the `codegpt` command as shown below:
52
58
53
59
```sh
54
60
$ codegpt version
55
61
version: v0.4.3 commit: xxxxxxx
56
62
```
57
63
64
+
### From Source
65
+
58
66
Install from source code:
59
67
60
68
```sh
@@ -63,25 +71,23 @@ go install github.com/appleboy/CodeGPT/cmd/codegpt@latest
63
71
64
72
## Setup
65
73
66
-
Please first create your OpenAI API Key. The [OpenAI Platform](https://platform.openai.com/account/api-keys) allows you to generate a new API Key.
74
+
First, create your OpenAI API Key. The [OpenAI Platform](https://platform.openai.com/account/api-keys) allows you to generate a new API Key.
67
75
68
76

69
77
70
-
An environment variable is a variable that is set on your operating system, rather than within your application. It consists of a name and value. We recommend that you set the name of the variable to `OPENAI_API_KEY`.
71
-
72
-
See the [Best Practices for API Key Safety](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety).
78
+
Set the environment variable `OPENAI_API_KEY`:
73
79
74
80
```sh
75
81
export OPENAI_API_KEY=sk-xxxxxxx
76
82
```
77
83
78
-
or store your API key in a custom config file.
84
+
Alternatively, store your API key in a custom config file:
79
85
80
86
```sh
81
87
codegpt config set openai.api_key sk-xxxxxxx
82
88
```
83
89
84
-
This will create a `.codegpt.yaml` file in your home directory ($HOME/.config/codegpt/.codegpt.yaml). The following options are available.
90
+
This will create a `.codegpt.yaml` file in your home directory ($HOME/.config/codegpt/.codegpt.yaml). The following options are available:
Please get the `API key`, `Endpoint` and `Model deployments` list from Azure Resource Management Portal on left menu.
142
+
Get the `API key`, `Endpoint`, and `Model deployments` list from the Azure Resource Management Portal on the left menu.
137
143
138
144

139
145
140
146

141
147
142
-
Update your config file.
148
+
Update your config file:
143
149
144
150
```sh
145
151
codegpt config set openai.provider azure
@@ -148,7 +154,7 @@ codegpt config set openai.api_key xxxxxxxxxxxxxxxx
148
154
codegpt config set openai.model xxxxx-gpt-4o
149
155
```
150
156
151
-
### Support [Gemini][60] API Service
157
+
### Support for [Gemini][60] API Service
152
158
153
159
Build with the Gemini API, you can see the [Gemini API documentation][61]. Update the `provider` and `api_key` in your config file. Please create an API key from the [Gemini API][62] page.
154
160
@@ -162,7 +168,7 @@ codegpt config set openai.model gemini-1.5-flash-latest
162
168
[61]: https://ai.google.dev/gemini-api/docs
163
169
[62]: https://aistudio.google.com/app/apikey
164
170
165
-
### Support [Anthropic][100] API Service
171
+
### Support for [Anthropic][100] API Service
166
172
167
173
Build with the Anthropic API, you can see the [Anthropic API documentation][101]. Update the `provider` and `api_key` in your config file. Please create an API key from the [Anthropic API][102] page.
168
174
@@ -179,9 +185,9 @@ See the model list from the [Anthropic API documentation][103].
@@ -234,11 +240,11 @@ Update the `base_url` in your config file. You don't need to set the `api_key` i
234
240
codegpt config set openai.base_url http://localhost:11434/v1
235
241
```
236
242
237
-
### How to change to [OpenRouter][50] API Service
243
+
### How to Change to [OpenRouter][50] API Service
238
244
239
245
You can see the [supported models list][51], model usage can be paid by users, developers, or both, and may shift in [availability][52]. You can also fetch models, prices, and limits [via API][53].
240
246
241
-
The following example use free model name: `meta-llama/llama-3-8b-instruct:free`
247
+
The following example uses the free model name: `meta-llama/llama-3-8b-instruct:free`
242
248
243
249
```sh
244
250
codegpt config set openai.provider openai
@@ -252,14 +258,14 @@ codegpt config set openai.model google/learnlm-1.5-pro-experimental:free
252
258
[52]: https://openrouter.ai/terms#services
253
259
[53]: https://openrouter.ai/api/v1/models
254
260
255
-
For including your app on openrouter.ai rankings and Shows in rankings on openrouter.ai, you can set the `openai.headers` in your config file.
261
+
To include your app in openrouter.ai rankings and show it in rankings on openrouter.ai, you can set the `openai.headers` in your config file:
256
262
257
263
```sh
258
264
codegpt config set openai.headers "HTTP-Referer=https://github.com/appleboy/CodeGPT X-Title=CodeGPT"
259
265
```
260
266
261
-
-**HTTP-Refer**: Optional, for including your app on openrouter.ai rankings.
262
-
-**X-Title**: Optional, for Shows in rankings on openrouter.ai.
267
+
-**HTTP-Referer**: Optional, for including your app in openrouter.ai rankings.
268
+
-**X-Title**: Optional, for showing in rankings on openrouter.ai.
263
269
264
270
## Usage
265
271
@@ -274,24 +280,24 @@ git add <files...>
274
280
codegpt commit --preview
275
281
```
276
282
277
-
The commit message is shown below.
283
+
The commit message is shown below:
278
284
279
285
```sh
280
-
Summarize the commit message use gpt-4o model
286
+
Summarize the commit message using the gpt-4o model
281
287
We are trying to summarize a git diff
282
-
We are trying to summarize a title for pull request
288
+
We are trying to summarize a title forthe pull request
You can also use the prepare-commit-msg hook to integrate `codegpt` with Git. This allows you to use Git normally and edit the commit message before committing.
379
385
380
386
#### Install
381
387
382
-
You want to install the hook in the Git repository:
388
+
To install the hook in the Git repository:
383
389
384
390
```sh
385
391
codegpt hook install
386
392
```
387
393
388
394
#### Uninstall
389
395
390
-
You want to remove the hook from the Git repository:
396
+
To remove the hook from the Git repository:
391
397
392
398
```sh
393
399
codegpt hook uninstall
@@ -404,9 +410,9 @@ git commit
404
410
405
411
```sh
406
412
$ git commit
407
-
Summarize the commit message use gpt-4o model
413
+
Summarize the commit message using the gpt-4o model
408
414
We are trying to summarize a git diff
409
-
We are trying to summarize a title for pull request
415
+
We are trying to summarize a title forthe pull request
0 commit comments