Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markolofsen/openrouter-commit
CLI tool that helps you write clear, concise, and AI-generated commit messages using OpenRouter's LLM models.
https://github.com/markolofsen/openrouter-commit
ai aicommits chatgpt commits git gpt node npm openrouter python
Last synced: 14 days ago
JSON representation
CLI tool that helps you write clear, concise, and AI-generated commit messages using OpenRouter's LLM models.
- Host: GitHub
- URL: https://github.com/markolofsen/openrouter-commit
- Owner: markolofsen
- Created: 2025-01-29T08:53:22.000Z (16 days ago)
- Default Branch: main
- Last Pushed: 2025-01-30T08:14:15.000Z (15 days ago)
- Last Synced: 2025-01-30T08:27:16.247Z (15 days ago)
- Topics: ai, aicommits, chatgpt, commits, git, gpt, node, npm, openrouter, python
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/openrouter-commit
- Size: 3.91 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **openrouter-commit π AI-Powered Git Commit Messages**
**Generate smart, AI-driven Git commit messages** using OpenRouter models like **DeepSeek R1**. Automate your commit workflow and write meaningful commits effortlessly.
---
## **β‘ Quick Start**
### **Run without installation**
```sh
npx openrouter-commit -run
```### **Install globally**
```sh
npm install -g openrouter-commit
openrouter-commit -run
```### **Use in a project (`package.json`)**
```json
{
"scripts": {
"commit": "npx openrouter-commit -run"
}
}
```
Run it with:
```sh
npm run commit # or yarn commit
```---
## **π Updating**
- **Global (del)**: `sudo npm uninstall -g openrouter-commit`
- **Global:** `sudo npm update -g openrouter-commit`
- **npx users:** `npx clear-npx-cache`
- **Project-based:** `npm update openrouter-commit`---
## **βοΈ Setup**
### **API Key & Model**
#### **Option 1: `.env.openrouter` file (recommended)**
```sh
OPENROUTER_API_KEY=your-api-key
OPENROUTER_MODEL=deepseek/deepseek-r1
```
#### **Option 2: Environment variables**
```sh
export OPENROUTER_API_KEY=your-api-key
export OPENROUTER_MODEL=deepseek/deepseek-r1
```
#### **Option 3: Custom `.env` path**
```sh
npx openrouter-commit -run --env-path /custom/path/.env
```---
## **π How It Works**
1οΈβ£ **Checks Git status**
2οΈβ£ **Prompts to stage changes**
3οΈβ£ **Generates an AI-powered commit message**
4οΈβ£ **Lets you confirm or edit it**
5οΈβ£ **Commits and pushes automatically**---
## **π Ignored Files**
By default, `openrouter-commit` **ignores common files** that shouldn't be in commits:- `.env.openrouter`
- `node_modules/`, `.npm/`, `package-lock.json`
- `dist/`, `venv/`, `env/`, `__pycache__/`, `*.pyc`, `*.pyo`, `Pipfile.lock`, `poetry.lock`
- `logs/`, `*.log`, `debug.log*`, `*.swp`, `*.swo`
- `.cache/`, `.idea/`, `.editorconfig`
- `.DS_Store`, `Thumbs.db`If needed, modify the `IGNORED_FILES` list in `openrouter-commit`'s source code.
---
## **π₯ Features**
β **AI-powered commit messages**
β **Interactive CLI with confirmation prompts**
β **Custom `.env` paths with `--env-path`**
β **Handles large diffs intelligently**
β **Failsafe exit handling (Ctrl+C wonβt commit unfinished work)**
β **Prevents accidental execution with `-run` flag**
β **Ignores unnecessary files from commits**---
## **β Troubleshooting**
### **Not enough OpenRouter credits?**
π [Top up here](https://openrouter.ai/credits)### **Command not found?**
```sh
npx openrouter-commit -run
```
Or:
```sh
npm install -g openrouter-commit
openrouter-commit -run
```### **Git push fails?**
Ensure your branch is tracking a remote branch:
```sh
git branch --set-upstream-to=origin/main
```---
## **π‘ About**
Built by [Unrealos.com](https://unrealos.com) β AI, SaaS, and PaaS solutions.## **π License**
MIT Β© **Unrealos.com** π