Skip to content

Commit 8de61db

Browse files
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
1 parent 136a8f9 commit 8de61db

File tree

1 file changed

+68
-28
lines changed

1 file changed

+68
-28
lines changed

README.md

Lines changed: 68 additions & 28 deletions
Original file line numberDiff line numberDiff 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-
41
<div align="center">
52
<h1>Git GPT Commit</h1>
63
<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
1714
npm install -g @laststance/git-gpt-commit
1815
```
1916

20-
- **Step2:** move to any language your project root
17+
- **Step2:** add your OpenAI API key using the `git gpt open-api-key`
2118

2219
```bash
23-
cd my-rust-project
20+
git gpt open-api-key
2421
```
2522

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.
3124

32-
- **Step4:** commit .gitignore
25+
- **Step3:** commit your changes with AI
3326

3427
```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`.
42-
43-
`.env`
44-
45-
```
46-
OPENAI_API_KEY=your_openai_api_key
28+
git add --all
29+
git gpt commit // generate commit message with AI
4730
```
4831

4932
✅ You've completed all setup!
@@ -52,22 +35,79 @@ OPENAI_API_KEY=your_openai_api_key
5235

5336
After setting up the project, you can use the Git extension in any Git repository:
5437

38+
### Generate Commit Message
39+
5540
Stage your changes:
5641

57-
```
58-
git add .
42+
```bash
43+
git add --all
5944
```
6045

61-
Run the Git extension:
46+
Generate a commit message:
6247

63-
```
48+
```bash
6449
git gpt commit
6550
```
6651

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).
79+
80+
- **Toggle Commit Prefix**
81+
82+
```bash
83+
git gpt prefix
84+
```
85+
86+
Enable/disable conventional commit prefixes (feat:, fix:, chore:, etc.).
87+
88+
- **Manage OpenAI API Key**
89+
90+
```bash
91+
git gpt open-api-key
92+
```
93+
94+
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.
68105

69106
## Credits
70107

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+
71111
Thanks to
72112

73113
- Author of [original package](https://github.com/nooqta/git-commit-gpt)

0 commit comments

Comments
 (0)