A secure, user-friendly CLI tool that replaces git commit with an interactive commit context wizard.
Click to see the GitWizard UI in action
- Interactive TUI - Beautiful terminal UI powered by Charm's Huh
- Co-Author Detection - Automatically scrapes recent contributors from git history
- Smart Issue Linking - Extracts issue references from branch names
- Clipboard Integration - Suggests references from clipboard
- Security First - Built with command injection prevention
- Git Trailer Support - Generates properly formatted trailers for GitHub/GitLab
go install github.com/Zayan-Mohamed/gitwiz@latestDownload the latest binary from releases:
# Linux
wget https://github.com/Zayan-Mohamed/gitwiz/releases/latest/download/gitwiz-linux-amd64.tar.gz
tar -xzf gitwiz-linux-amd64.tar.gz && chmod +x gitwiz-linux-amd64.tar.gz
sudo mv gitwiz-linux-amd64 /usr/local/bin/gitwiz# macOS
wget https://github.com/Zayan-Mohamed/gitwiz/releases/latest/download/gitwiz-darwin-amd64.tar.gz
tar -xzf gitwiz-darwin-amd64.tar.gz && chmod +x gitwiz-darwin-amd64.tar.gz
sudo mv gitwiz-darwin-amd64 /usr/local/bin/gitwiz# windows
wget https://github.com/Zayan-Mohamed/gitwiz/releases/latest/download/gitwiz-windows-amd64.zip
# Extract and move (requires Admin PowerShell)
Expand-Archive -Path gitwiz-windows-amd64.zip -DestinationPath .
Move-Item -Path gitwiz-windows-amd64.exe -Destination C:\Windows\System32\gitwiz.exegit clone https://github.com/Zayan-Mohamed/gitwiz.git
cd gitwiz
go build -o gitwiz
sudo mv gitwiz /usr/local/bin/./install.shInstead of running git commit, simply run:
gitwiz # Run the commit wizard
gitwiz --help # Show help and usage information
gitwiz --version # Show version- Quick Help:
gitwiz --helporgitwiz -h - Keyboard Navigation: See KEYBOARD_GUIDE.md for detailed navigation instructions
- Usage Examples: See USAGE.md for comprehensive examples
The wizard will guide you through:
- Subject Line - Brief, imperative description (validated for length)
- Body - Optional detailed explanation
- Co-Authors - Select from recent contributors
- References - Link to related issues/PRs
- Fixes - Automatically close issues
feat: Add user authentication
Implement JWT-based authentication with refresh tokens.
Added middleware for route protection.
Co-authored-by: Jane Doe <jane@example.com>
Refs: #123
Fixes: #456
gitwiz/
βββ main.go # CLI entry point with flag parsing
βββ internal/
β βββ git/
β β βββ git.go # Secure git operations (exec wrappers)
β β βββ git_test.go # Unit tests
β βββ logic/
β β βββ trailers.go # Commit message building & validation
β β βββ trailers_test.go # Unit tests
β βββ tui/
β βββ form.go # Interactive TUI forms
βββ scripts/
β βββ release.sh # release script
βββ docs/
βββ USAGE.md # Detailed usage guide
βββ KEYBOARD_GUIDE.md # Keyboard navigation reference
βββ SECURITY.md # Security documentation
- Uses
exec.Command()with separate arguments (NOT shell string concatenation) - Example:
exec.Command("git", "commit", "-m", msg)[OK] - NOT:
exec.Command("sh", "-c", "git commit -m '"+msg+"'")[X]
- User input passed as literal values, never as flags
- Protected against malicious input like
--amendor; rm -rf /
- Email validation with regex before display
- Control character stripping to prevent terminal corruption
- Timeout on all external commands (2 seconds)
| Scenario | Behavior |
|---|---|
| Not a Git Repo | Exit with friendly error |
| Nothing Staged | Offer to stage all changes |
| No Commit History | Show empty co-author list |
| Merge in Progress | Warn and allow continuation |
| GPG Signing | Stdin attached for passphrase prompt |
Custom trailers can be defined in ~/.gitwiz.yaml:
custom_trailers:
Reviewed-by: "Zayan-Mohamed <itsm.zayan@gmail.com>"
Ticket: "PROJ-123"- Go 1.21+
- Git 2.0+
- Terminal with UTF-8 support
Run tests:
go test ./...Build:
go build -o gitwizMIT License - See LICENSE file for details.
This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
Contributions welcome! Please read our Contributing Guidelines before submitting PRs.
Key Requirements:
- No use of
go-git(useos/execonly) - All git commands use
exec.Command()safely - Input validation on all user data
- Tests for edge cases
- Follow Conventional Commits
Built with:
- Charm Huh - TUI forms
- Charm Bubbletea - TUI framework
- Viper - Configuration
- Clipboard - Clipboard access
- Issues - Bug reports and feature requests
- Discussions - Questions and community
- Email: itsm.zayan@gmail.com
Made with β€οΈ by Zayan Mohamed





