https://github.com/codewithdpk/cocommit
AI-powered CLI tool for generating conventional commit messages based on your code changes.
https://github.com/codewithdpk/cocommit
agent ai git openai
Last synced: 4 months ago
JSON representation
AI-powered CLI tool for generating conventional commit messages based on your code changes.
- Host: GitHub
- URL: https://github.com/codewithdpk/cocommit
- Owner: codewithdpk
- License: mit
- Created: 2025-06-23T14:28:43.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-07-02T09:13:06.000Z (5 months ago)
- Last Synced: 2025-07-02T09:13:51.447Z (5 months ago)
- Topics: agent, ai, git, openai
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@cwdpk/cocommit
- Size: 5.26 MB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CoCommit
AI-powered CLI tool for generating conventional commit messages and branch names based on your code changes.

## Features
- 🤖 **AI-Powered Commit Messages**: Generate meaningful commit messages using OpenAI, Anthropic, or Google models.
- 🌿 **AI-Powered Branch Names**: Generate conventional branch names based on your staged changes.
- 📝 **Conventional Commit Format**: Follows the conventional commit standard.
- 🔍 **Smart File Analysis**: Analyzes staged files and their diffs for context-aware messages and branch names.
- ⚡ **Quick Commands**: Simple CLI commands and aliases for fast workflow: analyze, generate, and commit or branch within a single command.
- 🎨 **Beautiful Output**: Colorful, user-friendly CLI interface.
- 🔧 **Easy Configuration**: Interactive setup for AI provider and API key.
## Installation
### Global (Recommended)
```sh
npm install -g @cwdpk/cocommit
```
### Local Development
```sh
git clone
cd cocommit
npm install
npm run build
npm link
```
## Usage
### 1. Configure your AI provider
```sh
cocommit config
```
Follow the prompts to select your provider and enter your API key. This will be saved to `~/.cocommit-config.json`.
### 2. Generate a commit message
Stage your changes, then run:
```sh
cocommit commit
```
Or use the alias:
```sh
cocommit c
```
You can also provide your own message:
```sh
cocommit commit -m "your message"
```
### 3. Generate a branch name (NEW)
Stage your changes, then run:
```sh
cocommit branch new
```
Or use the alias:
```sh
cocommit b n
```
You can also provide your own branch name:
```sh
cocommit branch new -n "your-branch-name"
```
The tool will suggest an AI-generated branch name based on your staged changes, and prompt for confirmation or a custom name before creating and checking out the new branch.
### 4. View status with AI insights
```sh
cocommit status
```
## Supported Providers
- OpenAI (GPT-4o, GPT-4o-mini, GPT-3.5 Turbo)
- Anthropic (Claude 3.5 Sonnet, Haiku, Opus)
- Google (Gemini 1.5 Pro, Flash)
## Configuration File
- Location: `~/.cocommit-config.json`
- Stores: provider, model, and API key
## Requirements
- Node.js v16 or higher
- An API key from your chosen AI provider
## License
MIT
## Author
[Deepak Suthar](https://x.com/0xDSuthar)