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
// Copy this file to your GitUI config directory as "commit_helpers.ron"
3
+
//
4
+
// Config directory locations:
5
+
// - Linux: ~/.config/gitui/
6
+
// - macOS: ~/Library/Application Support/gitui/
7
+
// - Windows: %APPDATA%/gitui/
8
+
//
9
+
// Template variables available in commands:
10
+
// - {staged_diff} - Output of 'git diff --staged --no-color'
11
+
// - {staged_files} - List of staged files from 'git diff --staged --name-only'
12
+
// - {branch_name} - Current branch name
13
+
//
14
+
// Helper navigation:
15
+
// - Ctrl+G: Open helper selection (if multiple helpers configured)
16
+
// - Arrow keys: Navigate between helpers in selection mode
17
+
// - Enter: Execute selected helper
18
+
// - Hotkeys: Press configured hotkey to run helper directly
19
+
// - ESC: Cancel selection or running helper
20
+
21
+
CommitHelpers(
22
+
helpers: [
23
+
// Claude AI helper example (using template variables)
24
+
CommitHelper(
25
+
name: "Claude AI",
26
+
command: "echo '{staged_diff}' | claude -p 'Based on the following git diff of staged changes, generate a concise, conventional commit message. Follow this format:\n\n<type>: <description>\n\nWhere <type> is one of: feat, fix, docs, style, refactor, test, chore\nThe <description> should be lowercase and concise (50 chars or less).\n\nFor multiple types of changes, use the most significant one.\nOutput ONLY the commit message, no explanation or quotes.'",
27
+
description: Some("Generate conventional commit messages using Claude AI"),
28
+
hotkey: Some('c'),
29
+
timeout_secs: Some(30),
30
+
),
31
+
32
+
// OpenAI ChatGPT helper example (using template variables)
33
+
CommitHelper(
34
+
name: "ChatGPT",
35
+
command: "echo '{staged_diff}' | chatgpt 'Generate a concise conventional commit message for this diff. Format: <type>: <description>. Types: feat, fix, docs, style, refactor, test, chore. Max 50 chars.'",
36
+
description: Some("Generate commit messages using ChatGPT"),
37
+
hotkey: Some('g'),
38
+
timeout_secs: Some(25),
39
+
),
40
+
41
+
// Local AI helper example (using template variables)
42
+
CommitHelper(
43
+
name: "Local AI",
44
+
command: "echo '{staged_diff}' | ollama run codellama 'Generate a conventional commit message for this git diff. Use format: type: description. Keep under 50 characters.'",
45
+
description: Some("Generate commit messages using local Ollama model"),
46
+
hotkey: Some('l'),
47
+
timeout_secs: Some(45),
48
+
),
49
+
50
+
// Branch-specific helper example
51
+
CommitHelper(
52
+
name: "Branch Fix",
53
+
command: "echo 'fix({branch_name}): address issues in {staged_files}'",
0 commit comments