Have you ever felt lost in a wall of “WIP” commits? I often do. Writing detailed messages can slow me down, but a cluttered history isn’t any better. What if AI could instantly generate clear and meaningful commit messages with just one command alias? Imagine commit messages like fix(auth): resolve invalid token bug during login. It's time to simplify Git history and make it work for us.
Writing commit messages takes time, and most of us avoid it. Yet, we need these messages to track our progress. The common solution is to create WIP commits, but these only clutter the history. What if we let AI write commit messages for us? Imagine running a coding agent in your terminal that quickly creates commit messages from your repository folder. Let’s make that happen.
I use Opencode as my coding agent. During an AI session and after making changes, I type “commit” to have AI generate a commit message for my current session. It works well and saves me time. However, when I make manual changes outside of a coding session, I have to start a session and enter the commit prompt, which feels like a few extra steps.
Fortunately, Opencode allows us to execute prompts directly from the command line. By running `opencode run "commit"` in our repository, it generates a commit message for us. Still, this process takes some effort. We can make it even easier by creating an alias. With a simple `wip` command, Opencode will generate our commit message.
I use oh-my-zsh, and to create an alias, I added this line to `~/.oh-my-zsh/custom/aliases.zsh`:
Writing commit messages takes time, and most of us avoid it. Yet, we need these messages to track our progress. The common solution is to create WIP commits, but these only clutter the history. What if we let AI write commit messages for us? Imagine running a coding agent in your terminal that quickly creates commit messages from your repository folder. Let’s make that happen.
I use Opencode as my coding agent. During an AI session and after making changes, I type “commit” to have AI generate a commit message for my current session. It works well and saves me time. However, when I make manual changes outside of a coding session, I have to start a session and enter the commit prompt, which feels like a few extra steps.
Fortunately, Opencode allows us to execute prompts directly from the command line. By running `opencode run "commit"` in our repository, it generates a commit message for us. Still, this process takes some effort. We can make it even easier by creating an alias. With a simple `wip` command, Opencode will generate our commit message.
I use oh-my-zsh, and to create an alias, I added this line to `~/.oh-my-zsh/custom/aliases.zsh`:
alias wip="opencode run 'commit'"
After saving the file and reloading the terminal, I can use the `wip` alias to get AI-generated commit messages. But after committing, I also need to run `git push`. We can update the alias to do both by changing it to:
alias wip="opencode run 'commit and push'"
Now, I can commit and push my work in progress with just `wip`. It’s super convenient!
You can set up this alias in your shell, though the steps may differ if you use bash or another shell. You can also use other coding agents, such as Claude Code, OpenAI Codex, or many others. Customizing the AI prompt is easy as well. I use the prompt:
commit and push. make sure it includes a prefix like docs: ui: core: ci: ignore: wip:
I borrowed this prefix style from Opencode’s GitHub repository. It makes commit messages easier to scan.
That’s it! I encourage you to try this solution for clear, readable WIP commit messages. Keep looking for small workflow tricks like this—they can make a big difference in your productivity.