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: Update README with new setup instructions and features
- Removed outdated setup steps and added new instructions for setting up the OpenAI API key.
- Updated the commit process to use AI-generated messages.
- Added sections for generating commit messages available commands
Copy file name to clipboardExpand all lines: README.md
+68-28Lines changed: 68 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,3 @@
1
-
> Original package doesn't work due to config mistake 'package.json'. https://github.com/nooqta/git-commit-gpt
2
-
> Therefore I fix it and republish as a '@laststance/git-gpt-commit'.
3
-
4
1
<divalign="center">
5
2
<h1>Git GPT Commit</h1>
6
3
<p>An AI-powered Git extension that generates commit messages using OpenAI's GPT-4o, streamlining the commit process and improving developer productivity.</p>
@@ -17,33 +14,19 @@ There are two ways to install the Git extension: using npm or manual installatio
17
14
npm install -g @laststance/git-gpt-commit
18
15
```
19
16
20
-
-**Step2:**move to any language your project root
17
+
-**Step2:**add your OpenAI API key using the `git gpt open-api-key`
21
18
22
19
```bash
23
-
cd my-rust-project
20
+
git gpt open-api-key
24
21
```
25
22
26
-
-**Step3:** add `.env` file to `.gitignore`
27
-
28
-
```bash
29
-
echo -e "\n.env">> .gitignore
30
-
```
23
+
Select "Add or update API key" from the menu and enter your API key when prompted. Your key will be securely stored in your user configuration.
31
24
32
-
-**Step4:** commit .gitignore
25
+
-**Step3:** commit your changes with AI
33
26
34
27
```bash
35
-
git add .
36
-
git commit -m 'add .env to .gitignore'
37
-
```
38
-
39
-
> ❗️Step3 and 4 must be done for prevent leak your OpenAI API key on Github/GitLab.
40
-
41
-
-**Step5:** Get your openai API key from [openai](https://platform.openai.com/account/api-keys) and add `.env` file to `OPENAI_API_KEY`.
After setting up the project, you can use the Git extension in any Git repository:
54
37
38
+
### Generate Commit Message
39
+
55
40
Stage your changes:
56
41
57
-
```
58
-
git add .
42
+
```bash
43
+
git add --all
59
44
```
60
45
61
-
Run the Git extension:
46
+
Generate a commit message:
62
47
63
-
```
48
+
```bash
64
49
git gpt commit
65
50
```
66
51
67
-
The script will summarize the Git changes since the last commit and generate a commit message using OpenAI's model. You will be prompted to confirm whether to use the suggested message or cancel the commit.
52
+
The extension will analyze your staged changes and generate a commit message using OpenAI's model. You'll be prompted to confirm the message before it's committed.
53
+
54
+
### Available Commands
55
+
56
+
-**Commit with AI-generated message**
57
+
58
+
```bash
59
+
git gpt commit
60
+
```
61
+
62
+
Generates a commit message based on your staged changes.
63
+
64
+
-**Select AI Model**
65
+
66
+
```bash
67
+
git gpt model
68
+
```
69
+
70
+
Choose from available models (gpt-4o, gpt-3.5-turbo-instruct, gpt-4-turbo, gpt-4).
71
+
72
+
-**Change Commit Message Language**
73
+
74
+
```bash
75
+
git gpt lang
76
+
```
77
+
78
+
Select the language for commit messages (English, Spanish, Japanese, French, German, Italian, Korean, Chinese, Dutch, Russian, Portuguese).
Add, update, display, or delete your stored OpenAI API key.
95
+
96
+
-**Show Current Configuration**
97
+
```bash
98
+
git gpt config
99
+
```
100
+
Display your current settings (model, language, prefix status, API key).
101
+
102
+
### Configuration
103
+
104
+
Your settings are stored in `~/.git-gpt-commit-config.json` and automatically loaded when you use the extension. You can manage your configuration through the commands above or directly edit this file.
68
105
69
106
## Credits
70
107
108
+
> Original package doesn't work due to config mistake 'package.json'. https://github.com/nooqta/git-commit-gpt
109
+
> Therefore I fix it and added some features as a '@laststance/git-gpt-commit'.
110
+
71
111
Thanks to
72
112
73
113
- Author of [original package](https://github.com/nooqta/git-commit-gpt)
0 commit comments