Skip to content

Commit c1ac418

Browse files
committed
Merge branch 'hotfix/readme'
2 parents 58acc8f + d0d5bac commit c1ac418

File tree

1 file changed

+45
-26
lines changed

1 file changed

+45
-26
lines changed

README.md

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,6 @@ cargo install aigitcommit
4545

4646
Those command will auto-download the latest version of the project and install it to your cargo bin directory.
4747

48-
## Configuration
49-
50-
Configuration
51-
52-
Before using AIGitCommit, export the following environment variables (for example in your shell profile):
53-
54-
- `OPENAI_API_TOKEN`: Your OpenAI-compatible API token.
55-
- `OPENAI_API_BASE`: The API base URL (useful for alternative providers or local proxies).
56-
- `OPENAI_MODEL_NAME`: The model name to query (e.g., a GPT-compatible model).
57-
- `OPENAI_API_PROXY`: Optional. Proxy address for network access (e.g., `http://127.0.0.1:1080` or `socks://127.0.0.1:1086`).
58-
- `GIT_AUTO_SIGNOFF`: Optional. Set to `true` to append a Signed-off-by line to commits.
59-
60-
## Usage
61-
62-
Run `aigitcommit` in a repository with staged changes. Optionally provide a path to the git directory: `aigitcommit <dir>`.
63-
64-
Common flags:
65-
66-
1. `--commit` commit generated message directly to the repository.
67-
2. `--copy-to-clipboard` copy the generated message to the clipboard.
68-
3. `--json` print the suggestions as JSON for CI or automation.
69-
4. `--yes` skip confirmation prompts and apply the default action.
70-
5. `--signoff` append a Signed-off-by line to the commit message.
71-
72-
See `aigitcommit --help` for the full list of options.
73-
7448
### Docker image
7549

7650
AIGitCommit can run in Docker if you prefer not to install the binary locally. Example (read-only repository):
@@ -117,6 +91,51 @@ git config --global core.hooksPath ~/.git-hooks
11791

11892
After installing the hook, `git commit` will run the hook and populate the commit message. Use `--no-verify` to bypass hooks when necessary.
11993

94+
## Configuration
95+
96+
Before using AIGitCommit, export the following environment variables (for example in your shell profile):
97+
98+
- `OPENAI_API_TOKEN`: Your OpenAI-compatible API token.
99+
- `OPENAI_API_BASE`: The API base URL (useful for alternative providers or local proxies).
100+
- `OPENAI_MODEL_NAME`: The model name to query (e.g., a GPT-compatible model).
101+
- `OPENAI_API_PROXY`: Optional. Proxy address for network access (e.g., `http://127.0.0.1:1080` or `socks://127.0.0.1:1086`).
102+
- `GIT_AUTO_SIGNOFF`: Optional. Set to `true` to append a Signed-off-by line to commits.
103+
104+
### Check the configuration
105+
106+
After setting the environment variables, you can check if they are set correctly by running:
107+
108+
```bash
109+
aigitcommit --check-env
110+
```
111+
112+
This will print the current configuration and verify that the required variables are set.
113+
114+
Then you can run
115+
116+
```bash
117+
aigitcommit --check-model
118+
```
119+
120+
to check if the specified model is available and can be queried successfully.
121+
122+
You can also run `aigitcommit --help` to see the available options and usage instructions.
123+
124+
## Usage
125+
126+
Run `aigitcommit` in a repository with staged changes. Optionally provide a path to the git directory: `aigitcommit <dir>`.
127+
128+
Common flags:
129+
130+
1. `--commit` commit generated message directly to the repository.
131+
2. `--copy-to-clipboard` copy the generated message to the clipboard.
132+
3. `--json` print the suggestions as JSON for CI or automation.
133+
4. `--yes` skip confirmation prompts and apply the default action.
134+
5. `--signoff` append a Signed-off-by line to the commit message.
135+
136+
See `aigitcommit --help` for the full list of options.
137+
138+
120139
## License
121140

122141
This project is licensed under the MIT License. See the `LICENSE` file for details.

0 commit comments

Comments
 (0)