# aicm
AI-assisted Git commit message generator for staged changes.
`aicm` reads `git diff --cached`, asks `opencode` to write a Conventional Commit message, then lets you approve the commit and optional push.
This is a small pet project. Crates like `clap` are intentionally avoided for now in favor of keeping the implementation limited to Rust's standard library.
## Requirements
- Rust and Cargo
- Git
- `opencode` installed and available on `PATH`
## Install
```sh
cargo install --path .
```
You can also run it directly from the repository:
```sh
cargo run
```
## Usage
Stage the changes you want to commit:
```sh
git add <files>
```
Generate a commit message:
```sh
aicm
```
After generating the message, `aicm` prompts before running:
```sh
git commit -m "<generated-message>"
```
If you accept the second prompt, it pushes the current branch:
```sh
git push origin <current-branch>
```
Print help:
```sh
aicm help
```
## Commit Message Format
Generated messages are prompted to follow Conventional Commits, use imperative mood, omit markdown/commentary, and keep the subject at 72 characters or less.
## Development
```sh
cargo check
cargo fmt
cargo test
```
This is a single Rust binary crate. The entrypoint is `src/main.rs`.