Skip to content

M4ST3R-C0NTR0L/CybrCommit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 CybrCommit

Python Version License: MIT GitHub stars

Never write a commit message again.

CybrCommit generates perfect Conventional Commits for your git changes. It works without any API keys using a smart rule-based engine, with optional AI enhancement via OpenAI, Anthropic, or local Ollama.


✨ Quick Start

pip install CybrCommit-cli
CybrCommit

That's it. No setup, no API keys, no configuration files.


🚀 Demo

$ git diff --staged
diff --git a/src/auth/login.js b/src/auth/login.js
new file mode 100644
index 0000000..abc1234
--- /dev/null
+++ b/src/auth/login.js
@@ -0,0 +1,45 @@
+import { useState } from 'react';
+
+export function LoginForm() {
+  const [email, setEmail] = useState('');
+  const [password, setPassword] = useState('');
+
+  const handleSubmit = async (e) => {
+    e.preventDefault();
+    await login(email, password);
+  };
+
+  return (
+    <form onSubmit={handleSubmit}>
+      <input type="email" value={email} onChange={e => setEmail(e.target.value)} />
+      <input type="password" value={password} onChange={e => setPassword(e.target.value)} />
+      <button type="submit">Login</button>
+    </form>
+  );
+}
$ CybrCommit

📁 1 file changed
   +45 additions, -0 deletions

   Files:
   ➕ src/auth/login.js

🤔 Generating commit message...

💬 Generated commit message:
   feat(auth): add login form component

Commit? [y]es, [e]dit, [r]egenerate, [n]o: y

✅ Committed: feat(auth): add login form component

📦 Installation

# Using pip
pip install CybrCommit-cli

# Using pipx (recommended)
pipx install CybrCommit-cli

# Using uv
uv tool install CybrCommit-cli

🎯 Features

  • Zero-config mode — Works immediately, no API keys needed
  • Smart rule-based engine — Analyzes diff patterns intelligently
  • Conventional Commits — Always follows the spec
  • AI enhancement — Optional OpenAI, Anthropic, or Ollama support
  • Interactive mode — Review, edit, or regenerate before committing
  • Auto mode — Skip confirmation for CI/CD workflows
  • Gitmoji support — Add expressive emoji to commits
  • File type detection — Understands tests, docs, configs, dependencies
  • Smart truncation — Handles huge diffs gracefully

📖 Usage

Interactive Mode (Default)

CybrCommit

Shows the generated message and asks for confirmation.

Auto Mode

CybrCommit --auto

Commits without asking. Perfect for scripts and CI/CD.

Dry Run

CybrCommit --dry

Shows what the message would be without committing.

Stage All

CybrCommit --all

Stage all changes first, then commit.

Custom Scope

CybrCommit --scope api
# Result: feat(api): ...

Override Type

CybrCommit --type fix
# Forces "fix:" instead of auto-detecting

Add Emoji

CybrCommit --emoji
# Result: ✨ feat: add new feature

🧠 Rule-Based Engine

The built-in engine is smart enough for most projects:

Change Pattern Generated Message
New file added feat: add filename
File deleted chore: remove filename
File renamed refactor: rename old to new
Test files test: add tests for...
Config files chore: update config
README/docs docs: update documentation
Dependencies chore: update dependencies
CSS/styles style: update styles
Multiple files Summarized intelligently

🤖 AI Providers (Optional)

For even better messages, connect an AI provider:

OpenAI

export OPENAI_API_KEY="sk-..."
CybrCommit --ai openai

Anthropic

export ANTHROPIC_API_KEY="sk-ant-..."
CybrCommit --ai anthropic

Ollama (Local)

# Start Ollama locally
ollama run llama3.2

# Use local AI
CybrCommit --ai ollama

⚙️ Configuration

Environment Variables

# AI Providers
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export OLLAMA_HOST="http://localhost:11434"

# Default settings
export AI_COMMIT_PROVIDER="openai"      # openai | anthropic | ollama
export AI_COMMIT_MODEL="gpt-4o-mini"    # any valid model
export AI_COMMIT_EMOJI="1"              # enable emoji by default
export AI_COMMIT_AUTO="1"               # auto-commit by default
export AI_COMMIT_MAX_DIFF_LINES="500"   # truncate large diffs

Config File

Create ~/.config/CybrCommit/config:

# AI provider (optional)
provider=openai
model=gpt-4o-mini

# Default behavior
emoji=true
auto=false
max_diff_lines=500

📊 Before vs After

Before CybrCommit

commit 3f4a9b2c
Author: developer@example.com
Date:   Mon Jan 15 10:30:00 2025

    updated stuff

commit 8e7d6f5a
Author: developer@example.com
Date:   Mon Jan 15 09:15:00 2025

    fix

commit 1a2b3c4d
Author: developer@example.com
Date:   Fri Jan 12 16:45:00 2025

    WIP

After CybrCommit

commit 9b8c7d6e
Author: developer@example.com
Date:   Mon Jan 15 10:30:00 2025

    feat(auth): add OAuth2 login with Google provider

commit 5f4e3d2c
Author: developer@example.com
Date:   Mon Jan 15 09:15:00 2025

    fix(api): resolve race condition in user cache

commit 7a6b5c4d
Author: developer@example.com
Date:   Fri Jan 12 16:45:00 2025

    test(utils): add unit tests for date formatting helpers

🔧 CLI Reference

CybrCommit [OPTIONS]

Options:
  -h, --help            Show help message
  -v, --version         Show version
  --auto                Auto-commit without confirmation
  --dry                 Show message only, don't commit
  -a, --all             Stage all changes before committing
  --scope SCOPE         Specify commit scope
  --type TYPE           Override commit type (feat, fix, docs, etc.)
  --ai PROVIDER         Use AI provider (openai, anthropic, ollama)
  --model MODEL         Specify AI model
  -e, --emoji           Add gitmoji to commit
  --no-emoji            Disable emoji
  -m, --message MSG     Use custom message

🛠️ Development

# Clone the repository
git clone https://github.com/M4ST3R-C0NTR0L/CybrCommit.git
cd CybrCommit

# Create virtual environment
python -m venv venv
source venv/bin/activate  # or: venv\Scripts\activate on Windows

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black ai_commit/
isort ai_commit/

# Type check
mypy ai_commit/

📋 Requirements

  • Python 3.8+
  • Git

Optional:

  • openai package for OpenAI support
  • anthropic package for Anthropic support
  • Ollama running locally for local AI

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.


🙏 Acknowledgments


Built by Cybrflux

About

🤖 Never write a commit message again. AI reads your diff, writes the commit. Zero config. Just works.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages