1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Worktrunk Global Configuration
# Location (XDG Base Directory spec):
# macOS/Linux: ~/.config/worktrunk/config.toml (or $XDG_CONFIG_HOME/worktrunk/config.toml)
# Windows: %APPDATA%\worktrunk\config.toml
#
# Generate with: wt config init
# Worktree Path Template
# Variables: {main-worktree} = main worktree directory name, {branch} = branch name
# Branch slashes are replaced with dashes (feature/auth → feature-auth)
# Paths are relative to the main worktree root (original repository directory)
= "../{main-worktree}.{branch}"
# Alternative: Inside repo (useful for bare repos)
# worktree-path = ".worktrees/{branch}"
# Alternative: Shared directory for multiple repos
# worktree-path = "../worktrees/{main-worktree}/{branch}"
# Commit Message Generation (Optional)
# For generating commit messages during merge operations (wt merge)
[]
# Example: Simon Willison's llm CLI (https://github.com/simonw/llm)
# Install: pip install llm llm-anthropic
# command = "llm"
# args = ["-m", "claude-haiku-4.5"]
# Alternative: AIChat - Rust-based, supports 20+ providers
# Install from: https://github.com/sigoden/aichat
# command = "aichat"
# args = ["-m", "claude:claude-haiku-4.5"]
# Optional: Custom prompt template (inline) - Uses Jinja2 syntax
# Available variables: {{ git_diff }}, {{ branch }}, {{ recent_commits }}, {{ repo }}
# If not specified, uses the default template shown below:
# template = """
# Format
# - First line: <50 chars, present tense, describes WHAT and WHY (not HOW).
# - Blank line after first line.
# - Optional details with proper line breaks explaining context. Commits with more substantial changes should have more details.
# - Return ONLY the formatted message without quotes, code blocks, or preamble.
#
# Style
# - Do not give normative statements or otherwise speculate on why the change was made.
# - Broadly match the style of the previous commit messages.
# - For example, if they're in conventional commit format, use conventional commits; if they're not, don't use conventional commits.
#
# The context contains:
# - <git-diff> with the staged changes. This is the ONLY content you should base your message on.
# - <git-info> with branch name and recent commit message titles for style reference ONLY. DO NOT use their content to inform your message.
#
# ---
# The following is the context for your task:
# ---
# <git-diff>
# ```
# {{ git_diff }}
# ```
# </git-diff>
#
# <git-info>
# <current-branch>{{ branch }}</current-branch>
# {% if recent_commits %}
# <previous-commit-message-titles>
# {% for commit in recent_commits %}
# <previous-commit-message-title>{{ commit }}</previous-commit-message-title>
# {% endfor %}
# </previous-commit-message-titles>
# {% endif %}
# </git-info>
# """
# Optional: Load template from file (mutually exclusive with 'template')
# Supports ~ expansion: ~/.config/worktrunk/commit-template.txt
# template-file = "~/.config/worktrunk/commit-template.txt"
# Optional: Custom squash commit message template (inline) - Uses Jinja2 syntax
# Available variables: {{ commits }}, {{ target_branch }}, {{ branch }}, {{ repo }}
# If not specified, uses the default template:
# squash-template = """
# Generate a conventional commit message (feat/fix/docs/style/refactor) that combines these changes into one cohesive message. Output only the commit message without any explanation.
#
# Squashing commits on current branch since branching from {{ target_branch }}
#
# Commits being combined:
# {% for commit in commits %}
# - {{ commit }}
# {% endfor %}
# """
# Optional: Load squash template from file (mutually exclusive with 'squash-template')
# Supports ~ expansion: ~/.config/worktrunk/squash-template.txt
# squash-template-file = "~/.config/worktrunk/squash-template.txt"
# NOTE: For project-specific commands (post-create, post-start, pre-merge, etc.),
# use a separate PROJECT config file at <repo>/.config/wt.toml
# See: .config/wt.example.toml for project configuration examples
# Approved Commands
# Commands approved for automatic execution after switching worktrees
# Auto-populated when you use: wt switch --execute "command" --force
# [[approved-commands]]
# project = "github.com/user/repo"
# command = "npm install"