Have you ever pulled changes from GitHub and suddenly ended up with a merge conflict?
You see something like:
<<<<<<< HEAD
your changes
=======
someone else's changes
>>>>>>> origin/main
Enter fullscreen mode Exit fullscreen mode
And then the real question starts:
Which change should I keep?
That question is what inspired me to build Batman Git CLI Assistant.
💡 How the idea started
This project came from a real situation in my office.
Two developers were working on the same project and the same Git branch.
One developer changed a file and pushed the changes to GitHub.
Meanwhile, the other developer had also modified the same file locally.
When they tried to synchronize their work, Git reported a conflict.
The problem wasn't that Git didn't provide a solution.
The problem was understanding:
What changed locally?
What changed remotely?
Which changes should be kept?
What is safe to do next?
How can we resolve the conflict without accidentally losing work?
That experience made me think:
What if there was a simple helper that could guide developers through these situations?
And that's how Batman Git CLI Assistant started.
🦇 What is Batman Git CLI Assistant?
Batman is a lightweight Node.js CLI tool that works as a safety and automation layer around normal Git commands.
The goal isn't to replace Git.
Instead, it tries to make difficult Git workflows:
Understandable → Safer → Easier to manage
It still uses Git underneath. Batman simply helps the developer understand what's happening and perform common operations more safely.
🤖 Why not just use AI?
AI can be very useful for Git.
It can explain a merge conflict, analyze code, and suggest a possible resolution.
But there is an important limitation:
AI doesn't always know the developer's actual intention.
For example, if two developers changed the same piece of code, an AI might suggest a technically valid resolution.
But the developer still needs to decide:
"Which change is actually correct for my project?"
That's why I wanted Batman to focus on visibility, safety checks, and developer control rather than automatically making every decision.
⚡ What can Batman do?
Some of the current commands include:
batman safe-push
Helps perform a safer push workflow by checking the repository state, synchronizing changes, handling conflicts, and performing safety checks before pushing.
batman safe-push "Add new feature"
batman conflict
Helps inspect the current conflict situation and understand local vs incoming changes.
batman conflict
batman resolve
Provides an interactive way to choose which version of a conflicting change should be used.
batman resolve
batman continue
Helps continue an interrupted Git operation after conflicts have been resolved.
batman continue
batman scan
Scans the project for potentially dangerous files or content such as:
.env files
private keys
possible secrets
unusually large files
batman scan
batman squash
Helps combine multiple local commits before synchronization or rebasing.
batman squash
batman rescue
Creates a safety backup before potentially destructive operations.
batman rescue
batman verify
Runs available project verification/build/test commands.
batman verify
batman sub-sync
Helps synchronize Git submodules.
batman sub-sync
And there's also:
batman help
to explore the available commands.
🛠️ Tech Stack
Batman is built using:
JavaScript
Node.js
Git
NPM
Chalk — terminal styling
Boxen — terminal UI
Node.js APIs — command execution, file handling, and interactive prompts
The project is distributed as an NPM package.
📦 Installation
You can install Batman globally with:
npm install -g batman-commands
Then run:
batman help
For example:
batman safe-push "Add login validation"
or:
batman conflict
🎯 What I'm trying to achieve
The main idea behind Batman is simple:
Git is powerful, but sometimes the workflow around Git can be confusing.
I want Batman to help developers understand what is happening before they execute potentially risky Git operations.
It shouldn't replace Git.
It shouldn't replace the developer.
It should work alongside both.
Think of it as a small Git sidekick. 🦇
🚀 What's next?
Batman Git CLI Assistant is still a work in progress.
I'm planning to improve areas such as:
Better conflict visualization
More safety checks
Better Git workflow detection
More recovery options
Improved developer experience
Better documentation
More cross-platform testing
I'd also like to hear from other developers.
What Git problem do you find confusing or risky?
Is it:
Merge conflicts?
Rebasing?
Resetting?
Stashing?
Accidental commits?
Force pushing?
Git history?
Something else?
I'd love to hear your experience and ideas.
🔗 Try it
NPM Package:
https://www.npmjs.com/package/batman-commands
If you try it, I'd really appreciate your feedback, suggestions, issues, or ideas.
This project started from a real Git problem, and I'm hoping to turn it into a useful tool for other developers too.
Real problem → Real workflow → Real solution. 🦇