Effortlessly generate meaningful and automated commit messages using AI-powered Groq API. Perfect for developers seeking faster Git workflows with minimal effort.
npm install malas-commit


malas-commit: The ultimate tool for developers who need automated, meaningful commit messages without the hassle! This fast and efficient NPM package uses AI (Groq or Gemini) to generate smart, context-aware commit messages in seconds. With automatic fallback support, you get reliable generation even when one API has issues. Perfect for boosting productivity in your Git workflows.

The word _malas_ in Indonesian means lazy. Often, developers feel lazy or lack motivation to come up with commit messages that are both clear and concise. Malas Commit automates this task for you!
1. Indonesian (ma.las):
- a. Not willing to work on something: _orang yang malas itu lebih senang mengemis daripada bekerja_ (The lazy person prefers begging to working).
- a. Not eager or reluctant to do something: _malas rasanya mengunjungi rapat seperti itu_ (feeling too lazy to attend such a meeting).
- 🤖 Dual AI Support: Use Groq or Gemini APIs (or both with automatic fallback)
- 🔄 Automatic Fallback: If Groq fails, automatically switches to Gemini
- 📏 Smart Context Limits: Dynamic diff limits based on API (200K chars for Gemini, 20K for Groq)
- ⚡ Easy Configuration: Quickly set up and get started with your API key
- 📝 Automated Commit Messages: No more thinking about commit messages! Generate them instantly
- 🌍 Global Installation: Install once, use everywhere
- 🎯 Simple Command: Generate messages with a single command
- 🔀 Flexible PR Generation: Generate pull request descriptions from staged files or multiple commits
You need at least ONE of the following API keys (both are free!):
Node.js: Version 16.0.1 or higher
---
To install the package globally, run the following command:
``bash`
npm i malas-commit -g
Option 1: Groq only (fast)
`bash`
malas setConfig GROQ_APIKEY
Option 2: Gemini only (large context)
`bash`
malas setConfig GEMINI_APIKEY
Option 3: Both (automatic fallback)
`bash`
malas setConfig GROQ_APIKEY
malas setConfig GEMINI_APIKEY
`bash
malas
`
OR
`bash
mls
`
To generate a pull request title and description in Markdown format (without pushing your changes), use the following command:
`bash`
malas pr
malas pr now supports two workflows:
`bash
git add
git commit -m "message 1"
git add
git commit -m "message 2"
malas pr # Generates PR from ALL commits in your branch
`
This mode will:
- Automatically detect your current branch
- Find all commits since the base branch (main/master)
- Generate a comprehensive PR description based on all changes
`bash`
git add
malas pr # Generates PR from staged files
Note: If you have staged files, malas pr will use them. Otherwise, it will automatically use your commits.
You can configure malas-commit by editing the ~/.malas-commit file. Example configuration:
`json`
{
"GROQ_APIKEY": "
"GEMINI_APIKEY": "
"COMMIT_PROMPT": "
}
1. Groq First: If GROQ_APIKEY is set, Groq is tried firstGEMINI_APIKEY
2. Gemini Fallback: If Groq fails and is set, automatically switches to GeminiGEMINI_APIKEY` is set, uses Gemini directly
3. Gemini Only: If only
4. Error: If no API keys are configured, shows an error
The diff character limit automatically adjusts based on your configuration:
- Gemini only: 200,000 characters (10x larger!)
- Groq or Both: 20,000 characters (safe for Groq)
This means with Gemini, you can process much larger codebases without truncation!
- [x] Fix the bug where the process still runs after selecting "no" in the yes/no prompt.
- [x] Implement error handling for failed network requests.
- [ ] Refactor the code for better readability.
- [ ] Write unit tests for the new features.
- [x] Add an auto-generated pull request description generator related to changes using Markdown format code.
- [x] Migrate to semantic commit. (Semantic Commit Guide)
We welcome contributions! Please read our contributing guidelines to get started.
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to all the contributors and the open-source community for their support.