Commit 6a2b73865b0b

Vincent Demeester <vincent@sbr.pm>
2026-02-25 16:08:29
feat(lazyworktree): add AI naming, JIRA menu, kitty tabs
Added AI-generated branch names and worktree notes via aichat with Gemini Flash. Added JIRA ticket creation menu using jayrah. Switched custom commands from tmux sessions to kitty tabs. Enabled link_topsymlinks on worktree init. Fixed template syntax to current placeholder format. Removed Claude (cr) commands.
1 parent 68d5e8c
Changed files (1)
dots
config
lazyworktree
dots/config/lazyworktree/config.yaml
@@ -1,66 +1,64 @@
 auto_fetch_prs: false
 auto_refresh: true
-custom_commands:
-  E:
-    description: Tmux + Pi (Vertex)
-    show_help: true
-    tmux:
-      attach: true
-      on_exists: switch
-      session_name: wt:$WORKTREE_NAME
-      windows:
-        - command: pir
-          name: pir
-        - command: zsh
-          name: shell
-        - command: lazygit
-          name: lazygit
-  O:
-    description: Tmux + Claude (Vertex)
-    show_help: true
-    tmux:
-      attach: true
-      on_exists: switch
-      session_name: wt:$WORKTREE_NAME
-      windows:
-        - command: cr
-          name: claude
-        - command: zsh
-          name: shell
-        - command: lazygit
-          name: lazygit
-  e:
-    command: pir
-    description: Pi (Vertex)
-    show_help: true
-  o:
-    command: cr
-    description: Claude (Vertex)
-    show_help: true
-  t:
-    description: Tmux session
-    show_help: true
-    tmux:
-      attach: true
-      on_exists: switch
-      session_name: wt:$WORKTREE_NAME
-      windows:
-        - command: emacs
-          name: emacs
-        - command: zsh
-          name: shell
-        - command: lazygit
-          name: lazygit
-        - command: pir
-          name: pir
 editor: emacsclient -t
 git_pager: delta
 git_pager_args: --paging=never --dark --line-numbers
 icon_set: nerd-font-v3
-issue_branch_name_template: "{{.IssueNumber}}-{{.Slug}}"
 max_name_length: 95
 merge_method: rebase
-pr_branch_name_template: "pr-{{.PRNumber}}-{{.Slug}}"
 refresh_interval: 10
 session_prefix: wt-
 sort_mode: path
+
+# Worktree lifecycle
+init_commands:
+  - link_topsymlinks
+terminate_commands:
+  - echo "Cleaning up $WORKTREE_NAME"
+
+# Branch naming
+branch_name_script: "aichat -m gemini:gemini-2.0-flash-lite 'Generate a short git branch name (no spaces, use hyphens) for this diff. Output only the branch name, nothing else.'"
+issue_branch_name_template: "{number}-{generated}"
+pr_branch_name_template: "pr-{number}-{generated}"
+
+# Worktree notes
+worktree_note_script: "aichat -m gemini:gemini-2.0-flash-lite 'Summarise this pr or ticket as concise implementation notes to make easy to know what is it about at glance'"
+worktree_notes_path: "~/.local/share/lazyworktree/worktree-notes.json"
+
+# Custom commands
+custom_commands:
+  E:
+    command: pir
+    description: Pi (Vertex)
+    show_help: true
+  e:
+    command: pir
+    description: Pi tab (Vertex)
+    new_tab: true
+    show_help: true
+  t:
+    command: zsh
+    description: Shell tab
+    new_tab: true
+    show_help: true
+
+# Custom worktree creation menus
+custom_create_menus:
+  - label: "From JIRA ticket"
+    description: "Create from JIRA issue"
+    interactive: true
+    command: |
+      prompt="Generate a short git branch name (no spaces, use hyphens) for this diff.
+      output only the branch name, nothing else. No need to output the ticket number in the branch, i'll add it myself."
+      c=$(jayrah browse myissue --choose)
+      if [[ -n ${c} ]]; then
+        msg=$(jayrah cli view ${c/ */} | aichat -m gemini:gemini-2.0-flash-lite "$prompt")
+        if [[ -n ${msg} ]]; then
+          echo ${c/ */}-${msg}
+        fi
+      fi
+    post_command: |
+      mkdir -p tmp/
+      ticket=$(git rev-parse --abbrev-ref HEAD|tr a-z A-Z |sed 's/\([Ss][Rr][Vv][Kk][Pp]-[0-9]*\)-.*/\1/')
+      echo "https://issues.redhat.com/browse/${ticket}" > tmp/${ticket}.md
+      jayrah cli view ${ticket} >> tmp/${ticket}.md