Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Reorder global config options for clarity
Maximilian Roosd4ebbfb9a193
diff --git a/dev/config.example.toml b/dev/config.example.tomlindex 437337ce3..3b8818a00 100644--- a/dev/config.example.toml+++ b/dev/config.example.toml@@ -4,12 +4,19 @@# Windows: %APPDATA%\worktrunk\config.toml## Generate with: wt config create-#-# NOTE: This file is the source of truth for default configuration.-# The commented templates below match src/llm.rs constants:-# - DEFAULT_TEMPLATE (lines 41-76)-# - DEFAULT_SQUASH_TEMPLATE (lines 109-118)-# When changing these constants, update the commented sections here to match.++# Commit Message Generation (Optional)+# For generating commit messages during merge operations (wt merge)+[commit-generation]+# 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"]# Worktree Path Template# Variables: {{ main_worktree }} = main worktree directory name, {{ branch }} = branch name@@ -23,18 +30,49 @@ worktree-path = "../{{ main_worktree }}.{{ 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)-[commit-generation]-# 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"]+# List Command Defaults+# Configure default behavior for `wt list`+[list]+full = false # Show CI, conflicts, diffs by default+branches = false # Include branches without worktrees by default+remotes = false # Include remote branches by default-# Alternative: AIChat - Rust-based, supports 20+ providers-# Install from: https://github.com/sigoden/aichat-# command = "aichat"-# args = ["-m", "claude:claude-haiku-4.5"]+# Commit Defaults (shared by `wt beta commit`, `wt beta squash`, and `wt merge`)+[commit]+stage = "all" # What to stage: "all", "tracked", or "none"++# Merge Command Defaults+# Note: `stage` defaults from [commit] section above+[merge]+squash = true # Squash commits when merging+commit = true # Create commit after merge+remove = true # Remove worktree after merge+verify = true # Run project hooks++# 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"++# 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++# Optional: Load template from file (mutually exclusive with 'template')+# Supports ~ expansion: ~/.config/worktrunk/commit-template.txt+# template-file = "~/.config/worktrunk/commit-template.txt"++# 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"++# Custom Prompt Templates (Advanced)+# NOTE: The commented templates below match src/llm.rs constants:+# - DEFAULT_TEMPLATE (lines 41-76)+# - DEFAULT_SQUASH_TEMPLATE (lines 109-118)+# When changing these constants, update the commented sections here to match.# Optional: Custom prompt template (inline) - Uses minijinja syntax# Available variables: {{ git_diff }}, {{ branch }}, {{ recent_commits }}, {{ repo }}@@ -100,10 +138,6 @@ args = ["-m", "claude-haiku-4.5"]# - Focus on WHY, not HOW# """-# 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 minijinja syntax# Available variables: {{ commits }}, {{ target_branch }}, {{ branch }}, {{ repo }}# If not specified, uses the default template:@@ -140,37 +174,3 @@ args = ["-m", "claude-haiku-4.5"]# Generate one cohesive commit message that captures the overall change.# Use conventional commit format (feat/fix/docs/refactor).# """--# 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--# List Command Defaults-# Configure default behavior for `wt list`-[list]-full = false # Show CI, conflicts, diffs by default-branches = false # Include branches without worktrees by default-remotes = false # Include remote branches by default--# Commit Defaults (shared by `wt beta commit`, `wt beta squash`, and `wt merge`)-[commit]-stage = "all" # What to stage: "all", "tracked", or "none"--# Merge Command Defaults-# Note: `stage` defaults from [commit] section above-[merge]-squash = true # Squash commits when merging-commit = true # Create commit after merge-remove = true # Remove worktree after merge-verify = true # Run project hooks--# 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"diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snapindex 33cc61e79..c5c9141e3 100644--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap@@ -40,12 +40,19 @@ Creates [2m~/.config/worktrunk/config.toml[0m with the following content:[2m# Windows: %APPDATA%\worktrunk\config.toml[0m[2m#[0m[2m# Generate with: wt config create[0m- [2m#[0m- [2m# NOTE: This file is the source of truth for default configuration.[0m- [2m# The commented templates below match src/llm.rs constants:[0m- [2m# - DEFAULT_TEMPLATE (lines 41-76)[0m- [2m# - DEFAULT_SQUASH_TEMPLATE (lines 109-118)[0m- [2m# When changing these constants, update the commented sections here to match.[0m+ [2m[0m+ [2m# Commit Message Generation (Optional)[0m+ [2m# For generating commit messages during merge operations (wt merge)[0m+ [2m[commit-generation][0m+ [2m# Example: Simon Willison's llm CLI (https://github.com/simonw/llm)[0m+ [2m# Install: pip install llm llm-anthropic[0m+ [2mcommand = "llm"[0m+ [2margs = ["-m", "claude-haiku-4.5"][0m+ [2m[0m+ [2m# Alternative: AIChat - Rust-based, supports 20+ providers[0m+ [2m# Install from: https://github.com/sigoden/aichat[0m+ [2m# command = "aichat"[0m+ [2m# args = ["-m", "claude:claude-haiku-4.5"][0m[2m[0m[2m# Worktree Path Template[0m[2m# Variables: {{ main_worktree }} = main worktree directory name, {{ branch }} = branch name[0m@@ -59,18 +66,49 @@ Creates [2m~/.config/worktrunk/config.toml[0m with the following content:[2m# Alternative: Shared directory for multiple repos[0m[2m# worktree-path = "../worktrees/{{ main_worktree }}/{{ branch }}"[0m[2m[0m- [2m# Commit Message Generation (Optional)[0m- [2m# For generating commit messages during merge operations (wt merge)[0m- [2m[commit-generation][0m- [2m# Example: Simon Willison's llm CLI (https://github.com/simonw/llm)[0m- [2m# Install: pip install llm llm-anthropic[0m- [2mcommand = "llm"[0m- [2margs = ["-m", "claude-haiku-4.5"][0m+ [2m# List Command Defaults[0m+ [2m# Configure default behavior for `wt list`[0m+ [2m[list][0m+ [2mfull = false # Show CI, conflicts, diffs by default[0m+ [2mbranches = false # Include branches without worktrees by default[0m+ [2mremotes = false # Include remote branches by default[0m[2m[0m- [2m# Alternative: AIChat - Rust-based, supports 20+ providers[0m- [2m# Install from: https://github.com/sigoden/aichat[0m- [2m# command = "aichat"[0m- [2m# args = ["-m", "claude:claude-haiku-4.5"][0m+ [2m# Commit Defaults (shared by `wt beta commit`, `wt beta squash`, and `wt merge`)[0m+ [2m[commit][0m+ [2mstage = "all" # What to stage: "all", "tracked", or "none"[0m+ [2m[0m+ [2m# Merge Command Defaults[0m+ [2m# Note: `stage` defaults from [commit] section above[0m+ [2m[merge][0m+ [2msquash = true # Squash commits when merging[0m+ [2mcommit = true # Create commit after merge[0m+ [2mremove = true # Remove worktree after merge[0m+ [2mverify = true # Run project hooks[0m+ [2m[0m+ [2m# Approved Commands[0m+ [2m# Commands approved for automatic execution after switching worktrees[0m+ [2m# Auto-populated when you use: wt switch --execute "command" --force[0m+ [2m[[approved-commands]][0m+ [2mproject = "github.com/user/repo"[0m+ [2mcommand = "npm install"[0m+ [2m[0m+ [2m# NOTE: For project-specific commands (post-create, post-start, pre-merge, etc.),[0m+ [2m# use a separate PROJECT config file at <repo>/.config/wt.toml[0m+ [2m# See: .config/wt.example.toml for project configuration examples[0m+ [2m[0m+ [2m# Optional: Load template from file (mutually exclusive with 'template')[0m+ [2m# Supports ~ expansion: ~/.config/worktrunk/commit-template.txt[0m+ [2m# template-file = "~/.config/worktrunk/commit-template.txt"[0m+ [2m[0m+ [2m# Optional: Load squash template from file (mutually exclusive with 'squash-template')[0m+ [2m# Supports ~ expansion: ~/.config/worktrunk/squash-template.txt[0m+ [2m# squash-template-file = "~/.config/worktrunk/squash-template.txt"[0m+ [2m[0m+ [2m# Custom Prompt Templates (Advanced)[0m+ [2m# NOTE: The commented templates below match src/llm.rs constants:[0m+ [2m# - DEFAULT_TEMPLATE (lines 41-76)[0m+ [2m# - DEFAULT_SQUASH_TEMPLATE (lines 109-118)[0m+ [2m# When changing these constants, update the commented sections here to match.[0m[2m[0m[2m# Optional: Custom prompt template (inline) - Uses minijinja syntax[0m[2m# Available variables: {{ git_diff }}, {{ branch }}, {{ recent_commits }}, {{ repo }}[0m@@ -136,10 +174,6 @@ Creates [2m~/.config/worktrunk/config.toml[0m with the following content:[2m# - Focus on WHY, not HOW[0m[2m# """[0m[2m[0m- [2m# Optional: Load template from file (mutually exclusive with 'template')[0m- [2m# Supports ~ expansion: ~/.config/worktrunk/commit-template.txt[0m- [2m# template-file = "~/.config/worktrunk/commit-template.txt"[0m- [2m[0m[2m# Optional: Custom squash commit message template (inline) - Uses minijinja syntax[0m[2m# Available variables: {{ commits }}, {{ target_branch }}, {{ branch }}, {{ repo }}[0m[2m# If not specified, uses the default template:[0m@@ -176,39 +210,5 @@ Creates [2m~/.config/worktrunk/config.toml[0m with the following content:[2m# Generate one cohesive commit message that captures the overall change.[0m[2m# Use conventional commit format (feat/fix/docs/refactor).[0m[2m# """[0m- [2m[0m- [2m# Optional: Load squash template from file (mutually exclusive with 'squash-template')[0m- [2m# Supports ~ expansion: ~/.config/worktrunk/squash-template.txt[0m- [2m# squash-template-file = "~/.config/worktrunk/squash-template.txt"[0m- [2m[0m- [2m# NOTE: For project-specific commands (post-create, post-start, pre-merge, etc.),[0m- [2m# use a separate PROJECT config file at <repo>/.config/wt.toml[0m- [2m# See: .config/wt.example.toml for project configuration examples[0m- [2m[0m- [2m# List Command Defaults[0m- [2m# Configure default behavior for `wt list`[0m- [2m[list][0m- [2mfull = false # Show CI, conflicts, diffs by default[0m- [2mbranches = false # Include branches without worktrees by default[0m- [2mremotes = false # Include remote branches by default[0m- [2m[0m- [2m# Commit Defaults (shared by `wt beta commit`, `wt beta squash`, and `wt merge`)[0m- [2m[commit][0m- [2mstage = "all" # What to stage: "all", "tracked", or "none"[0m- [2m[0m- [2m# Merge Command Defaults[0m- [2m# Note: `stage` defaults from [commit] section above[0m- [2m[merge][0m- [2msquash = true # Squash commits when merging[0m- [2mcommit = true # Create commit after merge[0m- [2mremove = true # Remove worktree after merge[0m- [2mverify = true # Run project hooks[0m- [2m[0m- [2m# Approved Commands[0m- [2m# Commands approved for automatic execution after switching worktrees[0m- [2m# Auto-populated when you use: wt switch --execute "command" --force[0m- [2m[[approved-commands]][0m- [2mproject = "github.com/user/repo"[0m- [2mcommand = "npm install"[0m----- stderr -----