You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI service backed by an external CLI (i.e. Claude Code, Codex, Gemini CLI, …) #2855
Today, the AI commit-message assistant only supports OpenAI-compatible HTTP endpoints. That works well for API keys and local servers (Ollama, LM Studio, LiteLLM, etc.), but a lot of users access models through subscriptions that are only usable via the vendor's official CLI, like:
Claude Pro/Max: Claude Code (claude)
ChatGPT Plus/Pro/Team: Codex CLI (codex)
Google account / Code Assist: Gemini CLI (gemini)
GitHub Copilot: Copilot CLI (copilot)
Cursor: Cursor CLI (cursor-agent)
If I'm not wrong, using the OAuth tokens of these subscriptions directly from a third-party app is generally not allowed by the vendors' terms (I know about Anthropic's TOS, not completely sure about the others).
Maybe it could be possible to add a second kind of AI service, "External command", next to the existing OpenAI-compatible one.
SourceGit could just run the command in the repository's working directory, building the same prompt as today (instructions, additional prompt, change list) and also including the staged diff, so the CLI doesn't need permission to run git or edit files. The commit message would just be read from stdout.
Maybe also an optional dropdown in Preferences could fill in the Command/Arguments for the most common CLIs.
Reacted by antonio10m, hanxiaofeng1860 and Arthur CARLI
Activity