Snakommit
Snakommit is a high-performance, interactive commit manager tool similar to Commitizen. It helps teams maintain consistent commit message formats by guiding developers through the process of creating standardized commit messages.
Features
- Interactive CLI for creating conventional commit messages
- Automatic Git repository detection
- File staging assistance (
git add
functionality) - Customizable commit types and scopes
- Breaking change detection
- Issue reference linking
Installation
Prerequisites
- Ruby >= 2.5
- Git
Option 1: Install from RubyGems (Recommended)
# Install the gem
gem install snakommit
Or add to your Gemfile:
gem 'snakommit'
Option 2: Install from source
You have multiple options to install Snakommit:
Option 1: Install to /usr/local/bin (requires sudo)
# Clone the repository
git clone git@github.com:antonia-pl/snakommit.git
cd snakommit
# Install dependencies
bundle install
# Create a symlink to use the tool globally
sudo ln -s "$(pwd)/bin/snakommit" /usr/local/bin/snakommit
Option 2: Install to your home directory (no sudo required)
# Clone the repository
git clone git@github.com:antonia-pl/snakommit.git
cd snakommit
# Install dependencies
bundle install
# Create a bin directory in your home folder (if it doesn't exist)
mkdir -p ~/bin
# Create a symlink in your home bin directory
ln -s "$(pwd)/bin/snakommit" ~/bin/snakommit
# Add this line to your ~/.zshrc or ~/.bash_profile and restart your terminal
# export PATH="$HOME/bin:$PATH"
Option 3: Run directly from the repository
# Clone the repository
git clone git@github.com:antonia-pl/snakommit.git
cd snakommit
# Install dependencies
bundle install
# Run snakommit directly
ruby -Ilib bin/snakommit
Usage
Simply run snakommit
(or its shorter alias sk
) in your Git repository:
snakommit # or 'sk' for short
This will launch the interactive commit flow that will:
- Check if you're in a Git repository
- Detect changes in your working directory
- Help you stage files if needed
- Guide you through creating a standardized commit message
- Commit your changes
Commands
-
snakommit
orsk
- Run the default commit flow -
snakommit emoji [on|off]
orsk emoji [on|off]
- Quick toggle for emoji in commit messages -
snakommit update
orsk update
- Check for and install the latest version -
snakommit help
orsk help
- Show help information -
snakommit version
orsk version
- Show version information -
snakommit templates
orsk templates
- Manage emoji for commit types -
snakommit hooks
orsk hooks
- Manage Git hooks integration
Configuration
Snakommit uses a YAML configuration file located at ~/.snakommit.yml
. A default configuration is created on first run, which you can customize to fit your project needs.
Example configuration:
types:
- name: feat
description: A new feature
- name: fix
description: A bug fix
# ... more types
scopes:
- ui
- api
- database
# ... custom scopes for your project
max_subject_length: 100
max_body_line_length: 72
Troubleshooting
Command not found after installation
If you encounter a "command not found" error after installation:
- Make sure the symlink was created successfully
- If you installed to ~/bin, ensure your PATH includes this directory
- Try running with the full path to the executable
Permission issues
If you encounter permission issues during installation:
- Try the alternative installation methods that don't require sudo.
- Ensure your Ruby environment has the correct permissions.
- Check that the executable bit is set on the bin/snakommit file:
chmod +x bin/snakommit
Development
CI/CD Workflow
Snakommit uses GitHub Actions for continuous integration and deployment:
- Automated Testing: Tests run automatically on multiple Ruby versions (2.7, 3.0, 3.1, 3.2) for all pushes to main and dev branches, as well as pull requests.
- Code Quality: Automatic linting with Rubocop ensures consistent code style.
- Automated Releases: New versions are published to RubyGems automatically when a release is triggered.
Release Process
To create a new release:
- Go to the GitHub Actions tab
- Select the "Release" workflow
- Click "Run workflow"
- Choose the type of version bump (patch, minor, or major)
This will automatically:
- Run all tests
- Bump the version in the codebase
- Update the CHANGELOG
- Create a Git tag and GitHub release
- Publish to RubyGems.org
License
MIT
📝 Credits & Inspiration
Snakommit was inspired by and builds upon these fantastic projects:
Similar Tools
- Commitizen - The original concept of CLI interface for conventional commits
- Conventional Commits - The specification for commit messages
- Gitmoji - For emoji integration in commit messages
Other Inspiration
- Semantic Release - For commit message structure and formatting
- AngularJS Commit Guidelines - The foundation of conventional commits
Updating
To update Snakommit to the latest version, simply run:
sk update
This will check if a newer version is available on RubyGems.org and install it if found. If you want to force a reinstall of the latest version, you can use:
sk update --force
System-wide installations may require administrator privileges, which the tool will prompt for if needed.
Performance
Snakommit has been optimized to offer the best possible performance, even on large projects. Here are the key improvements integrated:
Intelligent Caching
- Expensive Git operations (like getting staged/unstaged files) are cached with a short TTL to optimize performance
- Commit type formatting results with emojis are cached to avoid unnecessary recalculations
- Configuration is cached with invalidation based on file modification date
Batch Processing
- Batch processing is used for file operations to reduce system calls
- Automatic parallelization options for large operations when the
parallel
gem is available
Performance Monitoring
- An integrated monitoring system measures the performance of critical operations
- In DEBUG mode (
SNAKOMMIT_DEBUG=1
), detailed performance information is displayed - Benchmarking and profiling utilities are available for developers
Optimized Memory Management
- Efficient use of system resources
- Proactive cache cleaning to reduce memory footprint
- Command pooling to minimize process creation overhead
These optimizations allow Snakommit to remain fast and responsive even on large repositories with many files.
Contributing
This project uses GitHub Actions for CI/CD:
- Automated tests run on all PRs to main
- Automatic version tagging on merge to main
- Automatic gem publishing when tagged