fast-cc-git-hooks

module
v0.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2025 License: MIT

README ΒΆ

⚑ Fast Conventional Commits

GitHub release (latest SemVer) Platform Support Conventional Commits

Write conventional git commits automatically. Never think about allowed commit formats again, this toolset does it for you.

# Instead of this:
git commit -m "fix stuff"
git commit -m "WIP"
git commit -m "updated files"

# Get this automatically:
git commit -m "feat(auth): add JWT token validation"
git commit -m "fix(api): resolve timeout in user login"
git commit -m "docs(readme): update installation instructions"

WHAT IS THIS?

Lightening-fast "git add-ons," that do the repetitive work:

  • fcgh - installs a git-hook (locally or globally), to check your commit messages, ensuring they comply to conventional commit format.
  • ccg - generates conventional commit messages, based on your recent changes (and copies it to your clipboard)
  • ccdo - same as ccg (above), except it ALSO does the git commit FOR YOU

πŸš€ Quick Start

Step 1: Install

For Linux/Windows: Download from releases and extract to your PATH

# macOS 
curl -sSL https://raw.githubusercontent.com/greenstevester/fast-cc-git-hooks/main/install-macos.sh | bash

# Linux/Windows - Manual install (choose your platform below)

Step 2: Set up once, globally (for all repos - this is the default)

fcgh setup-ent

Or Locally (from within the current repo)

fcgh setup-ent --local

Step 3: set a JIRA ticket reference (when you start working on a ticket)

ccg set-jira CGC-1234

Step 4.a: use ccg to preview the commit message (copied to the clipboard)

NOTE: You don't need to run git add . manually - both ccg and ccdo handle this automatically as part of their workflow.

ccg  # Generates commit message with ticket reference (if you set one) and copies to the clipboard

OR

Step 4.b: Generate + Commit automatically (fastest)

ccdo  # Generates commit message with ticket reference (if you set one) + commits automatically

πŸŽ‰ Done! Every commit is now formatted.

πŸ“– To recap, choose your workflow

πŸ€– Fully Automated (fastest)

Let the tools do everything for you:

ccdo  # Analyzes changes, creates perfect commit message, commits it
  • No heavy lifting for message formulation required
  • Always follows conventions
  • Perfect for daily development
πŸ‘€ Preview First

See the generated message before committing:

ccg   # Shows suggested commit message + copies to clipboard
# Review the message, then paste with Ctrl+V:
git commit -m "feat(api): add user authentication endpoint"
  • Review before committing
  • Learn good commit patterns
  • Full control over final message
✍️ Manual + Validation

Write your own messages with automatic validation:

git commit -m "feat: add cool feature"
# βœ… Commit message is valid (fcgh hook is invoked and validates automatically)

git commit -m "fix stuff" 
# ❌ Commit message validation failed: invalid format
  • Write your own messages
  • Automatic format checking
  • Learn by doing

Windows:

  1. Download fast-cc-git-hooks_windows_amd64.zip from releases
  2. Extract fcgh.exe, ccg.exe, and ccdo.exe
  3. Add to your PATH

Linux:

curl -L -o fcgh.tar.gz https://github.com/greenstevester/fast-cc-git-hooks/releases/latest/download/fcgh_linux_amd64.tar.gz
tar -xzf fcgh.tar.gz
chmod +x fcgh ccg ccdo
sudo mv fcgh ccg ccdo /usr/local/bin/

macOS:

# Intel Macs
curl -L -o fcgh.tar.gz https://github.com/greenstevester/fast-cc-git-hooks/releases/latest/download/fcgh_darwin_amd64.tar.gz
tar -xzf fcgh.tar.gz && chmod +x fcgh ccg ccdo && sudo mv fcgh ccg ccdo /usr/local/bin/

# Apple Silicon (M1/M2/M3)
curl -L -o fcgh.tar.gz https://github.com/greenstevester/fast-cc-git-hooks/releases/latest/download/fcgh_darwin_arm64.tar.gz
tar -xzf fcgh.tar.gz && chmod +x fcgh ccg ccdo && sudo mv fcgh ccg ccdo /usr/local/bin/
πŸ”§ Build from Source

Requires Go 1.25+

git clone https://github.com/greenstevester/fast-cc-git-hooks.git
cd fast-cc-git-hooks
make build-all-tools
make install-all

βš™οΈ Configuration

Basic Setup (Works for 90% of projects):

fcgh setup-ent  # Sets up everything with enterprise features

Project-Only Setup:

fcgh setup-ent --local  # Only for current repository

Custom Configuration:

fcgh init  # Creates ~/.fast-cc/fast-cc-config.yaml for customization
🏒 Enterprise Features
  • JIRA Integration: Auto-include ticket numbers
  • Team Scopes: Predefined scopes (api, web, cli, db, etc.)
  • Custom Rules: Company-specific validation
  • Advanced Patterns: Complex commit requirements
ccg set-jira PROJ-1234    # Auto-include JIRA ticket
ccg jira-status           # Check current ticket

πŸ› οΈ Commands Reference

Command Purpose Example
fcgh setup-ent One-time setup with validation Sets up git hooks
ccdo Generate + commit automatically ccdo
ccg Generate message (preview only) ccg --verbose
fcgh validate Test a commit message fcgh validate "feat: add feature"
fcgh status Show hook and JIRA status Shows installation status and current ticket

❓ Common Questions

Q: Do I need all three tools?

No! They work independently:

  • Just hooks: fcgh setup-ent validates your manual messages
  • Just generation: ccg generates messages without validation
  • Full automation: All three together for zero-thought commits
Q: What if I don't like the generated message?

Use ccg (without ccdo) to preview first. Copy the generated command and modify it before running.

Q: Does this change my code?

No! It only affects commit messages. Your code stays exactly the same.

Q: Can I turn it off temporarily?
fcgh remove      # Remove hooks
fcgh setup-ent   # Add them back

🎯 Examples

βœ… Good commits (auto-generated):

feat(auth): add JWT token validation
fix(api): resolve timeout in user login  
docs(readme): update installation instructions
test(user): add integration tests for signup flow

❌ Bad commits (blocked by validation):

fix stuff
WIP
updated files
asdf

πŸ”— Why Conventional Commits?

  • πŸ“ˆ Auto-generate changelogs from commit history
  • 🏷️ Semantic version bumps based on commit types
  • πŸ” Searchable history with consistent formatting
  • πŸ‘₯ Team collaboration with clear change communication
  • πŸ€– CI/CD integration for automated workflows
πŸ“š Advanced Topics
Semantic Analysis

The tools include intelligent analysis for infrastructure code, particularly Terraform with Oracle OCI awareness.

JIRA Integration
ccg set-jira PROJ-1234     # Set ticket for next 10 commits
ccg clear-jira            # Remove ticket
ccg jira-history          # View ticket history
Custom Scopes

Edit ~/.fast-cc/fast-cc-config.yaml to add project-specific scopes:

scopes:
  - api
  - web  
  - cli
  - database
  - auth
  - docs
Multiple Install Types
  • Global: Works for all Git repositories on your machine
  • Local: Works only for current repository
  • Local always wins when both are installed
Changelog Generation Tools

Once using conventional commits, you can automate your entire release process:

🀝 Contributing

Found a bug? Want a feature? Open an issue or submit a PR.

πŸ“„ License

MIT License - do whatever you want with this code!


TL;DR: fcgh setup-ent + ccdo = perfect commits forever πŸš€


πŸ“š Learn More:

Directories ΒΆ

Path Synopsis
cmd
ccdo command
ccg command
fcgh command
fcgh is a fast conventional commits git hook system.
fcgh is a fast conventional commits git hook system.
internal
banner
Package banner provides terminal-aware banner printing
Package banner provides terminal-aware banner printing
config
Package config provides configuration management for fast-cc-hooks.
Package config provides configuration management for fast-cc-hooks.
hooks
Package hooks provides git hook installation and management.
Package hooks provides git hook installation and management.
validator
Package validator provides commit message validation against conventional commit rules.
Package validator provides commit message validation against conventional commit rules.
pkg
ccgen
Package ccgen - Advanced Git analysis implementing comprehensive algorithm
Package ccgen - Advanced Git analysis implementing comprehensive algorithm
conventionalcommit
Package conventionalcommit provides parsing and validation for conventional commit messages.
Package conventionalcommit provides parsing and validation for conventional commit messages.
jira
Package jira provides JIRA ticket management for commit messages
Package jira provides JIRA ticket management for commit messages
semantic
Package semantic provides semantic analysis integration for the cc command
Package semantic provides semantic analysis integration for the cc command
semantic/plugins
Package plugins contains language-specific semantic analysis plugins
Package plugins contains language-specific semantic analysis plugins

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL