Introducing mock-my-commit tool because your 'fixed stuff' commit messages clearly needed a reality check. Powered by the GEMINI text generation model API, this tool ensures that no matter how lazy your commits are, you'll get the judgment you deserve🤐.
Required
- Go (version 1.22 or higher): Go installation guide
- GEMINI API Key: GEMINI API Keys console
For Linux OS, Mac OS and Windows
go install github.com/Kshitiz-Mhto/mock-my-commit@latest-
Automated Validation: Enforces Git commit message best practices before commits are registered.
-
Cross-Platform Support: Supports Linux, Mac and Windows integration.
-
Sarcastic Reviews: Generates passive-aggressive feedback using GEMINI's API for poorly crafted messages.
-
Seamless Integration: Functions as a Git
commit-msghook to validate messages within your existing workflow.
This project, mock-my-commit, is built using the Go programming language. Below is a list of the commands offered by this tool.
setup-API-key
install
run-hook
- cobra – CLI framework for handling commands.
- term – Terminal handling utilities.
- emoji – For adding emoji reactions to roasts.
- terminfo – Terminal capabilities information.
- gookit/color – Colored terminal output.
setup flow-diagram
setup for Linux OS
- Go (version 1.22 or higher): Go installation guide.
- Make: Install using (e.g.,
sudo apt-get install makeon Debian/Ubuntu). - GEMINI API Key: GEMINI API Keys console.
- Navigate to the project repo and run
make build- Create a symlink using
sudo ln -s /path/to/bin/mock-my-commit /usr/local/bin/mock-my-commit- Test the Executable
mock-my-commit- View the Manual
mock-my-commit -hSetup for macOS
- Go (version 1.22 or higher): Install via Homebrew (
brew install go) or official package - Make: Pre-installed with Xcode Command Line Tools (run
xcode-select --installif missing) - GEMINI API Key: Get from GEMINI console
-
Build the binary
make build
For M1/M2 Macs: Ensure Rosetta isn't interfering with ARM builds
-
Create system symlink
sudo ln -s $HOME/path/to/project/bin/mock-my-commit /usr/local/bin/mock-my-commit
mock-my-commit --version # Check installation
mock-my-commit -h # View manualsetup for Window OS
- Go (version 1.22 or higher): Go installation guide
- GEMINI API Key: GEMINI API Keys console
-
Build the Project
Open PowerShell in the project directory and run:go build -o bin/mock-my-commit.exe main.go
-
Add to System PATH
Either:-
Move the
bin/mock-my-commit.exeto a directory already in your PATH, or -
Create a symlink using:
# PowerShell (Admin) New-Item -ItemType SymbolicLink -Path "$env:SYSTEMROOT\System32\mock-my-commit.exe" -Target "C:\full\path\to\bin\mock-my-commit.exe"
-
-
Test the Executable
mock-my-commit
-
View the Manual
mock-my-commit -h
Note:
- For symlinks, run PowerShell as Administrator
- Replace
C:\full\path\to\binwith your actual binary path$env:SYSTEMROOT/%SYSTEMROOT%automatically resolves toC:\Windows(or system root)
This Makefile simplifies building, testing, installing, and cleaning the mock-my-commit project.
- BINARY_NAME: Output binary name (
mock-my-commit). - OUTPUT_DIR: Directory for the built binary (
bin). - MAIN_FILE: Entry point of the Go project (
./main.go). - INSTALL_DIR: Installation path (
$GOBINor$HOME/go/bin).
The Makefile has the following targets that automate the build process:
- Description: Builds the binary from the main Go file and outputs it to the
bindirectory.
make build- Description: Runs the tests for the project using
go test.
make test- Description: Builds the project and installs the binary to the
GOBINdirectory.
make installmake clean




