gitui icon indicating copy to clipboard operation
gitui copied to clipboard

feat: add ai-powered commit message helpers

Open yasunogithub opened this issue 4 months ago • 4 comments

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 check without errors
  • [x] I tested the overall application
  • [x] I added an appropriate item to the changelog

yasunogithub avatar Aug 21 '25 17:08 yasunogithub

@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 avatar Sep 17 '25 13:09 cruessler

@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:

  1. Direct API calls - Tools like aicommits make HTTP requests directly to OpenAI/Anthropic
  2. Local model integration - Tools use ollama or similar for local LLMs
  3. 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.

yasunogithub avatar Sep 17 '25 14:09 yasunogithub

Thanks for the context! I was mainly asking in order to avoid reinventing the wheel in case there are already existing patterns out there.

cruessler avatar Sep 17 '25 14:09 cruessler

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.

yasunogithub avatar Sep 21 '25 05:09 yasunogithub