worktrunk 0.1.5

A Git worktree manager for trunk-based development
Documentation
# 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
#
# 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.

# 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)
worktree-path = "../{{ 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)
[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"]

# Optional: Custom prompt template (inline) - Uses minijinja 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>
# """
#
# Example alternative template with different style:
# template = """
# Generate a commit message for {{ repo | upper }}.
#
# Branch: {{ branch }}
# {%- if recent_commits %}
#
# Recent commit style ({{ recent_commits | length }} commits):
# {%- for commit in recent_commits %}
#   {{ loop.index }}. {{ commit }}
# {%- endfor %}
# {%- endif %}
#
# Changes to commit:
# ```
# {{ git_diff }}
# ```
#
# Requirements:
# - Follow the style of recent commits above
# - First line under 50 chars
# - 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:
# 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 %}
# """
#
# Example alternative template:
# squash-template = """
# Squashing {{ commits | length }} commit(s) from {{ branch }} to {{ target_branch }}.
#
# {% if commits | length > 1 -%}
# Commits being combined:
# {%- for c in commits %}
#   {{ loop.index }}/{{ loop.length }}: {{ c }}
# {%- endfor %}
# {%- else -%}
# Single commit: {{ commits[0] }}
# {%- endif %}
#
# 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

# 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"