I Built a CLI Tool That Writes My Commit Messages —…
    Neura MarketNeura Market/DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityTrending
    DeepSeekBlogI Built a CLI Tool That Writes My Commit Messages
    Back to Blog
    I Built a CLI Tool That Writes My Commit Messages
    git

    I Built a CLI Tool That Writes My Commit Messages

    Lucas Neves Pereira March 20, 2026
    0 views

    Hello guys! We've all been there. You just finished a feature, you're ready to commit, and then you...


    title: I Built a CLI Tool That Writes My Commit Messages published: true tags: git, ai, cli, productivity

    Hello guys! We've all been there. You just finished a feature, you're ready to commit, and then you stare at the terminal for 30 seconds trying to come up with a decent commit message.

    Sometimes I'd spend more time thinking about the message than writing the actual code. So I did what any developer would do. I automated it.

    How it started

    I already had Claude installed on my machine. One day I realized I could just pipe my git diff into it and ask for a commit message. So I added this little function to my .zshrc:

    gpm() {
      git diff HEAD | claude -p "propose a conventional commit message for these changes. output only the message, nothing else."
    }
    

    That was it. Run gpm, get a message, copy paste it. Simple.

    Then I wanted to go further. Why not commit directly with the proposed message?

    gac() {
      msg=$(git diff HEAD | claude -p "propose a conventional commit message for these changes, one line only. output only the message, nothing else.")
      echo "\n$msg\n"
      read "confirm?Commit with this message? [y/N] "
      if [[ "$confirm" == "y" ]]; then
        git add -A && git commit -m "$msg"
      fi
    }
    

    This worked great for a while. But I kept wanting more. What about code review? PR descriptions? What if I could choose the model? What about using the API directly instead of going through the CLI?

    At some point I realized these shell functions were becoming a full tool. So I decided to build one.

    Meet claude-git

    claude-git is a CLI that reads your git diff and sends it to Claude to generate commit messages, review code, write PR descriptions, and more. It's written in bash, runs entirely in your terminal, and installs in one command.

    curl -fsSL https://raw.githubusercontent.com/lucasnevespereira/claude-git/main/install.sh | bash
    

    Let's go through the main features.

    Proposing a commit message

    The most basic command. Stage your changes, run claude-git msg, and you get a conventional commit message.

    claude-git msg
    # -> feat: add user authentication with JWT tokens
    

    That's it. It reads the diff, sends it to Claude, and outputs a message. You can copy it or use it however you want.

    Committing directly

    If you don't want to copy paste, claude-git commit will propose a message and ask you to confirm before committing.

    claude-git commit
    
    feat: add user authentication with JWT tokens
    
    Commit with this message? [y/N] y
    

    And if you're feeling confident and want to skip the confirmation:

    claude-git commit -y
    

    Prefix mode

    At work we often need to prefix commits with a ticket ID. Something like PROJ-42: fix login redirect. I got tired of typing the prefix manually so I added a prefix command that auto detects the ticket from your branch name.

    If your branch is called feature/PROJ-42-login-fix, running claude-git prefix will automatically extract PROJ-42 and prepend it to the message.

    claude-git prefix
    # -> PROJ-42: fix login redirect after session expiry
    

    You can also pass the prefix manually:

    claude-git prefix PROJ-42
    

    Code review

    Before pushing, I sometimes want a quick sanity check. The review command sends your diff to Claude and asks it to flag bugs, security issues, or logic errors.

    claude-git review
    

    It's not a replacement for a real code review, but it's useful to catch obvious mistakes before opening a PR.

    PR descriptions

    Writing PR descriptions is another thing that takes longer than it should. The pr command looks at all commits and the full diff against your base branch and generates a structured description.

    claude-git pr
    

    By default it compares against main, but you can specify another branch:

    claude-git pr develop
    

    Explaining changes

    Sometimes you come back to some changes you made yesterday and forgot what they do. The explain command gives you a quick summary.

    claude-git explain
    # -> These changes add rate limiting to the API endpoints using a token bucket...
    

    Short aliases

    I like short commands. The installer automatically adds aliases to your shell config:

    cg      # claude-git
    cgm     # claude-git msg
    cgc     # claude-git commit
    cgcy    # claude-git commit --yes
    cgrev   # claude-git review
    cgpr    # claude-git pr
    cgex    # claude-git explain
    cgpx    # claude-git prefix
    

    So in practice, committing with AI looks like this:

    cgcy
    

    Three characters and you're done.

    Configuration

    You can configure the model, the max diff size, and whether to use the API directly or go through the Claude CLI.

    claude-git config model sonnet      # use a more capable model
    claude-git config api_key sk-ant-...  # use API calls directly (faster)
    claude-git config max_lines 5000    # handle larger diffs
    

    By default it uses Haiku which is fast and cheap. If you set an API key, it will call the Anthropic API directly instead of going through Claude Code, which is noticeably faster.

    The config lives in ~/.claude-git as a simple key=value file. Nothing fancy.

    Why bash?

    I get this question a lot. Bash is not glamorous. But for a tool that wraps git commands and pipes text to an API, it's actually the perfect fit. No compile step, no dependencies, no runtime. It just works on any machine that has bash and git.

    The entire tool is a single file. That makes it easy to install, easy to read, and easy to contribute to.

    What I learned

    Building this tool taught me a few things. First, sometimes the best projects come from automating your own annoyances. I didn't sit down and plan this. It grew from a two line function in my shell config.

    Second, keeping things simple pays off. bash is not the fanciest choice but it made the tool easy to distribute and maintain. No build system, no package manager drama.

    And finally, AI is really good at reading diffs. The commit messages Claude generates are genuinely useful. Most of the time I accept them as is.

    Try it out

    If you want to give it a try:

    curl -fsSL https://raw.githubusercontent.com/lucasnevespereira/claude-git/main/install.sh | bash
    

    The repo is here: github.com/lucasnevespereira/claude-git

    It's open source under MIT. Feedback and contributions are welcome.

    Hope you find it useful!

    Tags

    gitaicliproductivity

    Comments

    More Blog

    View all
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    Stay up to date

    Get the latest DeepSeek prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for DeepSeek and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this DeepSeek resource

    • Automate Blog Content Creation with Notion MCP, DeepSeek AI, and WordPressn8n · $9.99 · Related topic
    • Tesla News and Sentiment Analysis Tool (Powered by DeepSeek Chat)n8n · $9.99 · Related topic
    • Convert Telegram Messages to Professional LinkedIn Posts with Gemini AI & Approval Workflown8n · $24.99 · Related topic
    • Generate AI Videos from Scripts with DeepSeek, Synthesia, and Together.ain8n · $24.99 · Related topic
    Browse all workflows