feat: add ai-powered commit message helpers
This Pull Request fixes/closes #{issue_num}.
It changes the following:
- Add commit helper with a configurable RON-based commit helper system supporting multiple helpers
- Add helper selection UI with keyboard navigation, hotkeys, and smooth spinner animations for background execution
- Implement template variables ({staged_diff}, {staged_files}, {branch_name}) for flexible command customization and improved error handling I followed the checklist:
- [x] I added unittests
- [x] I ran
make checkwithout errors - [x] I tested the overall application
- [x] I added an appropriate item to the changelog
@yasunogithub Do you know how other CLI tools interface with LLMs? Is your approach in this PR inspired by similar approaches in other tools?
@yasunogithub Do you know how other CLI tools interface with LLMs? Is your approach in this PR inspired by similar approaches in other tools?
@cruessler Honestly, I don't have deep knowledge of how other CLI tools specifically interface with LLMs. But based on what I researched, there seem to be a few common patterns:
- Direct API calls - Tools like aicommits make HTTP requests directly to OpenAI/Anthropic
- Local model integration - Tools use ollama or similar for local LLMs
- Shell command execution - Some tools spawn subprocesses to call LLM CLIs
Our approach is simple but flexible - we execute any shell command you configure. So you could:
- Call curl to hit OpenAI API directly
- Use ollama run llama3.2 for local models
- Run custom Python/Node scripts
- Chain multiple commands with pipes
The template variables like {staged_diff} give the commands git context, and the RON config lets you set up multiple helpers with hotkeys.
I chose this approach because any CLI command works - users aren't locked into specific LLM providers or APIs. Want to try a new AI service? Just update your config file.
Thanks for the context! I was mainly asking in order to avoid reinventing the wheel in case there are already existing patterns out there.
Thanks for the context! I was mainly asking in order to avoid reinventing the wheel in case there are already existing patterns out there.
Thanks, I agree—this implementation is simple but still consistent with the common patterns, so I don't feel like reinventing the wheel.