https://github.com/samunatsu/ai-commit
A Command Line Utility for AI Generating Git Commit Message
https://github.com/samunatsu/ai-commit
ai cli commit-message git rust
Last synced: 3 months ago
JSON representation
A Command Line Utility for AI Generating Git Commit Message
- Host: GitHub
- URL: https://github.com/samunatsu/ai-commit
- Owner: SamuNatsu
- License: mit
- Created: 2025-03-10T15:59:35.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-03-13T09:41:33.000Z (10 months ago)
- Last Synced: 2025-04-15T11:55:19.589Z (8 months ago)
- Topics: ai, cli, commit-message, git, rust
- Language: Rust
- Homepage:
- Size: 83 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AI Commit
A Command Line Utility for AI Generating Git Commit Message
## Install
### Use Cargo Install
```sh
cargo install --git https://github.com/SamuNatsu/ai-commit
```
### Use CLI (Linux/MacOS only)
```sh
curl -s https://installer.samunatsu.workers.dev/SamuNatsu/ai-commit | bash
```
## Environment Variables
Some environment variables must be provided, dotenv files also can be used to provide such variables.
| Name | Introduction | Required | Example | Default |
| :------------------: | :------------------------------------------------ | :------: | :-------------------------------: | :--------------------------------------------: |
| `AI_COMMIT_ENDPOINT` | OpenAI API style endpoint url | Yes | `https://api.deepseek.com/` | - |
| `AI_COMMIT_API_KEY` | OpenAI API style API key | Yes | `sk-xxxxxxxxxxxxxxx` | - |
| `AI_COMMIT_MODEL` | OpenAI API style model name | Yes | `deepseek-reasoner` | - |
| `AI_COMMIT_FILTER` | A RegExp file name filter for ignoring their diff | No | `package-lock\.json\| yarn\.lock` | See [here](./src/includes/default_filters.txt) |
## Usage
### TL; DR
```txt
A Command Line Utility for AI Generating Git Commit Message
Usage: ai-commit [OPTIONS]
Options:
-v, --verbose Show verbose message
-d, --dotenv Dotenv profile name
-t, --commit-type Force using the given commit type
-s, --commit-scope Force using the given commit scope
-p, --prompt Additional prompt message
-h, --help Print help
-V, --version Print version
```
## Dotenv profiles
You can use different dotenv file by passing the `-d|--dotenv` option.
Command below will use `.env.openai` as profile:
```sh
ai-commit -d openai
```
## Additional message
You can add a custom prompt message for AI model, makes it better understands your demands.
```sh
ai-commit -p "This commit is for optimization"
```
## Sponsor