https://github.com/m7medVision/lazycommit
using AI to generate commit message suggestions
https://github.com/m7medVision/lazycommit
Last synced: about 1 month ago
JSON representation
using AI to generate commit message suggestions
- Host: GitHub
- URL: https://github.com/m7medVision/lazycommit
- Owner: m7medVision
- Created: 2024-07-22T13:01:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-22T18:17:06.000Z (about 1 year ago)
- Last Synced: 2024-08-22T20:34:05.841Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 130 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-AI-driven-development - lazycommit - Using AI to generate commit message suggestions (Domain-Specific Tools / Git & Version Control)
README
# lazycommit
AI-powered Git commit message generator that analyzes your staged changes and generates conventional commit messages.
## Features
- Generates commit messages using AI (supports OpenAI, OpenRouter, and GitHub Copilot)
- Interactive prompts for accepting, editing, or canceling commit messages
- Easy to extend with other AI providers
- Built with Go for performance and portability## Installation
```bash
go install github.com/m7medvision/lazycommit@latest
```Or clone the repository and build from source:
```bash
git clone https://github.com/m7medvision/lazycommit.git
cd lazycommit
go build -o lazycommit main.go
```## Usage
Stage your changes first:
```bash
git add .
```Then generate a commit message:
```bash
lazycommit commit
```You can also run the interactive configuration to set your preferred provider and model:
```bash
lazycommit config set
```For automatic commit without prompting:
```bash
lazycommit commit -a
```## Configuration
Create a `.lazycommit.yaml` file in your home directory or project root:
```yaml
active_provider: openai
providers:
openai:
api_key: "your-openai-api-key"
model: "gpt-4o"
openrouter:
api_key: "your-openrouter-api-key"
model: "anthropic/claude-3-opus"
copilot:
# No API key needed, it uses the GitHub CLI token
model: "gpt-4o"
```## Development
### Project Structure
```
lazycommit/
├── cmd/
│ └── commit.go
│ └── root.go
├── internal/
│ ├── git/
│ │ └── git.go
│ ├── provider/
│ │ ├── provider.go
│ │ ├── copilot.go
│ │ └── models/
│ │ └── models.go
│ └── config/
│ └── config.go
├── main.go
└── go.mod
```### Building
```bash
go build -o lazycommit main.go
```### Dependencies
- [Cobra](https://github.com/spf13/cobra) - CLI framework
- [Viper](https://github.com/spf13/viper) - Configuration management
- [go-git](https://github.com/go-git/go-git) - Git implementation in Go
- [Survey](https://github.com/AlecAivazis/survey) - Interactive prompts## License
MIT