commity-ai-commit-tool
Version:
AI-powered Git commit message generator with dynamic emoji selection
176 lines (121 loc) β’ 3.86 kB
Markdown
<div align="center">
<img src="https://raw.githubusercontent.com/muhd-ameen/Commity/main/logo.png" width="100" alt="Commity Logo" />
# π€ Commity
> **AI-powered commit messages that donβt suck. With emojis.**
</div>
Writing commit messages was killing me. So I built Commity.
A tiny CLI tool that looks at your staged git changes, asks OpenAI what the hell you just did, and gives you a clean, emojiβd commit line you can actually be proud of.
No more `Update` or `fixes lol`.
## π§ͺ What it actually does
- Reads your `git diff`
- Sends it to OpenAI
- Spits back a commit message that *makes sense*
- Drops in a matching emoji (because vibes matter)
- You hit enter. Boom. Committed.
## β‘ Why it slaps
- π§ **Smarter than you on bad days** β AI writes your commit messages
- π― **Emoji sniper** β Tags it right: π for bugs, β¨ for features, etc.
- π **Safe** β Your API key stays in `.env`, not flying around
- π¬ **Talks to you** β Edit, confirm, cancel. Like a chill assistant.
- π¨ **Sexy CLI** β Colors, prompts, feedback. Feels alive.
## π Getting Started (takes 1 min max)
**1. Install**
```bash
npm install -g commity-ai-commit-tool
```
**2. Add your OpenAI key**
```bash
echo "OPENAI_API_KEY=sk-..." > .env
```
β Grab key from [here](https://platform.openai.com/api-keys)
β Yes, free tier works too

**3. Use it**
```bash
git add .
commity
```


## π§ Sample Output
```bash
π€ Commity - AI Commit Tool
π Reading staged changes...
π§ Generating commit message with AI...
π¬ Suggested commit message:
"π Fix authentication validation and error handling"
? What would you like to do?
β― Yes, use this message
Edit the message
Cancel commit
β
Committed successfully!
```
You just saved 2 minutes *and* looked smart doing it.
## π₯ Emoji Mapping (Auto-detected)
| Type | Emoji |
|------|-------|
| New Feature | β¨ |
| Bug Fix | π |
| Docs | π |
| Performance | β‘ |
| Refactor | β»οΈ |
| Tests | π§ͺ |
| Config | βοΈ |
| Security | π |
| UI | π¨ |
| DB | ποΈ |
| API | π |
| Deploy | π |
| Packages | π¦ |
## π οΈ Configs (Only if youβre picky)
| Env Variable | What it does | Default |
|--------------|--------------|---------|
| `OPENAI_API_KEY` | Your OpenAI key (duh) | β |
| `OPENAI_MODEL` | Which model to use | `gpt-4o-mini` |
**Supported Models:**
- `gpt-4o-mini` (default)
- `gpt-4o`
- `gpt-4-turbo`
- `gpt-3.5-turbo`
## π If it breaks
- **API key not found?** β You forgot the `.env` file
- **"No staged changes"?** β Run `git add .`
- **Not in a repo?** β `git init`, friend
## π§± Code Structure (for devs)
```
commity/
βββ cli-wrapper.js // handles terminal
βββ ai.js // OpenAI stuff
βββ git.js // git logic
βββ prompt.js // CLI questions
βββ package.json // npm life
βββ README.md // this file
```
## π οΈ Wanna contribute?
Yes please. PRs welcome.
1. Fork it
2. `git checkout -b cool-feature`
3. Code
4. `git commit -m 'β¨ adds cool stuff'`
5. Open PR
Bugs? Feature ideas? β [Open an issue](https://github.com/muhd-ameen/Commity/issues)
## π License
MIT. Steal with style.
## β€οΈ Credits
- Powered by OpenAI (shoutout)
- Inspired by late-night coding guilt
- Built by [Muhammad Ameen](https://github.com/muhd-ameen) with coffee, rage, and love
**No more cringe commit messages. Let Commity talk.**
Install now β `npm install -g commity-ai-commit-tool`