worktrunk 0.1.1

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

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