A Python script to simplify creating semantic commits with emojis, type validation, and interactive prompts. Automates git add
and git commit
in one step.
- Interactive commit type selection with emojis and descriptions
- Title/description validation (length, required fields)
- Previews commit messages before confirmation
- Handles
git add
automatically for specified files - Add break rows to the description by using
/br
# Add to your ~/.bashrc or ~/.zshrc
alias cf='function _cf() { \
if [ ! -f ~/.commitflow/handlecommit.py ]; then \
mkdir -p ~/.commitflow && \
curl -sSL -o ~/.commitflow/handlecommit.py https://raw.githubusercontent.com/viniciusnevescosta/CommitFlow/main/handleCommit.py; \
fi; \
python3 ~/.commitflow/handlecommit.py "$@"; \
}; _cf'
# Add to your $PROFILE
function cf {
$scriptPath = "$env:USERPROFILE\.commitflow\handlecommit.py"
if (-not (Test-Path $scriptPath)) {
New-Item -ItemType Directory -Path "$env:USERPROFILE\.commitflow" -Force | Out-Null
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/viniciusnevescosta/CommitFlow/main/handleCommit.py" -OutFile $scriptPath
}
python $scriptPath $args
}
cf README.md src/app.js # Linux, macOS or Windows (in PowerShell)
Staging files: README.md, src/app.js
Select the commit type:
1. ✨ New feature - A new feature was added to the application
...
- Single Command: cf handles both staging and committing
- Auto-Update: Script is stored in ~/.commitflow/ (Linux/macOS) or %USERPROFILE%.commitflow\ (Windows)
- Portable: Works across all major OSes with Python 3.6+
- Python 3.6+
- Git installed locally
- Security: Script is downloaded once and stored locally - verify before first use
- Updates: Delete the script file to force re-download
- Customization: Modify COMMIT_TYPES in the local script file to match your workflow