comit-cli
v0.2.1
Published
Interactive git commit tool with conventional commit support
Maintainers
Readme
Comit
A simple git CLI tool with conventional commit message support and branch management
NOTE: This is a work in progress, please check back for updates and additional features
Installation
npm i comit-cliUsage
comit # Start interactive commit process
comit br # Branch switcher with stash management
comit nuke # Undo all unpushed commitsFeatures
- 🎯 File-by-file commit tagging - Review and commit each changed file individually with full control
- 📝 Conventional commit format - 11 commit types following conventional commit standards
- 👀 Visual diff preview - See exactly what changed before committing
- 🔄 Commit grouping - Group multiple files under the same commit message
- ♻️ Commit reuse - Reuse commit messages from earlier in the session
- ✏️ Interactive editing - Review and edit all commit messages before finalizing
- 🌿 Branch switcher - Quick branch switching with automatic stash management and branch deletion
- 💥 Nuke mode - Safely undo all unpushed commits with confirmation
- 📋 Changeset detection - Automatically checks for changesets (configurable)
Commit Types
Comit supports the following conventional commit types:
feat- A new featurefix- A bug fixdocs- Documentation only changesstyle- Code style changes (formatting, missing semi colons, etc)refactor- Code change that neither fixes a bug nor adds a featureperf- Performance improvementtest- Adding or updating testsbuild- Changes to build system or dependenciesci- Changes to CI configurationchore- Other changes that don't modify src or test filesrevert- Reverts a previous commit
Workflow
- Review changes - Comit shows all changed files and detects unpushed commits
- Changeset check - Optionally checks for changesets and JIRA tickets
- File-by-file review - For each file:
- View the diff
- Select commit type
- Add optional scope
- Write commit message
- Or reuse a previous commit from the session
- Review & edit - Review all commits, edit any you want to change
- Commit - Execute all commits
- Push - Optionally push to origin
Commands
Start commit process
comitWalk through the interactive commit process for all changed files.
Branch switcher
comit brInteractive branch menu for quick branch switching with intelligent stash management. Features:
- Quick switching - Select any local branch by number
- Auto-stash - Automatically stashes uncommitted changes (including untracked files) when switching
- Smart restore - Prompts to restore stashed changes when returning to a branch
- Branch deletion - Delete branches with flexible syntax:
D1- Delete branch 1D1-5- Delete range of branches (1 through 5)D1,3,5- Delete specific branches (1, 3, and 5)- Mix syntax:
D1-3,5,7-9
- Protected branches - Cannot delete
main,master, or current branch - Confirmation - Always prompts before deleting with summary
- Error handling - Shows which deletions succeed/fail without stopping
The menu loops after deletions, letting you continue managing branches without restarting.
Nuke unpushed commits
comit nukeUndo all unpushed commits on the current branch. Changes are preserved as unstaged modifications. This is useful when you want to recommit your work with different messages or groupings.
Tips
Commit Process
- Type
nukeat any prompt to quickly access nuke mode - Type
sto skip a file during commit process - Type
qto quit the commit process - Use
p1,p2, etc. to reuse previous commit messages from the session - Use
edit1,edit2, etc. during review to modify specific commits
Branch Switcher
- Branch numbers correspond to the list shown in the menu
- Delete commands are case insensitive (
d1orD1both work) - Stashes are automatically named after the branch they came from
- The menu stays open after deletions for batch operations
- Type
Qorqto exit the branch menu
Development
npm install # Install dependencies
npm run build # Compile TypeScript
npm run dev # Watch mode for developmentRequirements
- Node.js >= 16.0.0
- Git 2.0+
Platform Support
- macOS (full support including audio)
- Linux (full support)
- Windows/WSL (full support)
Clipboard functionality works cross-platform via clipboardy.
Future Configuration
Future versions will support a .comitrc configuration file for:
- Custom commit types
- Pre-commit hooks
- Configurable checks
- Custom colors and themes
License
MIT
