Skip to main content

Conventional Commits Generator - A CLI to create standardized commit messages

Project description

Conventional Commits Generator

Description

A simple yet powerful interactive CLI tool for creating well-structured and standardized commit messages following the conventional commit format.

Overview

$ ccg

┌────────────────────────────────────────────────────────────────────────────────┐
│                                 Commit Types                                   │
└────────────────────────────────────────────────────────────────────────────────┘

1. ★ feat       - A new feature for the user or a particular enhancement
2. ♥ fix        - A bug fix for the user or a particular issue
3. • chore      - Routine tasks, maintenance, or minor updates
...

┌──────────────────────┐
│ Scope                │
└──────────────────────┘

ℹ The scope provides context for the commit (e.g., module or file name)
ℹ Examples: auth, ui, api, database
Enter the scope (optional, press Enter to skip): authentication

✓ Scope set to: authentication

┌──────────────────────┐
│ Breaking Change      │
└──────────────────────┘

ℹ A breaking change means this commit includes incompatible changes
ℹ Examples: changing function signatures, removing features, etc.
Is this a BREAKING CHANGE? (y/n): n

ℹ Not a breaking change

┌──────────────────────┐
│ Commit Message       │
└──────────────────────┘

ℹ Provide a clear, concise description of the change
ℹ Examples: 'implement OAuth login', 'fix navigation bug', 'update documentation'
Enter the commit message: implement OAuth login

✓ Message: implement OAuth login

┌──────────────────────┐
│ Review               │
└──────────────────────┘

┌────────────────────────────────────────────────┐
│                                                │
│  feat(authentication): implement OAuth login   │
│                                                │
└────────────────────────────────────────────────┘

Confirm this commit message? (y/n): y

✓ Commit message confirmed!

┌──────────────────────┐
│ Commit               │
└──────────────────────┘

→ Committing changes...
✓ New commit successfully created!

┌──────────────────────┐
│ Push Changes         │
└──────────────────────┘

ℹ This will execute 'git push' command
Do you want to push these changes? (y/n): y

┌──────────────────────┐
│ Remote Push          │
└──────────────────────┘

→ Pushing changes to remote repository...
✓ Changes pushed successfully!

Features

  • Interactive CLI with colored output and user-friendly prompts
  • Complete conventional commit format support:
    • Type selection with detailed descriptions
    • Optional scope field
    • Breaking change indicator
    • Descriptive commit message
  • Git integration:
    • Automatic git add to stage changes
    • Commit with formatted message
    • Optional push to remote
  • Advanced features:
    • Pre-commit hooks integration
    • Push-only mode
    • Dry-run mode for testing
    • Command history for easier input

Installation

Using pipx (recommended)

pipx is the recommended way to install command-line tools written in Python:

# Install pipx if you don't have it
pip install --user pipx
pipx ensurepath

# Install ccg
pipx install ccg

Using pip

pip install ccg

Development Installation

Clone the repository:

git clone https://github.com/EgydioBNeto/conventional-commits-generator.git
cd conventional-commits-generator

Using a Virtual Environment (Recommended)

On Linux/macOS:

# Run the setup script
chmod +x scripts/setup_venv.sh
./scripts/setup_venv.sh

# Activate the virtual environment
source .venv/bin/activate

On Windows:

# Run the setup script
scripts\setup_venv.bat

# Activate the virtual environment
.venv\Scripts\activate

Manual Installation

# Create a virtual environment
python -m venv .venv

# Activate it (Linux/macOS)
source .venv/bin/activate
# Or on Windows
# .venv\Scripts\activate

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

# Install pre-commit hooks
pre-commit install

Usage

Basic Usage

# Generate a commit interactively
ccg

# Just push without creating a new commit
ccg --push

# Generate a commit message without actually committing (dry run)
ccg --dry-run

# Show version
ccg --version

Requirements

  • Python 3.7+
  • Git

Contributing

See CONTRIBUTING.md for details on how to contribute to this project.

Code of Conduct

Please read the Code of Conduct for details on our code of conduct.

Security

For details about reporting security vulnerabilities, see SECURITY.md.

License

This project is licensed under the MIT License.

Author

EgydioBNeto

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conventional_commits_generator-2.0.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

conventional_commits_generator-2.0.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file conventional_commits_generator-2.0.0.tar.gz.

File metadata

File hashes

Hashes for conventional_commits_generator-2.0.0.tar.gz
Algorithm Hash digest
SHA256 07c2b6ac9e2c096d142b72d8b45f552488da77d1eefdae0c1608953845f68574
MD5 75a6589f734408e2ccbaac0f23db0f16
BLAKE2b-256 b16eb29d85a0fa055ff59feffdd0d02cedd0bacab5ca5fa36c426dfd5651e669

See more details on using hashes here.

File details

Details for the file conventional_commits_generator-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for conventional_commits_generator-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44eefe101df4d926c2b889dac3efe01c4703479768101b5daf2497cd6cd05f64
MD5 802b5e04c01c687632e3177be6b25d6e
BLAKE2b-256 0736d32b00a917e811c853e8d72ede65bb353336691a2955c512ed9f7abbd1a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page