Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

chore: remove unreferenced snapshot files (#784)

worktrunk-bot1c87947abbaf
diff --git a/tests/snapshots/integration__integration_tests__help__help_config.snap b/tests/snapshots/integration__integration_tests__help__help_config.snap
deleted file mode 100644
index 3eceaf18d..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config.snap
+++ /dev/null
@@ -1,382 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config - Manage user & project configs
-
-Includes shell integration, hooks, and saved state.
-
-Usage: wt config [OPTIONS] <COMMAND>
-
-Commands:
- shell Shell integration setup
- create Create configuration file
- show Show configuration files & locations
- state Manage internal data and cache
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Install shell integration (required for directory switching):
-
- wt config shell install
-
-Create user config file with documented examples:
-
- wt config create
-
-Create project config file (.config/wt.toml) for hooks:
-
- wt config create --project
-
-Show current configuration and file locations:
-
- wt config show
-
-Configuration files
-
- File Location Contains Committed & shared
- ────────────── ─────────────────────────────── ─────────────────────────────────────────────── ──────────────────
- User config ~/.config/worktrunk/config.toml Worktree path template, LLM commit configs, etc ✗
- Project config .config/wt.toml Project hooks, dev server URL ✓
-
-────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-
-Worktrunk User Configuration
-
-Create with wt config create.
-
-Location:
-
-- macOS/Linux: ~/.config/worktrunk/config.toml (or $XDG_CONFIG_HOME if set)
-- Windows: %APPDATA%\worktrunk\config.toml
-
-Worktree path template
-
-Controls where new worktrees are created. Paths are relative to the repository root.
-
-Variables:
-
-- {{ repo }} — repository directory name
-- {{ branch }} — raw branch name (e.g., feature/auth)
-- {{ branch | sanitize }} — filesystem-safe: / and \ become - (e.g., feature-auth)
-- {{ branch | sanitize_db }} — database-safe: lowercase, underscores, hash suffix (e.g., feature_auth_x7k)
-
-Examples for repo at ~/code/myproject, branch feature/auth:
-
- # Default — siblings in parent directory
- # Creates: ~/code/myproject.feature-auth
- worktree-path = "../{{ repo }}.{{ branch | sanitize }}"
- 
- # Inside the repository
- # Creates: ~/code/myproject/.worktrees/feature-auth
- worktree-path = ".worktrees/{{ branch | sanitize }}"
- 
- # Namespaced (useful when multiple repos share a parent directory)
- # Creates: ~/code/worktrees/myproject/feature-auth
- worktree-path = "../worktrees/{{ repo }}/{{ branch | sanitize }}"
- 
- # Nested bare repo (git clone --bare <url> project/.git)
- # Creates: ~/code/project/feature-auth (sibling to .git)
- worktree-path = "../{{ branch | sanitize }}"
-
-LLM commit messages
-
-Generate commit messages automatically during merge. Requires an external CLI tool. See LLM commits docs for setup and template customization.
-
-Using llm (install: pip install llm llm-anthropic):
-
- [commit-generation]
- command = "llm"
- args = ["-m", "claude-haiku-4.5"]
-
-Using aichat:
-
- [commit-generation]
- command = "aichat"
- args = ["-m", "claude:claude-haiku-4.5"]
-
-See Custom prompt templates for inline template options.
-
-Commands
-
-List
-
-Persistent flag values for wt list. Override on command line as needed.
-
- [list]
- full = false # Show CI status and main…± diffstat columns (--full)
- branches = false # Include branches without worktrees (--branches)
- remotes = false # Include remote-only branches (--remotes)
-
-Commit
-
-Shared by wt step commit, wt step squash, and wt merge.
-
- [commit]
- stage = "all" # What to stage before commit: "all", "tracked", or "none"
-
-Merge
-
-All flags are on by default. Set to false to change default behavior.
-
- [merge]
- squash = true # Squash commits into one (--no-squash to preserve history)
- commit = true # Commit uncommitted changes first (--no-commit to skip)
- rebase = true # Rebase onto target before merge (--no-rebase to skip)
- remove = true # Remove worktree after merge (--no-remove to keep)
- verify = true # Run project hooks (--no-verify to skip)
-
-Select
-
-Pager behavior for wt select diff previews.
-
- [select]
- # Pager command with flags for diff preview (overrides git's core.pager)
- # Use this to specify pager flags needed for non-TTY contexts
- # Example:
- # pager = "delta --paging=never"
-
-Per-project settings (Experimental)
-
-Per-project settings are keyed by project identifier (e.g., github.com/user/repo).
-These contain approved hook commands plus optional overrides of global settings.
-Setting overrides (worktree-path, list, commit, merge) are new; approved-commands is stable.
-
- [projects."github.com/user/repo"]
- # Approved hook commands (auto-populated when approving on first run)
- approved-commands = ["npm ci", "npm test"]
- 
- # Optional overrides (omit to use global settings)
- worktree-path = ".worktrees/{{ branch | sanitize }}"
- list.full = true
- merge.squash = false
-
-For project-specific hooks (post-create, post-start, pre-merge, etc.), use a project config at <repo>/.config/wt.toml. Run wt config create --project to create one, or see wt hook docs.
-
-Custom prompt templates
-
-Templates use minijinja syntax.
-
-Commit template
-
-Available variables:
-
-- {{ git_diff }}, {{ git_diff_stat }} — diff content
-- {{ branch }}, {{ repo }} — context
-- {{ recent_commits }} — recent commit messages
-
-Default template:
-
- [commit-generation]
- template = """
- Write a commit message for the staged changes below.
- 
- <format>
- - Subject under 50 chars, blank line, then optional body
- - Output only the commit message, no quotes or code blocks
- </format>
- 
- <style>
- - Imperative mood: "Add feature" not "Added feature"
- - Match recent commit style (conventional commits if used)
- - Describe the change, not the intent or benefit
- </style>
- 
- <diffstat>
- {{ git_diff_stat }}
- </diffstat>
- 
- <diff>
- {{ git_diff }}
- </diff>
- 
- <context>
- Branch: {{ branch }}
- {% if recent_commits %}<recent_commits>
- {% for commit in recent_commits %}- {{ commit }}
- {% endfor %}</recent_commits>{% endif %}
- </context>
- 
- """
-
-Squash template
-
-Available variables (in addition to commit template variables):
-
-- {{ commits }} — list of commits being squashed
-- {{ target_branch }} — merge target branch
-
-Default template:
-
- [commit-generation]
- squash-template = """
- Combine these commits into a single commit message.
- 
- <format>
- - Subject under 50 chars, blank line, then optional body
- - Output only the commit message, no quotes or code blocks
- </format>
- 
- <style>
- - Imperative mood: "Add feature" not "Added feature"
- - Match the style of commits being squashed (conventional commits if used)
- - Describe the change, not the intent or benefit
- </style>
- 
- <commits branch="{{ branch }}" target="{{ target_branch }}">
- {% for commit in commits %}- {{ commit }}
- {% endfor %}</commits>
- 
- <diffstat>
- {{ git_diff_stat }}
- </diffstat>
- 
- <diff>
- {{ git_diff }}
- </diff>
- 
- """
-
-────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-
-Worktrunk Project Configuration
-
-The project config defines lifecycle hooks and project-specific settings. This file is checked into version control and shared across the team.
-
-Create .config/wt.toml in the repository root:
-
- [post-create]
- install = "npm ci"
- 
- [pre-merge]
- test = "npm test"
- lint = "npm run lint"
-
-See wt hook for complete documentation on hook types, execution order, template variables, and JSON context.
-
-Dev server URL
-
-The [list] section adds a URL column to wt list:
-
- [list]
- url = "http://localhost:{{ branch | hash_port }}"
-
-URLs are dimmed when the port isn't listening.
-
-CI platform override
-
-The [ci] section overrides CI platform detection for GitHub Enterprise or self-hosted GitLab with custom domains:
-
- [ci]
- platform = "github" # or "gitlab"
-
-By default, the platform is detected from the remote URL. Use this when URL detection fails (e.g., git.mycompany.com instead of github.mycompany.com).
-
-────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-
-Shell integration
-
-Worktrunk needs shell integration to change directories when switching worktrees. Install with:
-
- wt config shell install
-
-Or manually add to the shell config:
-
- # For bash: add to ~/.bashrc
- eval "$(wt config shell init bash)"
- 
- # For zsh: add to ~/.zshrc
- eval "$(wt config shell init zsh)"
- 
- # For fish: add to ~/.config/fish/config.fish
- wt config shell init fish | source
-
-Without shell integration, wt switch prints the target directory but cannot cd into it.
-
-Skip first-run prompt
-
-On first run without shell integration, Worktrunk offers to install it. Suppress this prompt in CI or automated environments:
-
- skip-shell-integration-prompt = true
-
-Or via environment variable:
-
- export WORKTRUNK_SKIP_SHELL_INTEGRATION_PROMPT=true
-
-Environment variables
-
-All user config options can be overridden with environment variables using the WORKTRUNK_ prefix.
-
-Naming convention
-
-Config keys use kebab-case (worktree-path), while env vars use SCREAMING_SNAKE_CASE (WORKTRUNK_WORKTREE_PATH). The conversion happens automatically.
-
-For nested config sections, use double underscores to separate levels:
-
- Config Environment Variable
- ───────────────────────── ────────────────────────────────────
- worktree-path WORKTRUNK_WORKTREE_PATH
- commit-generation.command WORKTRUNK_COMMIT_GENERATION__COMMAND
- commit-generation.args WORKTRUNK_COMMIT_GENERATION__ARGS
-
-Note the single underscore after WORKTRUNK and double underscores between nested keys.
-
-Array values
-
-Array config values like args = ["-m", "claude-haiku"] can be specified as a single string in environment variables:
-
- export WORKTRUNK_COMMIT_GENERATION__ARGS="-m claude-haiku"
-
-Example: CI/testing override
-
-Override the LLM command in CI to use a mock:
-
- WORKTRUNK_COMMIT_GENERATION__COMMAND=echo \
- WORKTRUNK_COMMIT_GENERATION__ARGS="test: automated commit" \
-  wt merge
-
-Other environment variables
-
- Variable Purpose
- ───────────────────────────────── ─────────────────────────────────────────────────────────────────────────────────
- WORKTRUNK_BIN Override binary path for shell wrappers (useful for testing dev builds)
- WORKTRUNK_CONFIG_PATH Override user config file location
- WORKTRUNK_DIRECTIVE_FILE Internal: set by shell wrappers to enable directory changes
- WORKTRUNK_SHELL Internal: set by shell wrappers to indicate shell type (e.g., powershell)
- WORKTRUNK_MAX_CONCURRENT_COMMANDS Max parallel git commands (default: 32). Lower if hitting file descriptor limits.
- NO_COLOR Disable colored output (standard)
- CLICOLOR_FORCE Force colored output even when not a TTY
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_create_long.snap
deleted file mode 100644
index a56ab1174..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_create_long.snap
+++ /dev/null
@@ -1,353 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - create
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config create - Create configuration file
-
-Usage: wt config create [OPTIONS]
-
-Options:
- --project
- Create project config (.config/wt.toml) instead of user config
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-User config
-
-Creates ~/.config/worktrunk/config.toml with the following content:
-
- # ## Worktrunk User Configuration
- #
- # Create with `wt config create`.
- #
- # Location:
- #
- # - macOS/Linux: `~/.config/worktrunk/config.toml` (or `$XDG_CONFIG_HOME` if set)
- # - Windows: `%APPDATA%\worktrunk\config.toml`
- #
- # ## Worktree path template
- #
- # Controls where new worktrees are created. Paths are relative to the repository root.
- #
- # **Variables:**
- #
- # - `{{ repo }}` — repository directory name
- # - `{{ branch }}` — raw branch name (e.g., `feature/auth`)
- # - `{{ branch | sanitize }}` — filesystem-safe: `/` and `\` become `-` (e.g., `feature-auth`)
- # - `{{ branch | sanitize_db }}` — database-safe: lowercase, underscores, hash suffix (e.g., `feature_auth_x7k`)
- #
- # **Examples** for repo at `~/code/myproject`, branch `feature/auth`:
- #
- # # Default — siblings in parent directory
- # # Creates: ~/code/myproject.feature-auth
- # worktree-path = "../{{ repo }}.{{ branch | sanitize }}"
- #
- # # Inside the repository
- # # Creates: ~/code/myproject/.worktrees/feature-auth
- # worktree-path = ".worktrees/{{ branch | sanitize }}"
- #
- # # Namespaced (useful when multiple repos share a parent directory)
- # # Creates: ~/code/worktrees/myproject/feature-auth
- # worktree-path = "../worktrees/{{ repo }}/{{ branch | sanitize }}"
- #
- # # Nested bare repo (git clone --bare <url> project/.git)
- # # Creates: ~/code/project/feature-auth (sibling to .git)
- # worktree-path = "../{{ branch | sanitize }}"
- #
- # ## LLM commit messages
- #
- # Generate commit messages automatically during merge. Requires an external CLI tool. See LLM commits docs (https://worktrunk.dev/llm-commits/) for setup and template customization.
- #
- # Using llm (https://github.com/simonw/llm) (install: `pip install llm llm-anthropic`):
- #
- # [commit-generation]
- # command = "llm"
- # args = ["-m", "claude-haiku-4.5"]
- #
- # Using aichat (https://github.com/sigoden/aichat):
- #
- # [commit-generation]
- # command = "aichat"
- # args = ["-m", "claude:claude-haiku-4.5"]
- #
- # See Custom prompt templates (#custom-prompt-templates) for inline template options.
- #
- # ## Commands
- #
- # ### List
- #
- # Persistent flag values for `wt list`. Override on command line as needed.
- #
- # [list]
- # full = false # Show CI status and main…± diffstat columns (--full)
- # branches = false # Include branches without worktrees (--branches)
- # remotes = false # Include remote-only branches (--remotes)
- #
- # ### Commit
- #
- # Shared by `wt step commit`, `wt step squash`, and `wt merge`.
- #
- # [commit]
- # stage = "all" # What to stage before commit: "all", "tracked", or "none"
- #
- # ### Merge
- #
- # All flags are on by default. Set to false to change default behavior.
- #
- # [merge]
- # squash = true # Squash commits into one (--no-squash to preserve history)
- # commit = true # Commit uncommitted changes first (--no-commit to skip)
- # rebase = true # Rebase onto target before merge (--no-rebase to skip)
- # remove = true # Remove worktree after merge (--no-remove to keep)
- # verify = true # Run project hooks (--no-verify to skip)
- #
- # ### Select
- #
- # Pager behavior for `wt select` diff previews.
- #
- # [select]
- # # Pager command with flags for diff preview (overrides git's core.pager)
- # # Use this to specify pager flags needed for non-TTY contexts
- # # Example:
- # # pager = "delta --paging=never"
- #
- # ### Per-project settings (Experimental)
- #
- # Per-project settings are keyed by project identifier (e.g., `github.com/user/repo`).
- # These contain approved hook commands plus optional overrides of global settings.
- # Setting overrides (worktree-path, list, commit, merge) are new; approved-commands is stable.
- #
- # [projects."github.com/user/repo"]
- # # Approved hook commands (auto-populated when approving on first run)
- # approved-commands = ["npm ci", "npm test"]
- #
- # # Optional overrides (omit to use global settings)
- # worktree-path = ".worktrees/{{ branch | sanitize }}"
- # list.full = true
- # merge.squash = false
- #
- # For project-specific hooks (post-create, post-start, pre-merge, etc.), use a project config at `<repo>/.config/wt.toml`. Run `wt config create --project` to create one, or see `wt hook` docs (https://worktrunk.dev/hook/).
- #
- # ### Custom prompt templates
- #
- # Templates use minijinja (https://docs.rs/minijinja/) syntax.
- #
- # #### Commit template
- #
- # Available variables:
- #
- # - `{{ git_diff }}`, `{{ git_diff_stat }}` — diff content
- # - `{{ branch }}`, `{{ repo }}` — context
- # - `{{ recent_commits }}` — recent commit messages
- #
- # Default template:
- #
- # <!-- DEFAULT_TEMPLATE_START -->
- # [commit-generation]
- # template = """
- # Write a commit message for the staged changes below.
- #
- # <format>
- # - Subject under 50 chars, blank line, then optional body
- # - Output only the commit message, no quotes or code blocks
- # </format>
- #
- # <style>
- # - Imperative mood: "Add feature" not "Added feature"
- # - Match recent commit style (conventional commits if used)
- # - Describe the change, not the intent or benefit
- # </style>
- #
- # <diffstat>
- # {{ git_diff_stat }}
- # </diffstat>
- #
- # <diff>
- # {{ git_diff }}
- # </diff>
- #
- # <context>
- # Branch: {{ branch }}
- # {% if recent_commits %}<recent_commits>
- # {% for commit in recent_commits %}- {{ commit }}
- # {% endfor %}</recent_commits>{% endif %}
- # </context>
- #
- # """
- # <!-- DEFAULT_TEMPLATE_END -->
- #
- # #### Squash template
- #
- # Available variables (in addition to commit template variables):
- #
- # - `{{ commits }}` — list of commits being squashed
- # - `{{ target_branch }}` — merge target branch
- #
- # Default template:
- #
- # <!-- DEFAULT_SQUASH_TEMPLATE_START -->
- # [commit-generation]
- # squash-template = """
- # Combine these commits into a single commit message.
- #
- # <format>
- # - Subject under 50 chars, blank line, then optional body
- # - Output only the commit message, no quotes or code blocks
- # </format>
- #
- # <style>
- # - Imperative mood: "Add feature" not "Added feature"
- # - Match the style of commits being squashed (conventional commits if used)
- # - Describe the change, not the intent or benefit
- # </style>
- #
- # <commits branch="{{ branch }}" target="{{ target_branch }}">
- # {% for commit in commits %}- {{ commit }}
- # {% endfor %}</commits>
- #
- # <diffstat>
- # {{ git_diff_stat }}
- # </diffstat>
- #
- # <diff>
- # {{ git_diff }}
- # </diff>
- #
- # """
- # <!-- DEFAULT_SQUASH_TEMPLATE_END -->
-
-Project config
-
-With --project, creates .config/wt.toml in the current repository:
-
- # Worktrunk Project Configuration
- # Copy to: <repo>/.config/wt.toml
- #
- # Project-specific hooks that run automatically during worktree operations.
- # Check this file into git to share hooks across all developers.
- 
- # ============================================================================
- # Hook Formats
- # ============================================================================
- # All hooks support two formats:
- #
- # Single command:
- # post-create = "npm install"
- #
- # Named table (multiple commands):
- # [post-create]
- # deps = "npm install"
- # build = "npm run build"
- #
- # Named commands appear in output, making it easier to identify failures.
- 
- # ============================================================================
- # Template Variables — see https://worktrunk.dev/hook/#template-variables
- # ============================================================================
- # Common variables:
- # {{ repo }} - Repository directory name (e.g., "myproject")
- # {{ branch }} - Branch name (e.g., "feature/auth")
- # {{ worktree_path }} - Absolute path to worktree
- # {{ primary_worktree_path }} - Main worktree (or default branch worktree for bare repos)
- # {{ default_branch }} - Default branch name (e.g., "main")
- # {{ target }} - Target branch (merge hooks only)
- #
- # Filters:
- # {{ branch | sanitize }} - Replace / and \ with - (e.g., "feature-auth")
- # {{ branch | sanitize_db }} - Database-safe identifier with hash suffix (e.g., "feature_auth_x7k")
- # {{ branch | hash_port }} - Deterministic port 10000-19999
- 
- # ============================================================================
- # Hooks
- # ============================================================================
- 
- # Post-Create: Runs after worktree creation, BLOCKS until complete
- # Use for: installing dependencies, setting up databases, copying configs
- #
- # [post-create]
- # deps = "npm ci"
- # env = "cp .env.example .env"
- 
- # Post-Start: Runs in BACKGROUND after worktree creation (parallel)
- # Use for: dev servers, file watchers, background builds
- # Output logged to .git/wt-logs/{branch}-project-post-start-{name}.log
- #
- # [post-start]
- # server = "npm run dev -- --port {{ branch | hash_port }}"
- # watch = "npm run watch"
- 
- # Post-Switch: Runs in BACKGROUND after every switch (parallel)
- # Use for: terminal tab naming, tmux window titles, IDE notifications
- #
- # post-switch = "echo -ne '\\033]0;{{ branch }}\\007'"
- 
- # Pre-Commit: Runs before committing during merge, BLOCKS (fail-fast)
- # Use for: formatters, linters, quick checks
- #
- # [pre-commit]
- # format = "npm run format:check"
- # lint = "npm run lint"
- 
- # Pre-Merge: Runs before merging to target, BLOCKS (fail-fast)
- # Use for: tests, build verification
- #
- # [pre-merge]
- # test = "npm test"
- # build = "npm run build"
- 
- # Post-Merge: Runs after successful merge, BLOCKS
- # Use for: deployment, notifications
- #
- # post-merge = "echo 'Merged {{ branch }} to {{ target }}'"
- 
- # Pre-Remove: Runs before worktree removal, BLOCKS (fail-fast)
- # Use for: cleanup, stopping services
- #
- # pre-remove = "docker compose down"
- 
- # ============================================================================
- # Dev Server URL (shown in `wt list`)
- # ============================================================================
- # [list]
- # url = "http://localhost:{{ branch | hash_port }}"
- 
- # ============================================================================
- # CI Platform Override
- # ============================================================================
- # Override CI platform detection for GitHub Enterprise or self-hosted GitLab
- # with custom domains where URL detection fails.
- #
- # [ci]
- # platform = "github" # or "gitlab"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell_init.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell_init.snap
deleted file mode 100644
index 6eb6f10bf..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell_init.snap
+++ /dev/null
@@ -1,69 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - shell
- - init
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config shell init - Generate shell integration code
-
-Usage: wt config shell init [OPTIONS] <bash|fish|zsh|powershell>
-
-Arguments:
- <bash|fish|zsh|powershell>
- Shell to generate code for
-
- [possible values: bash, fish, zsh, powershell]
-
-Options:
- --cmd <CMD>
- Command name for shell integration (defaults to binary name)
-
- Use this to create shell integration for an alternate command name. For example, --cmd=git-wt creates a git-wt shell function instead of wt, useful on Windows where wt conflicts with Windows Terminal.
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Outputs shell code for eval or sourcing. Most users should run wt config shell install instead, which adds this automatically.
-
-Manual setup
-
-Add one line to the shell config:
-
-Bash (~/.bashrc):
- eval "$(wt config shell init bash)"
-
-Fish (~/.config/fish/config.fish):
- wt config shell init fish | source
-
-Zsh (~/.zshrc):
- eval "$(wt config shell init zsh)"
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell_install.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell_install.snap
deleted file mode 100644
index 6f58fdf1f..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell_install.snap
+++ /dev/null
@@ -1,73 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - shell
- - install
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config shell install - Write shell integration to config files
-
-Usage: wt config shell install [OPTIONS] [bash|fish|zsh|powershell]
-
-Arguments:
- [bash|fish|zsh|powershell]
- Shell to install (default: all)
-
- [possible values: bash, fish, zsh, powershell]
-
-Options:
- -y, --yes
- Skip confirmation prompt
-
- --dry-run
- Show what would be changed
-
- --cmd <CMD>
- Command name for shell integration (defaults to binary name)
-
- Use this to create shell integration for an alternate command name. For example, --cmd=git-wt creates a git-wt shell function instead of wt, useful on Windows where wt conflicts with Windows Terminal.
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Detects existing shell config files and adds the integration line.
-
-Examples
-
-Install for all detected shells:
- wt config shell install
-
-Install for specific shell only:
- wt config shell install zsh
-
-Shows proposed changes and waits for confirmation before modifying any files.
-Use --yes to skip confirmation.
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell_show_theme.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell_show_theme.snap
deleted file mode 100644
index 2e970383b..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell_show_theme.snap
+++ /dev/null
@@ -1,51 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - shell
- - show-theme
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config shell show-theme - Show output theme samples
-
-Usage: wt config shell show-theme [OPTIONS]
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Displays samples of all output message types to preview how worktrunk output will appear in the terminal.
-
-Message types
-
-- Progress, success, error, warning, hint, info
-- Gutter formatting for quoted content
-- Prompts for user input
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell_uninstall.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell_uninstall.snap
deleted file mode 100644
index 12166c4d7..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell_uninstall.snap
+++ /dev/null
@@ -1,74 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - shell
- - uninstall
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config shell uninstall - Remove shell integration from config files
-
-Usage: wt config shell uninstall [OPTIONS] [bash|fish|zsh|powershell]
-
-Arguments:
- [bash|fish|zsh|powershell]
- Shell to uninstall (default: all)
-
- [possible values: bash, fish, zsh, powershell]
-
-Options:
- -y, --yes
- Skip confirmation prompt
-
- --dry-run
- Show what would be changed
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Removes shell integration lines from config files.
-
-Examples
-
-Uninstall from all shells:
- wt config shell uninstall
-
-Uninstall from specific shell only:
- wt config shell uninstall zsh
-
-Skip confirmation prompt:
- wt config shell uninstall --yes
-
-Version tolerance
-
-Detects various forms of the integration pattern regardless of:
-- Command prefix (wt, worktree, etc.)
-- Minor syntax variations between versions
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status_clear.snap
deleted file mode 100644
index a30e3e939..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status_clear.snap
+++ /dev/null
@@ -1,61 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - ci-status
- - clear
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state ci-status clear - Clear CI status cache
-
-Usage: wt config state ci-status clear [OPTIONS]
-
-Options:
- --branch <BRANCH>
- Target branch (defaults to current)
-
- --all
- Clear all CI status cache
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Clear CI status for current branch:
- wt config state ci-status clear
-
-Clear CI status for a specific branch:
- wt config state ci-status clear --branch=feature
-
-Clear all CI status cache:
- wt config state ci-status clear --all
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status_get.snap
deleted file mode 100644
index b01b3c3f2..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status_get.snap
+++ /dev/null
@@ -1,60 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - ci-status
- - get
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state ci-status get - Get CI status for a branch
-
-Usage: wt config state ci-status get [OPTIONS]
-
-Options:
- --branch <BRANCH>
- Target branch (defaults to current)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Returns: passed, running, failed, conflicts, no-ci, or error.
-
-Examples
-
-Get CI status for current branch:
- wt config state ci-status
-
-Get CI status for a specific branch:
- wt config state ci-status get --branch=feature
-
-Clear cache and re-fetch:
- wt config state ci-status clear && wt config state ci-status get
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_clear.snap
deleted file mode 100644
index 27b0dcd3a..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_clear.snap
+++ /dev/null
@@ -1,38 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - default-branch
- - clear
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state default-branch clear - Clear the default branch cache
-
-Usage: wt config state default-branch clear [OPTIONS]
-
-Options:
- -h, --help Print help
-
-Global Options:
- -C <path> Working directory for this command
- --config <path> User config file path
- -v, --verbose... Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_get.snap
deleted file mode 100644
index fbf1ff0cc..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_get.snap
+++ /dev/null
@@ -1,52 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - default-branch
- - get
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state default-branch get - Get the default branch
-
-Usage: wt config state default-branch get [OPTIONS]
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Get the default branch:
- wt config state default-branch
-
-Clear cache and re-detect:
- wt config state default-branch clear && wt config state default-branch get
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_set.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_set.snap
deleted file mode 100644
index b461ce0d0..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch_set.snap
+++ /dev/null
@@ -1,53 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - default-branch
- - set
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state default-branch set - Set the default branch
-
-Usage: wt config state default-branch set [OPTIONS] <BRANCH>
-
-Arguments:
- <BRANCH>
- Branch name to set as default
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Set the default branch:
- wt config state default-branch set main
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_hints.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_hints.snap
deleted file mode 100644
index 70c379fb9..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_hints.snap
+++ /dev/null
@@ -1,62 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - hints
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state hints - One-time hints shown in this repo
-
-Usage: wt config state hints [OPTIONS] [COMMAND]
-
-Commands:
- get List hints that have been shown
- clear Clear hints (re-show on next trigger)
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Some hints show once per repo on first use, then are recorded in git config
-as worktrunk.hints.<name> = true.
-
-Current hints
-
- Name Trigger Message
- ───────────── ──────────────────────── ──────────────────────────────────────────────
- worktree-path First wt switch --create Customize worktree locations: wt config create
-
-Examples
-
- wt config state hints # list shown hints
- wt config state hints clear # re-show all hints
- wt config state hints clear NAME # re-show specific hint
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_hints_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_hints_clear.snap
deleted file mode 100644
index 1da5ea7d7..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_hints_clear.snap
+++ /dev/null
@@ -1,58 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - hints
- - clear
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state hints clear - Clear hints (re-show on next trigger)
-
-Usage: wt config state hints clear [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Specific hint to clear (clears all if not specified)
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Clears hint state so hints will show again on next trigger.
-
-Examples
-
-Clear all hints:
- wt config state hints clear
-
-Clear a specific hint:
- wt config state hints clear worktree-path
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_hints_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_hints_get.snap
deleted file mode 100644
index 322ccaa92..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_hints_get.snap
+++ /dev/null
@@ -1,51 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - hints
- - get
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state hints get - List hints that have been shown
-
-Usage: wt config state hints get [OPTIONS]
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Lists which one-time hints have been shown in this repository.
-
-Examples
-
-List shown hints:
- wt config state hints
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_logs_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_logs_clear.snap
deleted file mode 100644
index 9b5b3b5d9..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_logs_clear.snap
+++ /dev/null
@@ -1,38 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - logs
- - clear
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state logs clear - Clear background operation logs
-
-Usage: wt config state logs clear [OPTIONS]
-
-Options:
- -h, --help Print help
-
-Global Options:
- -C <path> Working directory for this command
- --config <path> User config file path
- -v, --verbose... Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_logs_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_logs_get.snap
deleted file mode 100644
index f8d8bbcef..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_logs_get.snap
+++ /dev/null
@@ -1,51 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - logs
- - get
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state logs get - List background operation log files
-
-Usage: wt config state logs get [OPTIONS]
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Lists log files from background operations like post-start commands and worktree removal.
-
-Examples
-
-List log files:
- wt config state logs
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_marker_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_marker_clear.snap
deleted file mode 100644
index be50c1bc2..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_marker_clear.snap
+++ /dev/null
@@ -1,61 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - marker
- - clear
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state marker clear - Clear marker for a branch
-
-Usage: wt config state marker clear [OPTIONS]
-
-Options:
- --branch <BRANCH>
- Target branch (defaults to current)
-
- --all
- Clear all markers
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Clear marker for current branch:
- wt config state marker clear
-
-Clear marker for a specific branch:
- wt config state marker clear --branch=feature
-
-Clear all markers:
- wt config state marker clear --all
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_marker_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_marker_get.snap
deleted file mode 100644
index 4a970a90c..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_marker_get.snap
+++ /dev/null
@@ -1,55 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - marker
- - get
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state marker get - Get marker for a branch
-
-Usage: wt config state marker get [OPTIONS]
-
-Options:
- --branch <BRANCH>
- Target branch (defaults to current)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Get marker for current branch:
- wt config state marker
-
-Get marker for a specific branch:
- wt config state marker get --branch=feature
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_marker_set.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_marker_set.snap
deleted file mode 100644
index 8651d7cc2..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_marker_set.snap
+++ /dev/null
@@ -1,59 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - marker
- - set
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state marker set - Set marker for a branch
-
-Usage: wt config state marker set [OPTIONS] <VALUE>
-
-Arguments:
- <VALUE>
- Marker text (shown in wt list output)
-
-Options:
- --branch <BRANCH>
- Target branch (defaults to current)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Set marker for current branch:
- wt config state marker set "🚧 WIP"
-
-Set marker for a specific branch:
- wt config state marker set "✅ ready" --branch=feature
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_clear.snap
deleted file mode 100644
index d7d76fb80..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_clear.snap
+++ /dev/null
@@ -1,38 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - previous-branch
- - clear
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state previous-branch clear - Clear the previous branch
-
-Usage: wt config state previous-branch clear [OPTIONS]
-
-Options:
- -h, --help Print help
-
-Global Options:
- -C <path> Working directory for this command
- --config <path> User config file path
- -v, --verbose... Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_get.snap
deleted file mode 100644
index e933ef89f..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_get.snap
+++ /dev/null
@@ -1,49 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - previous-branch
- - get
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state previous-branch get - Get the previous branch
-
-Usage: wt config state previous-branch get [OPTIONS]
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Get the previous branch (used by wt switch -):
- wt config state previous-branch
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_set.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_set.snap
deleted file mode 100644
index 109a01b74..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch_set.snap
+++ /dev/null
@@ -1,53 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - config
- - state
- - previous-branch
- - set
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt config state previous-branch set - Set the previous branch
-
-Usage: wt config state previous-branch set [OPTIONS] <BRANCH>
-
-Arguments:
- <BRANCH>
- Branch name to set as previous
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Set the previous branch:
- wt config state previous-branch set feature
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook.snap b/tests/snapshots/integration__integration_tests__help__help_hook.snap
deleted file mode 100644
index 9b62a8801..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook.snap
+++ /dev/null
@@ -1,416 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook - Run configured hooks
-
-Usage: wt hook [OPTIONS] <COMMAND>
-
-Commands:
- show Show configured hooks
- post-create Run post-create hooks
- post-start Run post-start hooks
- post-switch Run post-switch hooks
- pre-commit Run pre-commit hooks
- pre-merge Run pre-merge hooks
- post-merge Run post-merge hooks
- pre-remove Run pre-remove hooks
- post-remove Run post-remove hooks
- approvals Manage command approvals
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Hooks are shell commands that run at key points in the worktree lifecycle — automatically during wt switch, wt merge, & wt remove, or on demand via wt hook <type>. Both user (~/.config/worktrunk/config.toml) and project (.config/wt.toml) hooks are supported.
-
-Hook types
-
- Hook When Blocking Fail-fast
- ─────────── ────────────────────────── ─────────────── ─────────
- post-start After worktree created No (background) No
- post-create After worktree created Yes No
- post-switch After every switch No (background) No
- pre-commit Before commit during merge Yes Yes
- pre-merge Before merging to target Yes Yes
- post-merge After successful merge Yes No
- pre-remove Before worktree removed Yes Yes
- post-remove After worktree removed No (background) No
-
-Blocking: Command waits for hook to complete before continuing.
-Fail-fast: First failure aborts the operation.
-
-Background hooks show a single-line summary by default. Use -v to see expanded command details.
-
-post-start
-
-Dev servers, long builds, file watchers, copying caches. Output logged to .git/wt-logs/{branch}-{source}-post-start-{name}.log.
-
- [post-start]
- copy = "wt step copy-ignored"
- server = "npm run dev -- --port {{ branch | hash_port }}"
-
-post-create
-
-Tasks that must complete before post-start hooks or --execute run: dependency installation, environment file generation.
-
- [post-create]
- install = "npm ci"
- env = "echo 'PORT={{ branch | hash_port }}' > .env.local"
-
-post-switch
-
-Triggers on all switch results: creating new worktrees, switching to existing ones, or staying on current. Output logged to .git/wt-logs/{branch}-{source}-post-switch-{name}.log.
-
- [post-switch]
- tmux = "[ -n \"$TMUX\" ] && tmux rename-window '{{ branch | sanitize }}'"
-
-pre-commit
-
-Formatters, linters, type checking — runs during wt merge before the squash commit.
-
- [pre-commit]
- format = "cargo fmt -- --check"
- lint = "cargo clippy -- -D warnings"
-
-pre-merge
-
-Tests, security scans, build verification — runs after rebase, before merge to target.
-
- [pre-merge]
- test = "cargo test"
- build = "cargo build --release"
-
-post-merge
-
-Deployment, notifications, installing updated binaries. Runs in the target branch worktree if it exists, otherwise the main worktree.
-
- post-merge = "cargo install --path ."
-
-pre-remove
-
-Cleanup tasks before worktree is deleted, saving test artifacts, backing up state. Runs in the worktree being removed, with access to worktree files.
-
- [pre-remove]
- archive = "tar -czf ~/.wt-logs/{{ branch }}.tar.gz test-results/ logs/ 2>/dev/null || true"
-
-post-remove
-
-Cleanup tasks after worktree removal: stopping dev servers, removing containers, notifying external systems. All template variables reference the removed worktree, so cleanup scripts can identify resources to clean up. Output logged to .git/wt-logs/{branch}-{source}-post-remove-{name}.log.
-
- [post-remove]
- kill-server = "lsof -ti :{{ branch | hash_port }} | xargs kill 2>/dev/null || true"
- remove-db = "docker stop {{ repo }}-{{ branch | sanitize }}-postgres 2>/dev/null || true"
-
-During wt merge, hooks run in this order: pre-commit → pre-merge → pre-remove → post-remove → post-merge. See wt merge for the complete pipeline.
-
-Security
-
-Project commands require approval on first run:
-
- ▲ repo needs approval to execute 3 commands:
- 
- ○ post-create install:
-  echo 'Installing dependencies...'
- 
- ❯ Allow and remember? [y/N]
-
-- Approvals are saved to user config (~/.config/worktrunk/config.toml)
-- If a command changes, new approval is required
-- Use --yes to bypass prompts (useful for CI/automation)
-- Use --no-verify to skip hooks
-
-Manage approvals with wt hook approvals add and wt hook approvals clear.
-
-Configuration
-
-Hooks can be defined in two places: project config (.config/wt.toml) for repository-specific automation, or user config (~/.config/worktrunk/config.toml) for personal automation across all repositories.
-
-Project hooks
-
-Project hooks are defined in .config/wt.toml. They can be a single command or multiple named commands:
-
- # Single command (string)
- post-create = "npm install"
- 
- # Multiple commands (table) — run sequentially in declaration order
- [pre-merge]
- test = "cargo test"
- build = "cargo build --release"
-
-User hooks
-
-Define hooks in ~/.config/worktrunk/config.toml to run for all repositories. User hooks run before project hooks and don't require approval.
-
- # ~/.config/worktrunk/config.toml
- [post-create]
- setup = "echo 'Setting up worktree...'"
- 
- [pre-merge]
- notify = "notify-send 'Merging {{ branch }}'"
-
-User hooks support the same hook types and template variables as project hooks.
-
-Key differences from project hooks:
-
- Aspect Project hooks User hooks
- ─────────────── ───────────────── ───────────────────────────────
- Location .config/wt.toml ~/.config/worktrunk/config.toml
- Scope Single repository All repositories
- Approval Required Not required
- Execution order After user hooks Before project hooks
-
-Skip hooks with --no-verify. To run a specific hook when user and project both define the same name, use user:name or project:name syntax.
-
-Use cases:
-- Personal notifications or logging
-- Editor/IDE integration
-- Repository-agnostic setup tasks
-- Filtering by repository using JSON context
-
-Filtering by repository:
-
-User hooks receive JSON context on stdin, enabling repository-specific behavior:
-
- # ~/.config/worktrunk/config.toml
- [post-create]
- gitlab-setup = """
- python3 -c '
- import json, sys, subprocess
- ctx = json.load(sys.stdin)
- if "gitlab" in ctx.get("remote", ""):
-  subprocess.run(["glab", "mr", "create", "--fill"])
- '
- """
-
-Template variables
-
-Hooks can use template variables that expand at runtime:
-
- Variable Description
- ─────────────────────────── ────────────────────────────────────────────────────────────
- {{ repo }} Repository directory name
- {{ repo_path }} Absolute path to repository root
- {{ branch }} Branch name
- {{ worktree_name }} Worktree directory name
- {{ worktree_path }} Absolute worktree path
- {{ primary_worktree_path }} Main worktree path (for bare repos: default branch worktree)
- {{ default_branch }} Default branch name
- {{ commit }} Full HEAD commit SHA
- {{ short_commit }} Short HEAD commit SHA (7 chars)
- {{ remote }} Primary remote name
- {{ remote_url }} Remote URL
- {{ upstream }} Upstream tracking branch (if set)
- {{ target }} Target branch (merge hooks only)
- {{ base }} Base branch (creation hooks only)
- {{ base_worktree_path }} Base branch worktree (creation hooks only)
-
-Some variables may not be defined: upstream is only set when the branch tracks a remote; target, base, and base_worktree_path are hook-specific. Using an undefined variable directly errors — use conditionals for optional behavior:
-
- [post-create]
- # Rebase onto upstream if tracking a remote branch (e.g., wt switch --create feature origin/feature)
- sync = "{% if upstream %}git fetch && git rebase {{ upstream }}{% endif %}"
-
-Worktrunk filters
-
-Templates support Jinja2 filters for transforming values:
-
- Filter Example Description
- ─────────── ────────────────────────── ───────────────────────────────────────────────────────────────────
- sanitize {{ branch | sanitize }} Replace / and \ with -
- sanitize_db {{ branch | sanitize_db }} Database-safe identifier with hash suffix ([a-z0-9_], max 63 chars)
- hash_port {{ branch | hash_port }} Hash to port 10000-19999
-
-The sanitize filter makes branch names safe for filesystem paths. The sanitize_db filter produces database-safe identifiers (lowercase alphanumeric and underscores, no leading digits, with a 3-character hash suffix to avoid collisions and reserved words). The hash_port filter is useful for running dev servers on unique ports per worktree:
-
- [post-start]
- dev = "npm run dev -- --host {{ branch }}.lvh.me --port {{ branch | hash_port }}"
-
-Hash any string, including concatenations:
-
- # Unique port per repo+branch combination
- dev = "npm run dev --port {{ (repo ~ '-' ~ branch) | hash_port }}"
-
-Worktrunk functions
-
-Templates also support functions for dynamic lookups:
-
- Function Example Description
- ─────────────────────────────── ───────────────────────────────────── ───────────────────────────────────────
- worktree_path_of_branch(branch) {{ worktree_path_of_branch("main") }} Look up the path of a branch's worktree
-
-The worktree_path_of_branch function returns the filesystem path of a worktree given a branch name, or an empty string if no worktree exists for that branch. This is useful for referencing files in other worktrees:
-
- [post-create]
- # Copy config from main worktree
- setup = "cp {{ worktree_path_of_branch('main') }}/config.local {{ worktree_path }}"
-
-JSON context
-
-Hooks also receive context as JSON on stdin, enabling hooks in any language:
-
- import json, sys
- ctx = json.load(sys.stdin)
- print(f"Setting up {ctx['repo']} on branch {ctx['branch']}")
-
-The JSON includes all template variables plus hook_type and hook_name.
-
-Running hooks manually
-
-wt hook <type> runs hooks on demand — useful for testing during development, running in CI pipelines, or re-running after a failure.
-
- wt hook pre-merge # Run all pre-merge hooks
- wt hook pre-merge test # Run hooks named "test" from both sources
- wt hook pre-merge user: # Run all user hooks
- wt hook pre-merge project: # Run all project hooks
- wt hook pre-merge user:test # Run only user's "test" hook
- wt hook pre-merge project:test # Run only project's "test" hook
- wt hook pre-merge --yes # Skip approval prompts (for CI)
- wt hook post-create --var branch=feature/test # Override template variable
-
-The user: and project: prefixes filter by source. Use user: or project: alone to run all hooks from that source, or user:name / project:name to run a specific hook.
-
-The --var KEY=VALUE flag overrides built-in template variables — useful for testing hooks with different contexts without switching to that context.
-
-Designing effective hooks
-
-post-start vs post-create
-
-Both run when creating a worktree. The difference:
-
- Hook Execution Best for
- ─────────── ───────────────────── ─────────────────────────────────────────────────────────────
- post-start Background, parallel Long-running tasks that don't block worktree creation
- post-create Blocks until complete Tasks the developer needs before working (dependency install)
-
-Many tasks work well in post-start — they'll likely be ready by the time they're needed, especially when the fallback is recompiling. If unsure, prefer post-start for faster worktree creation.
-
-Background processes spawned by post-start outlive the worktree — pair them with post-remove hooks to clean up. See Dev servers and Databases for examples.
-
-Copying untracked files
-
-Git worktrees share the repository but not untracked files. wt step copy-ignored copies gitignored files between worktrees:
-
- [post-start]
- copy = "wt step copy-ignored"
-
-Use post-create instead if subsequent hooks or --execute command need the copied files immediately.
-
-Dev servers
-
-Run a dev server per worktree on a deterministic port using hash_port:
-
- [post-start]
- server = "npm run dev -- --port {{ branch | hash_port }}"
- 
- [post-remove]
- server = "lsof -ti :{{ branch | hash_port }} | xargs kill 2>/dev/null || true"
-
-The port is stable across machines and restarts — feature-api always gets the same port. Show it in wt list:
-
- [list]
- url = "http://localhost:{{ branch | hash_port }}"
-
-For subdomain-based routing (useful for cookies/CORS), use lvh.me which resolves to 127.0.0.1:
-
- [post-start]
- server = "npm run dev -- --host {{ branch | sanitize }}.lvh.me --port {{ branch | hash_port }}"
-
-Databases
-
-Each worktree can have its own database. Docker containers get unique names and ports:
-
- [post-start]
- db = """
- docker run -d --rm \
-  --name {{ repo }}-{{ branch | sanitize }}-postgres \
-  -p {{ ('db-' ~ branch) | hash_port }}:5432 \
-  -e POSTGRES_DB={{ branch | sanitize_db }} \
-  -e POSTGRES_PASSWORD=dev \
-  postgres:16
- """
- 
- [post-remove]
- db-stop = "docker stop {{ repo }}-{{ branch | sanitize }}-postgres 2>/dev/null || true"
-
-The ('db-' ~ branch) concatenation hashes differently than plain branch, so database and dev server ports don't collide.
-Jinja2's operator precedence has pipe | with higher precedence than concatenation ~, meaning expressions need parentheses to filter concatenated values.
-
-Generate .env.local with the connection string:
-
- [post-create]
- env = """
- cat > .env.local << EOF
- DATABASE_URL=postgres://postgres:dev@localhost:{{ ('db-' ~ branch) | hash_port }}/{{ branch | sanitize_db }}
- DEV_PORT={{ branch | hash_port }}
- EOF
- """
-
-Progressive validation
-
-Quick checks before commit, thorough validation before merge:
-
- [pre-commit]
- lint = "npm run lint"
- typecheck = "npm run typecheck"
- 
- [pre-merge]
- test = "npm test"
- build = "npm run build"
-
-Target-specific behavior
-
-Different actions for production vs staging:
-
- post-merge = """
- if [ "{{ target }}" = "main" ]; then
-  npm run deploy:production
- elif [ "{{ target }}" = "staging" ]; then
-  npm run deploy:staging
- fi
- """
-
-Python virtual environments
-
-Use uv sync to recreate virtual environments (or python -m venv .venv && .venv/bin/pip install -r requirements.txt for pip-based projects):
-
- [post-create]
- install = "uv sync"
-
-For copying dependencies and caches between worktrees, see wt step copy-ignored.
-
-See also
-
-- wt merge — Runs hooks automatically during merge
-- wt switch — Runs post-create/post-start hooks on --create
-- wt config — Manage hook approvals
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_post_create.snap b/tests/snapshots/integration__integration_tests__help__help_hook_post_create.snap
deleted file mode 100644
index b91e5fa0c..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_post_create.snap
+++ /dev/null
@@ -1,56 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - post-create
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook post-create - Run post-create hooks
-
-Blocking — waits for completion before continuing.
-
-Usage: wt hook post-create [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_post_merge.snap b/tests/snapshots/integration__integration_tests__help__help_hook_post_merge.snap
deleted file mode 100644
index 966be76f4..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_post_merge.snap
+++ /dev/null
@@ -1,54 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - post-merge
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook post-merge - Run post-merge hooks
-
-Usage: wt hook post-merge [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_post_remove.snap b/tests/snapshots/integration__integration_tests__help__help_hook_post_remove.snap
deleted file mode 100644
index 90c4a75ea..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_post_remove.snap
+++ /dev/null
@@ -1,59 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - post-remove
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook post-remove - Run post-remove hooks
-
-Background by default. Use --foreground to run in foreground for debugging.
-
-Usage: wt hook post-remove [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --foreground
- Run in foreground (block until complete)
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_post_start.snap b/tests/snapshots/integration__integration_tests__help__help_hook_post_start.snap
deleted file mode 100644
index 92ce03c9a..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_post_start.snap
+++ /dev/null
@@ -1,59 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - post-start
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook post-start - Run post-start hooks
-
-Background by default. Use --foreground to run in foreground for debugging.
-
-Usage: wt hook post-start [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --foreground
- Run in foreground (block until complete)
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_post_switch.snap b/tests/snapshots/integration__integration_tests__help__help_hook_post_switch.snap
deleted file mode 100644
index 9c6d631ce..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_post_switch.snap
+++ /dev/null
@@ -1,59 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - post-switch
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook post-switch - Run post-switch hooks
-
-Background by default. Use --foreground to run in foreground for debugging.
-
-Usage: wt hook post-switch [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --foreground
- Run in foreground (block until complete)
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_pre_commit.snap b/tests/snapshots/integration__integration_tests__help__help_hook_pre_commit.snap
deleted file mode 100644
index 1400de1a4..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_pre_commit.snap
+++ /dev/null
@@ -1,54 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - pre-commit
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook pre-commit - Run pre-commit hooks
-
-Usage: wt hook pre-commit [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_pre_merge.snap b/tests/snapshots/integration__integration_tests__help__help_hook_pre_merge.snap
deleted file mode 100644
index f0cb9eb9b..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_pre_merge.snap
+++ /dev/null
@@ -1,54 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - pre-merge
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook pre-merge - Run pre-merge hooks
-
-Usage: wt hook pre-merge [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_pre_remove.snap b/tests/snapshots/integration__integration_tests__help__help_hook_pre_remove.snap
deleted file mode 100644
index 1634b7762..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_pre_remove.snap
+++ /dev/null
@@ -1,54 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - pre-remove
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook pre-remove - Run pre-remove hooks
-
-Usage: wt hook pre-remove [OPTIONS] [NAME]
-
-Arguments:
- [NAME]
- Filter by command name
-
- Supports user:name or project:name to filter by source. user: alone runs all user hooks; project: alone runs all project hooks.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --var <KEY=VALUE>
- Override built-in template variable (KEY=VALUE)
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_short.snap b/tests/snapshots/integration__integration_tests__help__help_hook_short.snap
deleted file mode 100644
index 7f0780584..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_short.snap
+++ /dev/null
@@ -1,47 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - "-h"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook - Run configured hooks
-
-Usage: wt hook [OPTIONS] <COMMAND>
-
-Commands:
- show Show configured hooks
- post-create Run post-create hooks
- post-start Run post-start hooks
- post-switch Run post-switch hooks
- pre-commit Run pre-commit hooks
- pre-merge Run pre-merge hooks
- post-merge Run post-merge hooks
- pre-remove Run pre-remove hooks
- post-remove Run post-remove hooks
- approvals Manage command approvals
-
-Options:
- -h, --help Print help (see more with '--help')
-
-Global Options:
- -C <path> Working directory for this command
- --config <path> User config file path
- -v, --verbose... Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_show.snap b/tests/snapshots/integration__integration_tests__help__help_hook_show.snap
deleted file mode 100644
index 49705296b..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_hook_show.snap
+++ /dev/null
@@ -1,53 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - hook
- - show
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt hook show - Show configured hooks
-
-Lists user and project hooks. Project hooks show approval status (❓ = needs approval).
-
-Usage: wt hook show [OPTIONS] [HOOK_TYPE]
-
-Arguments:
- [HOOK_TYPE]
- Hook type to show (default: all)
-
- [possible values: post-create, post-start, post-switch, pre-commit, pre-merge, post-merge, pre-remove, post-remove]
-
-Options:
- --expanded
- Show expanded commands with current variables
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_list.snap b/tests/snapshots/integration__integration_tests__help__help_list.snap
deleted file mode 100644
index 0b35b11b3..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_list.snap
+++ /dev/null
@@ -1,282 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - list
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt list - List worktrees and their status
-
-Usage: wt list [OPTIONS]
- wt list <COMMAND>
-
-Commands:
- statusline Single-line status for shell prompts
-
-Options:
- --format <FORMAT>
- Output format (table, json)
-
- [default: table]
-
- --branches
- Include branches without worktrees
-
- --remotes
- Include remote branches
-
- --full
- Include CI status and diff analysis (slower)
-
- --progressive
- Show fast info immediately, update with slow info
-
- Displays local data (branches, paths, status) first, then updates with remote data (CI, upstream) as it arrives. Auto-enabled for TTY.
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Shows uncommitted changes, divergence from the default branch and remote, and optional CI status.
-
-
-The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as background git operations complete. With --full, CI status fetches from the network — the table displays instantly and CI fills in as results arrive.
-
-Examples
-
-List all worktrees:
-
- $ wt list
-
-Include CI status and line diffs:
-
- $ wt list --full
-
-Include branches that don't have worktrees:
-
- $ wt list --branches --full
-
-Output as JSON for scripting:
-
- $ wt list --format=json
-
-Columns
-
- Column Shows
- ─────── ─────────────────────────────────────────────────────────────────
- Branch Branch name
- Status Compact symbols (see below)
- HEAD± Uncommitted changes: +added -deleted lines
- main↕ Commits ahead/behind default branch
- main…± Line diffs since the merge-base with the default branch (--full)
- Path Worktree directory
- Remote⇅ Commits ahead/behind tracking branch
- URL Dev server URL from project config (dimmed if port not listening)
- CI Pipeline status (--full)
- Commit Short hash (8 chars)
- Age Time since last commit
- Message Last commit message (truncated)
-
-Note: main↕ and main…± refer to the default branch (header label stays main for compactness). main…± uses a merge-base (three-dot) diff.
-
-CI status
-
-The CI column shows GitHub/GitLab pipeline status:
-
- Indicator Meaning
- ───────── ─────────────────────────────────
- ● green All checks passed
- ● blue Checks running
- ● red Checks failed
- ● yellow Merge conflicts with base
- ● gray No checks configured
- ⚠ yellow Fetch error (rate limit, network)
- (blank) No upstream or no PR/MR
-
-CI indicators are clickable links to the PR or pipeline page. Any CI dot appears dimmed when there are unpushed local changes (stale status). PRs/MRs are checked first, then branch workflows/pipelines for branches with an upstream. Local-only branches show blank. Results are cached for 30-60 seconds; use wt config state to view or clear.
-
-Status symbols
-
-The Status column has multiple subcolumns. Within each, only the first matching symbol is shown (listed in priority order):
-
- Subcolumn Symbol Meaning
- ──────────────── ────── ──────────────────────────────────────────────────────────────────────────────────────────
- Working tree (1) + Staged files
- Working tree (2) ! Modified files (unstaged)
- Working tree (3) ? Untracked files
- Worktree ✘ Merge conflicts
- ⤴ Rebase in progress
- ⤵ Merge in progress
- / Branch without worktree
- ⚑ Branch-worktree mismatch (branch name doesn't match worktree path)
- ⊟ Prunable (directory missing)
- ⊞ Locked worktree
- Default branch ^ Is the default branch
- ∅ Orphan branch (no common ancestor with the default branch)
- ✗ Would conflict if merged to the default branch (with --full, includes uncommitted changes)
- _ Same commit as the default branch, clean
- – Same commit as the default branch, uncommitted changes
- ⊂ Content integrated into the default branch or target
- ↕ Diverged from the default branch
- ↑ Ahead of the default branch
- ↓ Behind the default branch
- Remote | In sync with remote
- ⇅ Diverged from remote
- ⇡ Ahead of remote
- ⇣ Behind remote
-
-Rows are dimmed when safe to delete (_ same commit with clean working tree or ⊂ content integrated).
-
-────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-
-JSON output
-
-Query structured data with --format=json:
-
- # Current worktree path (for scripts)
- wt list --format=json | jq -r '.[] | select(.is_current) | .path'
- 
- # Branches with uncommitted changes
- wt list --format=json | jq '.[] | select(.working_tree.modified)'
- 
- # Worktrees with merge conflicts
- wt list --format=json | jq '.[] | select(.operation_state == "conflicts")'
- 
- # Branches ahead of main (needs merging)
- wt list --format=json | jq '.[] | select(.main.ahead > 0) | .branch'
- 
- # Integrated branches (safe to remove)
- wt list --format=json | jq '.[] | select(.main_state == "integrated" or .main_state == "empty") | .branch'
- 
- # Branches without worktrees
- wt list --format=json --branches | jq '.[] | select(.kind == "branch") | .branch'
- 
- # Worktrees ahead of remote (needs pushing)
- wt list --format=json | jq '.[] | select(.remote.ahead > 0) | {branch, ahead: .remote.ahead}'
- 
- # Stale CI (local changes not reflected in CI)
- wt list --format=json --full | jq '.[] | select(.ci.stale) | .branch'
-
-Fields:
-
- Field Type Description
- ────────────────── ─────────── ───────────────────────────────────────────────────────────────────
- branch string/null Branch name (null for detached HEAD)
- path string Worktree path (absent for branches without worktrees)
- kind string "worktree" or "branch"
- commit object Commit info (see below)
- working_tree object Working tree state (see below)
- main_state string Relation to the default branch (see below)
- integration_reason string Why branch is integrated (see below)
- operation_state string "conflicts", "rebase", or "merge" (absent when clean)
- main object Relationship to the default branch (see below, absent when is_main)
- remote object Tracking branch info (see below, absent when no tracking)
- worktree object Worktree metadata (see below)
- is_main boolean Is the main worktree
- is_current boolean Is the current worktree
- is_previous boolean Previous worktree from wt switch
- ci object CI status (see below, absent when no CI)
- url string Dev server URL from project config (absent when not configured)
- url_active boolean Whether the URL's port is listening (absent when not configured)
- statusline string Pre-formatted status with ANSI colors
- symbols string Raw status symbols without colors (e.g., "!?↓")
-
-Commit object
-
- Field Type Description
- ───────── ────── ───────────────────────────
- sha string Full commit SHA (40 chars)
- short_sha string Short commit SHA (7 chars)
- message string Commit message (first line)
- timestamp number Unix timestamp
-
-working_tree object
-
- Field Type Description
- ───────── ─────── ───────────────────────────────────────
- staged boolean Has staged files
- modified boolean Has modified files (unstaged)
- untracked boolean Has untracked files
- renamed boolean Has renamed files
- deleted boolean Has deleted files
- diff object Lines changed vs HEAD: {added, deleted}
-
-main object
-
- Field Type Description
- ────── ────── ─────────────────────────────────────────────────────
- ahead number Commits ahead of the default branch
- behind number Commits behind the default branch
- diff object Lines changed vs the default branch: {added, deleted}
-
-remote object
-
- Field Type Description
- ────── ────── ────────────────────────────
- name string Remote name (e.g., "origin")
- branch string Remote branch name
- ahead number Commits ahead of remote
- behind number Commits behind remote
-
-worktree object
-
- Field Type Description
- ──────── ─────── ────────────────────────────────────────────────────────────────────────────────────
- state string "no_worktree", "branch_worktree_mismatch", "prunable", "locked" (absent when normal)
- reason string Reason for locked/prunable state
- detached boolean HEAD is detached
-
-ci object
-
- Field Type Description
- ────── ─────── ─────────────────────────────────────────────────
- status string CI status (see below)
- source string "pr" (PR/MR) or "branch" (branch workflow)
- stale boolean Local HEAD differs from remote (unpushed changes)
- url string URL to the PR/MR page
-
-main_state values
-
-These values describe the relation to the default branch.
-
-"is_main" "orphan" "would_conflict" "empty" "same_commit" "integrated" "diverged" "ahead" "behind"
-
-integration_reason values
-
-When main_state == "integrated": "ancestor" "trees_match" "no_added_changes" "merge_adds_nothing"
-
-ci.status values
-
-"passed" "running" "failed" "conflicts" "no-ci" "error"
-
-Missing a field that would be generally useful? Open an issue at https://github.com/max-sixty/worktrunk.
-
-See also
-
-- wt select — Interactive worktree picker with live preview
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_statusline.snap b/tests/snapshots/integration__integration_tests__help__help_list_statusline.snap
deleted file mode 100644
index b2bff226c..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_list_statusline.snap
+++ /dev/null
@@ -1,51 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - list
- - statusline
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt list statusline - Single-line status for shell prompts
-
-For shell prompts, starship, or editor integrations.
-
-Usage: wt list statusline [OPTIONS]
-
-Options:
- --claude-code
- Claude Code mode: read context from stdin, add directory and model
-
- Reads JSON from stdin with .workspace.current_dir and .model.display_name. Output: dir branch status ±working commits upstream ci | model
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Format: branch status ±working commits upstream ci
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge.snap b/tests/snapshots/integration__integration_tests__help__help_merge.snap
deleted file mode 100644
index 3e3d0d43f..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_merge.snap
+++ /dev/null
@@ -1,132 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - merge
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt merge - Merge current branch into target
-
-Squash & rebase, fast-forward target, remove the worktree.
-
-Usage: wt merge [OPTIONS] [TARGET]
-
-Arguments:
- [TARGET]
- Target branch
-
- Defaults to default branch.
-
-Options:
- --no-squash
- Skip commit squashing
-
- --no-commit
- Skip commit and squash
-
- --no-rebase
- Skip rebase (fail if not already rebased)
-
- --no-remove
- Keep worktree after merge
-
- --no-verify
- Skip hooks
-
- -y, --yes
- Skip approval prompts
-
- --stage <STAGE>
- What to stage before committing [default: all]
-
- Possible values:
- - all: Stage everything: untracked files + unstaged tracked changes
- - tracked: Stage tracked changes only (like git add -u)
- - none: Stage nothing, commit only what's already in the index
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Unlike git merge, this merges current into target (not target into current). Similar to clicking "Merge pull request" on GitHub, but locally. Target defaults to the default branch.
-
-
-Examples
-
-Merge to the default branch:
-
- wt merge
-
-Merge to a different branch:
-
- wt merge develop
-
-Keep the worktree after merging:
-
- wt merge --no-remove
-
-Preserve commit history (no squash):
-
- wt merge --no-squash
-
-Skip committing/squashing (rebase still runs unless --no-rebase):
-
- wt merge --no-commit
-
-Pipeline
-
-wt merge runs these steps:
-
-1. Squash — Stages uncommitted changes, then combines all commits since target into one (like GitHub's "Squash and merge"). Use --stage to control what gets staged: all (default), tracked, or none. A backup ref is saved to refs/wt-backup/<branch>. With --no-squash, uncommitted changes become a separate commit and individual commits are preserved.
-2. Rebase — Rebases onto target if behind. Skipped if already up-to-date. Conflicts abort immediately.
-3. Pre-merge hooks — Hooks run after rebase, before merge. Failures abort. See wt hook.
-4. Merge — Fast-forward merge to the target branch. Non-fast-forward merges are rejected.
-5. Pre-remove hooks — Hooks run before removing worktree. Failures abort.
-6. Cleanup — Removes the worktree and branch. Use --no-remove to keep the worktree. When already on the target branch or in the main worktree, the worktree is preserved.
-7. Post-merge hooks — Hooks run after cleanup. Failures are logged but don't abort.
-
-Use --no-commit to skip committing uncommitted changes and squashing; rebase still runs by default and can rewrite commits unless --no-rebase is passed. Useful after preparing commits manually with wt step. Requires a clean working tree.
-
-Local CI
-
-For personal projects, pre-merge hooks open up the possibility of a workflow with much faster iteration — an order of magnitude more small changes instead of fewer large ones.
-
-Historically, ensuring tests ran before merging was difficult to enforce locally. Remote CI was valuable for the process as much as the checks: it guaranteed validation happened. wt merge brings that guarantee local.
-
-The full workflow: start an agent (one of many) on a task, work elsewhere, return when it's ready. Review the diff, run wt merge, move on. Pre-merge hooks validate before merging — if they pass, the branch goes to the default branch and the worktree cleans up.
-
- [pre-merge]
- test = "cargo test"
- lint = "cargo clippy"
-
-See also
-
-- wt step — Run individual operations (commit, squash, rebase, push)
-- wt remove — Remove worktrees without merging
-- wt switch — Navigate to other worktrees
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove.snap b/tests/snapshots/integration__integration_tests__help__help_remove.snap
deleted file mode 100644
index 72ebccbdd..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_remove.snap
+++ /dev/null
@@ -1,126 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - remove
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt remove - Remove worktree; delete branch if merged
-
-For finished feature branches. Removes the current worktree by default.
-
-Usage: wt remove [OPTIONS] [BRANCHES]...
-
-Arguments:
- [BRANCHES]...
- Branch name [default: current]
-
-Options:
- --no-delete-branch
- Keep branch after removal
-
- -D, --force-delete
- Delete unmerged branches
-
- --foreground
- Run removal in foreground (block until complete)
-
- --no-verify
- Skip hooks
-
- -y, --yes
- Skip approval prompts
-
- -f, --force
- Force worktree removal
-
- Remove worktrees even if they contain untracked files (like build artifacts). Without this flag, removal fails if untracked files exist.
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Remove current worktree:
-
- wt remove
-
-Remove specific worktrees:
-
- wt remove feature-branch
- wt remove old-feature another-branch
-
-Keep the branch:
-
- wt remove --no-delete-branch feature-branch
-
-Force-delete an unmerged branch:
-
- wt remove -D experimental
-
-Branch cleanup
-
-By default, branches are deleted when merging them would add nothing. This works with squash-merge and rebase workflows where commit history differs but file changes match.
-
-Worktrunk checks five conditions (in order of cost):
-
-1. Same commit — Branch HEAD equals the default branch. Shows _ in wt list.
-2. Ancestor — Branch is in target's history (fast-forward or rebase case). Shows ⊂.
-3. No added changes — Three-dot diff (target...branch) is empty. Shows ⊂.
-4. Trees match — Branch tree SHA equals target tree SHA. Shows ⊂.
-5. Merge adds nothing — Simulated merge produces the same tree as target. Handles squash-merged branches where target has advanced. Shows ⊂.
-
-The 'same commit' check uses the local default branch; for other checks, 'target' means the default branch, or its upstream (e.g., origin/main) when strictly ahead.
-
-Branches showing _ or ⊂ are dimmed as safe to delete.
-
-Force flags
-
-Worktrunk has two force flags for different situations:
-
- Flag Scope When to use
- ─────────────────── ──────── ──────────────────────────────────────────────────────────
- --force (-f) Worktree Worktree has untracked files (build artifacts, IDE config)
- --force-delete (-D) Branch Branch has unmerged commits
-
- wt remove feature --force # Remove worktree with untracked files
- wt remove feature -D # Delete unmerged branch
- wt remove feature --force -D # Both
-
-Without --force, removal fails if the worktree contains untracked files. Without -D, removal keeps branches with unmerged changes. Use --no-delete-branch to keep the branch regardless of merge status.
-
-Background removal
-
-Removal runs in the background by default (returns immediately). Logs are written to .git/wt-logs/{branch}-remove.log. Use --foreground to run in the foreground.
-
-See also
-
-- wt merge — Remove worktree after merging
-- wt list — View all worktrees
diff --git a/tests/snapshots/integration__integration_tests__help__help_root.snap b/tests/snapshots/integration__integration_tests__help__help_root.snap
deleted file mode 100644
index 8808a9382..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_root.snap
+++ /dev/null
@@ -1,66 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt - Git worktree management for parallel AI agent workflows
-
-Usage: wt [OPTIONS] [COMMAND]
-
-Commands:
- switch Switch to a worktree
- list List worktrees and their status
- remove Remove worktree; delete branch if merged
- merge Merge current branch into target
- select Interactive worktree selector
- step Run individual operations
- hook Run configured hooks
- config Manage user & project configs
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
- -V, --version
- Print version
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Getting started
-
- wt switch --create feature # Create worktree and branch
- wt switch feature # Switch to worktree
- wt list # Show all worktrees
- wt remove # Remove worktree; delete branch if merged
-
-Run wt config shell install to set up directory switching.
-Run wt config create to customize worktree locations.
-
-Docs: https://worktrunk.dev
-GitHub: https://github.com/max-sixty/worktrunk
diff --git a/tests/snapshots/integration__integration_tests__help__help_select.snap b/tests/snapshots/integration__integration_tests__help__help_select.snap
deleted file mode 100644
index d3e6ecc8d..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_select.snap
+++ /dev/null
@@ -1,97 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - select
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt select - Interactive worktree selector
-
-Browse and switch worktrees with live preview.
-
-Usage: wt select [OPTIONS]
-
-Options:
- --branches
- Include branches without worktrees
-
- --remotes
- Include remote branches
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-
-Examples
-
-Open the selector:
-
- wt select
-
-Preview tabs
-
-Toggle between views with number keys:
-
-1. HEAD± — Diff of uncommitted changes
-2. log — Recent commits; commits already on the default branch have dimmed hashes
-3. main…± — Diff of changes since the merge-base with the default branch
-4. remote⇅ — Diff vs upstream tracking branch (ahead/behind)
-
-Keybindings
-
- Key Action
- ───────────── ───────────────────────────
- ↑/↓ Navigate worktree list
- Enter Switch to selected worktree
- Esc Cancel
- (type) Filter worktrees
- 1/2/3/4 Switch preview tab
- Alt-p Toggle preview panel
- Ctrl-u/Ctrl-d Scroll preview up/down
-
-With --branches, branches without worktrees are included — selecting one creates a worktree. This matches wt list --branches.
-
-Configuration
-
-Pager
-
-The preview panel pipes diff output through git's pager (typically less or delta). Override pager behavior in user config:
-
- [select]
- pager = "delta --paging=never"
-
-This is useful when the default pager doesn't render correctly in the embedded preview panel.
-
-See also
-
-- wt list — Static table view with all worktree metadata
-- wt switch — Direct switching to a known target branch
-
-Available on Unix only (macOS, Linux). On Windows, use wt list or wt switch directly.
diff --git a/tests/snapshots/integration__integration_tests__help__help_select_short.snap b/tests/snapshots/integration__integration_tests__help__help_select_short.snap
deleted file mode 100644
index 61723d9a4..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_select_short.snap
+++ /dev/null
@@ -1,37 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - select
- - "-h"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt select - Interactive worktree selector
-
-Usage: wt select [OPTIONS]
-
-Options:
- --branches Include branches without worktrees
- --remotes Include remote branches
- -h, --help Print help (see more with '--help')
-
-Global Options:
- -C <path> Working directory for this command
- --config <path> User config file path
- -v, --verbose... Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_step.snap b/tests/snapshots/integration__integration_tests__help__help_step.snap
deleted file mode 100644
index 09ea9d6c2..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_step.snap
+++ /dev/null
@@ -1,78 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - step
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt step - Run individual operations
-
-The building blocks of wt merge — commit, squash, rebase, push — plus standalone utilities.
-
-Usage: wt step [OPTIONS] <COMMAND>
-
-Commands:
- commit Commit changes with LLM commit message
- squash Squash commits since branching
- push Fast-forward target to current branch
- rebase Rebase onto target
- copy-ignored Copy gitignored files to another worktree
- for-each [experimental] Run command in each worktree
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Examples
-
-Commit with LLM-generated message:
-
- wt step commit
-
-Manual merge workflow with review between steps:
-
- wt step commit
- wt step squash
- wt step rebase
- wt step push
-
-Operations
-
-- commit — Stage and commit with LLM-generated message
-- squash — Squash all branch commits into one with LLM-generated message
-- rebase — Rebase onto target branch
-- push — Fast-forward target to current branch
-- copy-ignored — Copy gitignored files between worktrees
-- for-each — [experimental] Run a command in every worktree
-
-See also
-
-- wt merge — Runs commit → squash → rebase → hooks → push → cleanup automatically
-- wt hook — Run configured hooks
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_commit.snap b/tests/snapshots/integration__integration_tests__help__help_step_commit.snap
deleted file mode 100644
index 0bb81a8fd..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_step_commit.snap
+++ /dev/null
@@ -1,94 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - step
- - commit
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt step commit - Commit changes with LLM commit message
-
-Stages working tree changes and commits with an LLM-generated message.
-
-Usage: wt step commit [OPTIONS]
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --no-verify
- Skip hooks
-
- --stage <STAGE>
- What to stage before committing [default: all]
-
- Possible values:
- - all: Stage everything: untracked files + unstaged tracked changes
- - tracked: Stage tracked changes only (like git add -u)
- - none: Stage nothing, commit only what's already in the index
-
- --show-prompt
- Show prompt without running LLM
-
- Outputs the rendered prompt to stdout for debugging or manual piping.
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Stages all changes (including untracked files) and commits with an LLM-generated message.
-
-Options
-
-`--stage`
-
-Controls what to stage before committing:
-
- Value Behavior
- ─────── ───────────────────────────────────────────────────────
- all Stage all changes including untracked files (default)
- tracked Stage only modified tracked files
- none Don't stage anything, commit only what's already staged
-
- wt step commit --stage=tracked
-
-Configure the default in user config:
-
- [commit]
- stage = "tracked"
-
-`--show-prompt`
-
-Output the rendered LLM prompt to stdout without running the command. Useful for inspecting prompt templates or piping to other tools:
-
- # Inspect the rendered prompt
- wt step commit --show-prompt | less
- 
- # Pipe to a different LLM
- wt step commit --show-prompt | llm -m gpt-5-nano
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_copy_ignored.snap b/tests/snapshots/integration__integration_tests__help__help_step_copy_ignored.snap
deleted file mode 100644
index fb1e132a8..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_step_copy_ignored.snap
+++ /dev/null
@@ -1,132 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - step
- - copy-ignored
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt step copy-ignored - Copy gitignored files to another worktree
-
-Copies gitignored files to another worktree. By default copies all gitignored files; use .worktreeinclude to limit what gets copied. Useful in hooks to copy build caches and dependencies to new worktrees. Skips symlinks and existing files.
-
-Usage: wt step copy-ignored [OPTIONS]
-
-Options:
- --from <FROM>
- Source worktree branch
-
- Defaults to main worktree.
-
- --to <TO>
- Destination worktree branch
-
- Defaults to current worktree.
-
- --dry-run
- Show what would be copied
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Git worktrees share the repository but not untracked files. This command copies gitignored files to another worktree, eliminating cold starts.
-
-Setup
-
-Add to the project config:
-
- # .config/wt.toml
- [post-start]
- copy = "wt step copy-ignored"
-
-What gets copied
-
-All gitignored files are copied by default. Tracked files are never touched.
-
-To limit what gets copied, create .worktreeinclude with gitignore-style patterns. Files must be both gitignored and in .worktreeinclude:
-
- # .worktreeinclude
- .env
- node_modules/
- target/
-
-Common patterns
-
- Type Patterns
- ───────────────── ──────────────────────────────────────────────
- Dependencies node_modules/, .venv/, target/, vendor/, Pods/
- Build caches .cache/, .next/, .parcel-cache/, .turbo/
- Generated assets Images, ML models, binaries too large for git
- Environment files .env (if not generated per-worktree)
-
-Features
-
-- Uses copy-on-write (reflink) when available for space-efficient copies
-- Handles nested .gitignore files, global excludes, and .git/info/exclude
-- Skips existing files (safe to re-run)
-- Skips .git entries and other worktrees
-
-Performance
-
-Reflink copies share disk blocks until modified — no data is actually copied. For a 14GB target/ directory:
-
- Command Time
- ───────────────────────────── ────
- cp -R (full copy) 2m
- cp -Rc / wt step copy-ignored 20s
-
-Uses per-file reflink (like cp -Rc) — copy time scales with file count.
-
-Use the post-start hook so the copy runs in the background. Use post-create instead if subsequent hooks or --execute command need the copied files immediately.
-
-Language-specific notes
-
-Rust
-
-The target/ directory is huge (often 1-10GB). Copying with reflink cuts first build from ~68s to ~3s by reusing compiled dependencies.
-
-Node.js
-
-node_modules/ is large but mostly static. If the project has no native dependencies, symlinks are even faster:
-
- [post-create]
- deps = "ln -sf {{ primary_worktree_path }}/node_modules ."
-
-Python
-
-Virtual environments contain absolute paths and can't be copied. Use uv sync instead — it's fast enough that copying isn't worth it.
-
-Behavior vs Claude Code on desktop
-
-The .worktreeinclude pattern is shared with Claude Code on desktop, which copies matching files when creating worktrees. Differences:
-
-- worktrunk copies all gitignored files by default; Claude Code requires .worktreeinclude
-- worktrunk uses copy-on-write for large directories like target/ — potentially 30x faster on macOS, 6x on Linux
-- worktrunk runs as a configurable hook in the worktree lifecycle
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_for_each.snap b/tests/snapshots/integration__integration_tests__help__help_step_for_each.snap
deleted file mode 100644
index 8d4cbabff..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_step_for_each.snap
+++ /dev/null
@@ -1,74 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - step
- - for-each
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt step for-each - [experimental] Run command in each worktree
-
-Usage: wt step for-each [OPTIONS] -- <ARGS>...
-
-Arguments:
- <ARGS>...
- Command template (see --help for all variables)
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Executes a command sequentially in every worktree with real-time output. Continues on failure and shows a summary at the end.
-
-Context JSON is piped to stdin for scripts that need structured data.
-
-Template variables
-
-All variables are shell-escaped. See wt hook template variables for the complete list and filters.
-
-Examples
-
-Check status across all worktrees:
-
- wt step for-each -- git status --short
-
-Run npm install in all worktrees:
-
- wt step for-each -- npm install
-
-Use branch name in command:
-
- wt step for-each -- "echo Branch: {{ branch }}"
-
-Pull updates in worktrees with upstreams (skips others):
-
- git fetch --prune && wt step for-each -- '[ "$(git rev-parse @{u} 2>/dev/null)" ] || exit 0; git pull --autostash'
-
-Note: This command is experimental and may change in future versions.
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_push.snap b/tests/snapshots/integration__integration_tests__help__help_step_push.snap
deleted file mode 100644
index 49fa8020f..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_step_push.snap
+++ /dev/null
@@ -1,50 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - step
- - push
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt step push - Fast-forward target to current branch
-
-Updates the local target branch (e.g., main) to include current commits. Similar to git push . HEAD:<target>, but uses receive.denyCurrentBranch=updateInstead internally.
-
-Usage: wt step push [OPTIONS] [TARGET]
-
-Arguments:
- [TARGET]
- Target branch
-
- Defaults to default branch.
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_rebase.snap b/tests/snapshots/integration__integration_tests__help__help_step_rebase.snap
deleted file mode 100644
index 372f1beb7..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_step_rebase.snap
+++ /dev/null
@@ -1,48 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - step
- - rebase
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt step rebase - Rebase onto target
-
-Usage: wt step rebase [OPTIONS] [TARGET]
-
-Arguments:
- [TARGET]
- Target branch
-
- Defaults to default branch.
-
-Options:
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_squash.snap b/tests/snapshots/integration__integration_tests__help__help_step_squash.snap
deleted file mode 100644
index 35b985949..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_step_squash.snap
+++ /dev/null
@@ -1,96 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - step
- - squash
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt step squash - Squash commits since branching
-
-Stages working tree changes, squashes all commits since diverging from target into one, generates message with LLM.
-
-Usage: wt step squash [OPTIONS] [TARGET]
-
-Arguments:
- [TARGET]
- Target branch
-
- Defaults to default branch.
-
-Options:
- -y, --yes
- Skip approval prompts
-
- --no-verify
- Skip hooks
-
- --stage <STAGE>
- What to stage before committing [default: all]
-
- Possible values:
- - all: Stage everything: untracked files + unstaged tracked changes
- - tracked: Stage tracked changes only (like git add -u)
- - none: Stage nothing, commit only what's already in the index
-
- --show-prompt
- Show prompt without running LLM
-
- Outputs the rendered prompt to stdout for debugging or manual piping.
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Stages all changes (including untracked files), then squashes all commits since diverging from the target branch into a single commit with an LLM-generated message.
-
-Options
-
-`--stage`
-
-Controls what to stage before squashing:
-
- Value Behavior
- ─────── ─────────────────────────────────────────────────────
- all Stage all changes including untracked files (default)
- tracked Stage only modified tracked files
- none Don't stage anything, squash only committed changes
-
- wt step squash --stage=none
-
-Configure the default in user config:
-
- [commit]
- stage = "tracked"
-
-`--show-prompt`
-
-Output the rendered LLM prompt to stdout without running the command. Useful for inspecting prompt templates or piping to other tools:
-
- wt step squash --show-prompt | less
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch.snap b/tests/snapshots/integration__integration_tests__help__help_switch.snap
deleted file mode 100644
index 2c74eb642..000000000
--- a/tests/snapshots/integration__integration_tests__help__help_switch.snap
+++ /dev/null
@@ -1,172 +0,0 @@
----
-source: tests/integration_tests/help.rs
-info:
- program: wt
- args:
- - switch
- - "--help"
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_EDITOR: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- WORKTRUNK_CONFIG_PATH: /nonexistent/test/config.toml
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WT_TEST_DELAYED_STREAM_MS: "-1"
- WT_TEST_EPOCH: "1735776000"
----
-success: true
-exit_code: 0
------ stdout -----
-
------ stderr -----
-wt switch - Switch to a worktree
-
-Creates one if needed.
-
-Usage: wt switch [OPTIONS] <BRANCH> [-- <EXECUTE_ARGS>...]
-
-Arguments:
- <BRANCH>
- Branch name or shortcut
-
- Shortcuts: '^' (default branch), '-' (previous), '@' (current), 'pr:{N}' (GitHub PR), 'mr:{N}' (GitLab MR)
-
- [EXECUTE_ARGS]...
- Additional arguments for --execute command (after --)
-
- Arguments after -- are appended to the execute command. Each argument is expanded for templates, then POSIX shell-escaped.
-
-Options:
- -c, --create
- Create a new branch
-
- -b, --base <BASE>
- Base branch
-
- Defaults to default branch.
-
- -x, --execute <EXECUTE>
- Command to run after switch
-
- Replaces the wt process with the command after switching, giving it full terminal control. Useful for launching editors, AI agents, or other interactive tools.
-
- Supports ]8;;@/hook.md#template-variables\hook template variables]8;;\ ({{ branch }}, {{ worktree_path }}, etc.) and filters. {{ base }} and {{ base_worktree_path }} require --create.
-
- Especially useful with shell aliases:
-
- alias wsc='wt switch --create -x claude'
- wsc feature-branch -- 'Fix GH #322'
-
- Then wsc feature-branch creates the worktree and launches Claude Code. Arguments after -- are passed to the command, so wsc feature -- 'Fix GH #322' runs claude 'Fix GH #322', starting Claude with a prompt.
-
- Template example: -x 'code {{ worktree_path }}' opens VS Code at the worktree, -x 'tmux new -s {{ branch | sanitize }}' starts a tmux session named after the branch.
-
- -y, --yes
- Skip approval prompts
-
- --clobber
- Remove stale paths at target
-
- --no-verify
- Skip hooks
-
- -h, --help
- Print help (see a summary with '-h')
-
-Global Options:
- -C <path>
- Working directory for this command
-
- --config <path>
- User config file path
-
- -v, --verbose...
- Verbose output (-v: hooks, templates; -vv: debug report)
-
-Worktrees are addressed by branch name; paths are computed from a configurable template. Unlike git switch, this navigates between worktrees rather than changing branches in place.
-
-Examples
-
- wt switch feature-auth # Switch to worktree
- wt switch - # Previous worktree (like cd -)
- wt switch --create new-feature # Create new branch and worktree
- wt switch --create hotfix --base production
- wt switch pr:123 # Switch to PR #123's branch
-
-Creating a branch
-
-The --create flag creates a new branch from the --base branch (defaults to default branch). Without --create, the branch must already exist.
-
-Upstream tracking: Branches created with --create have no upstream tracking configured. This prevents accidental pushes to the wrong branch — for example, --base origin/main would otherwise make git push target main. Use git push -u origin <branch> to set up tracking when you're ready.
-
-Without --create, switching to a remote branch (e.g., wt switch feature when only origin/feature exists) creates a local branch tracking the remote — this is the standard git behavior and is preserved.
-
-Creating worktrees
-
-If the branch already has a worktree, wt switch changes directories to it. Otherwise, it creates one, running hooks.
-
-When creating a worktree, worktrunk:
-
-1. Creates worktree at configured path
-2. Switches to new directory
-3. Runs post-create hooks (blocking)
-4. Spawns post-start hooks (background)
-
- wt switch feature # Existing branch → creates worktree
- wt switch --create feature # New branch and worktree
- wt switch --create fix --base release # New branch from release
- wt switch --create temp --no-verify # Skip hooks
-
-Shortcuts
-
- Shortcut Meaning
- ──────── ─────────────────────────────
- ^ Default branch (main/master)
- @ Current branch/worktree
- - Previous worktree (like cd -)
- pr:{N} GitHub PR #N's branch
- mr:{N} GitLab MR !N's branch
-
- wt switch - # Back to previous
- wt switch ^ # Default branch worktree
- wt switch --create fix --base=@ # Branch from current HEAD
- wt switch pr:123 # PR #123's branch
- wt switch mr:101 # MR !101's branch
-
-GitHub pull requests (experimental)
-
-The pr:<number> syntax resolves the branch for a GitHub pull request. For same-repo PRs, it switches to the branch directly. For fork PRs, it fetches refs/pull/N/head and configures pushRemote to the fork URL.
-
- wt switch pr:101 # Checkout PR #101
-
-Requires gh CLI to be installed and authenticated. The --create flag cannot be used with pr: syntax since the branch already exists.
-
-Fork PRs: The local branch uses the PR's branch name directly (e.g., feature-fix), so git push works normally. If a local branch with that name already exists tracking something else, rename it first.
-
-GitLab merge requests (experimental)
-
-The mr:<number> syntax resolves the branch for a GitLab merge request. For same-project MRs, it switches to the branch directly. For fork MRs, it fetches refs/merge-requests/N/head and configures pushRemote to the fork URL.
-
- wt switch mr:101 # Checkout MR !101
-
-Requires glab CLI to be installed and authenticated. The --create flag cannot be used with mr: syntax since the branch already exists.
-
-Fork MRs: The local branch uses the MR's branch name directly, so git push works normally. If a local branch with that name already exists tracking something else, rename it first.
-
-When wt switch fails
-
-- Branch doesn't exist — Use --create, or check wt list --branches
-- Path occupied — Another worktree is at the target path; switch to it or remove it
-- Stale directory — Use --clobber to remove a non-worktree directory at the target path
-
-To change which branch a worktree is on, use git switch inside that worktree.
-
-See also
-
-- wt select — Interactive worktree selection
-- wt list — View all worktrees
-- wt remove — Delete worktrees when done
-- wt merge — Integrate changes back to the default branch