Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Docs: standardize console output to `bash`
Maximilian Roose5c8c7e39704
diff --git a/.claude-plugin/skills/worktrunk/SKILL.md b/.claude-plugin/skills/worktrunk/SKILL.mdindex f08ed0051..6ac1c3982 100644--- a/.claude-plugin/skills/worktrunk/SKILL.md+++ b/.claude-plugin/skills/worktrunk/SKILL.md@@ -58,17 +58,17 @@ When a user asks for configuration help, determine which type based on:Most common request. Follow this sequence:1. **Check if LLM tool exists**- ```console+ ```bashwhich llm # or: which aichat```2. **If not installed, guide installation (don't run it)**- ```console+ ```bashuv tool install -U llm```3. **Guide API key setup (don't run it)**- ```console+ ```bashllm install llm-anthropicllm keys set anthropicllm models default claude-haiku-4-5-20251001@@ -87,7 +87,7 @@ Most common request. Follow this sequence:- Read, modify, write preserving structure6. **Suggest testing**- ```console+ ```bashllm "say hello"wt merge # in a repo with uncommitted changes```@@ -99,7 +99,7 @@ Most common request. Follow this sequence:Common request for workflow automation. Follow discovery process:1. **Detect project type**- ```console+ ```bashls package.json Cargo.toml pyproject.toml```@@ -114,7 +114,7 @@ Common request for workflow automation. Follow discovery process:- Long builds → `post-start`4. **Validate commands work**- ```console+ ```bashnpm run lint # verify existswhich cargo # verify tool exists```@@ -134,7 +134,7 @@ Common request for workflow automation. Follow discovery process:6. **Add comments explaining choices**7. **Suggest testing**- ```console+ ```bashwt switch --create test-hooks```@@ -171,7 +171,7 @@ Common request for workflow automation. Follow discovery process:## Key Commands-```console+```bash# View all configurationwt config list@@ -189,7 +189,7 @@ Load **reference/README.md** for general features, installation, commands, and eLoad **reference files** for detailed configuration, hook specifications, and troubleshooting.Find specific sections with grep:-```console+```bashgrep -A 20 "## Installation" reference/README.mdgrep -A 20 "## LLM Setup" reference/user-config.mdgrep -A 30 "### post-create" reference/project-config.mddiff --git a/.claude-plugin/skills/worktrunk/reference/project-config.md b/.claude-plugin/skills/worktrunk/reference/project-config.mdindex 6e586053d..91bc9e3de 100644--- a/.claude-plugin/skills/worktrunk/reference/project-config.md+++ b/.claude-plugin/skills/worktrunk/reference/project-config.md@@ -18,7 +18,7 @@ When users say "set up some hooks for me", follow this discovery process:### Step 1: Detect Project TypeCheck for package manifests:-```console+```bashls package.json Cargo.toml pyproject.toml pom.xml go.mod```@@ -27,7 +27,7 @@ ls package.json Cargo.toml pyproject.toml pom.xml go.mod<example type="detecting-npm-scripts">For npm projects, read `package.json`:-```console+```bashcat package.json | grep -A 20 '"scripts"'```@@ -57,7 +57,7 @@ Match hooks to project needs using this decision tree:### Step 4: Validate Commands WorkBefore adding to config, check:-```console+```bashnpm run lint # Check script existswhich cargo # Check tool exists```@@ -115,7 +115,7 @@ pre-commit = ["npm run lint", "npm run typecheck"]### Step 7: Suggest Testing-```console+```bash# Create a test worktree to verify hooks workwt switch --create test-hooks```@@ -126,7 +126,7 @@ When users want to add automation to an existing project:### Step 1: Read Existing Config-```console+```bashcat .config/wt.toml```@@ -381,7 +381,7 @@ Check commands are safe and exist:<example type="validation-checks">-```console+```bash# Verify command existswhich npmwhich cargo@@ -446,7 +446,7 @@ post-start = "npm run build" # Slow, background## Key Commands-```console+```bashwt config list # View project configcat .config/wt.toml # Read config directlywt switch --create test-hooks # Test hooks workdiff --git a/.claude-plugin/skills/worktrunk/reference/user-config.md b/.claude-plugin/skills/worktrunk/reference/user-config.mdindex 070cbfb97..f6184d569 100644--- a/.claude-plugin/skills/worktrunk/reference/user-config.md+++ b/.claude-plugin/skills/worktrunk/reference/user-config.md@@ -18,7 +18,7 @@ Most users want this for LLM commit messages. Follow this sequence:### Step 1: Check if LLM Tool Exists-```console+```bashwhich llm# orwhich aichat@@ -29,12 +29,12 @@ which aichat<example type="llm-install-guide">For `llm` (Python-based, recommended):-```console+```bashuv tool install -U llm```For `aichat` (Rust-based, 20+ providers):-```console+```bash# See: https://github.com/sigoden/aichat```@@ -45,7 +45,7 @@ For `aichat` (Rust-based, 20+ providers):<example type="api-key-setup">For Claude (via llm):-```console+```bashllm install llm-anthropicllm keys set anthropic# User pastes API key from: https://console.anthropic.com/settings/keys@@ -53,7 +53,7 @@ llm models default claude-haiku-4-5-20251001```For OpenAI (via llm):-```console+```bashllm keys set openai# User pastes API key from: https://platform.openai.com/api-keys```@@ -77,7 +77,7 @@ Ask: "Should I add this to your config at `~/.config/worktrunk/config.toml`?"### Step 5: After Approval, Check if Config Exists-```console+```bashwt config list```@@ -89,7 +89,7 @@ Read existing config, add the `[commit-generation]` section, preserve existing s### Step 7: Suggest Testing-```console+```bash# Test LLM worksllm "say hello"@@ -250,7 +250,7 @@ approved-commands = ["npm install"]## Key Commands-```console+```bashwt config list # View current configwt config create # Create initial config filewt config --help # Show LLM setup guidediff --git a/CLAUDE.md b/CLAUDE.mdindex 602d7cf14..31937cd2d 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -44,7 +44,7 @@ Avoid mixing: "main/default branch worktree" is confusing. Use "main worktree" f### Running Tests-```console+```bash# Unit tests (fast, ~210 tests)cargo test --lib --bins@@ -66,7 +66,7 @@ The pre-merge hook runs the full test suite and is the recommended way to verifyWhen working in Claude Code web, run the setup script first:-```console+```bash./dev/setup-claude-code-web.sh```@@ -621,7 +621,7 @@ For detailed benchmark documentation, see `benches/CLAUDE.md`.### Quick Start-```console+```bash# Run fast synthetic benchmarks (skip slow ones)cargo bench --bench list -- --skip cold --skip realdiff --git a/README.md b/README.mdindex be892a393..9f333cd7e 100644--- a/README.md+++ b/README.md@@ -50,14 +50,14 @@ I'd recommend:**Homebrew (macOS):**-```console+```bash$ brew install max-sixty/worktrunk/wt$ wt config shell install # allows commands to change directories```**Cargo:**-```console+```bash$ cargo install worktrunk$ wt config shell install```@@ -66,7 +66,7 @@ $ wt config shell install<!-- ⚠️ AUTO-GENERATED from tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap — edit source to update -->-```console+```bash$ wt switch --create fix-auth✅ Created new worktree for fix-auth from main at ../repo.fix-auth```@@ -79,7 +79,7 @@ This creates `../repo.fix-auth` on branch `fix-auth`.<!-- ⚠️ AUTO-GENERATED from tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_switch_back.snap — edit source to update -->-```console+```bash$ wt switch feature-api✅ Switched to worktree for feature-api at ../repo.feature-api```@@ -90,7 +90,7 @@ $ wt switch feature-api<!-- ⚠️ AUTO-GENERATED from tests/snapshots/integration__integration_tests__list__readme_example_simple_list.snap — edit source to update -->-```console+```bash$ wt listBranch Status HEAD± main↕ Path Remote⇅ Commit Age Message@ feature-api + ↑⇡ +36 -11 ↑4 ./repo.feature-api ⇡3 b1554967 30m Add API tests@@ -110,7 +110,7 @@ Say we merged via CI, our changes are on main, and we're finished with the workt<!-- ⚠️ AUTO-GENERATED from tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_remove.snap — edit source to update -->-```console+```bash$ wt remove🔄 Removing feature-api worktree & branch in background (already in main)```@@ -237,7 +237,7 @@ Example output:<!-- ⚠️ AUTO-GENERATED from tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_hooks_post_create.snap — edit source to update -->-```console+```bash$ wt switch --create feature-x🔄 Running post-create install:uv sync@@ -283,7 +283,7 @@ cargo install --path . </pre></td><!-- ⚠️ AUTO-GENERATED from tests/snapshots/integration__integration_tests__merge__readme_example_complex.snap — edit source to update -->-```console+```bash$ wt merge🔄 Squashing 3 commits into a single commit (3 files, +33)...🔄 Generating squash commit message...@@ -338,7 +338,7 @@ The Worktrunk plugin adds Claude Code session tracking to `wt list`:<!-- ⚠️ AUTO-GENERATED from tests/snapshots/integration__integration_tests__list__with_user_marker.snap — edit source to update -->-```console+```bash$ wt listBranch Status HEAD± main↕ Path Remote⇅ Commit Age Message@ main ^ ./repo b834638e 1d Initial commit@@ -356,7 +356,7 @@ $ wt list**Install the plugin:**-```console+```bashclaude plugin marketplace add max-sixty/worktrunkclaude plugin install worktrunk@worktrunk```@@ -366,7 +366,7 @@ claude plugin install worktrunk@worktrunkSet status markers manually for any workflow:-```console+```bashwt config var set marker "🚧" # Current branchwt config var set marker "✅" --branch feature # Specific branchgit config worktrunk.marker.feature "💬" # Direct git config@@ -396,7 +396,7 @@ or editor integrations[^1].**Claude Code** (`--claude-code`): Reads workspace context from stdin, outputsdirectory, branch status, and model.-```text+```~/w/myproject.feature-auth !🤖 ±+42 -8 ↑3 ⇡1 ● | Opus```@@ -420,7 +420,7 @@ Add to `~/.claude/settings.json`:<a id="alias"></a>**Alias for new worktree + agent:**-```console+```bashalias wsc='wt switch --create --execute=claude'wsc new-feature # Creates worktree, runs hooks, launches Claude```@@ -462,7 +462,7 @@ HEAD.<!-- ⚠️ AUTO-GENERATED from `wt switch --help-md` — edit source to update -->-```text+```wt switch — Switch to a worktreeUsage: wt switch [OPTIONS] <BRANCH>@@ -562,37 +562,37 @@ See `wt config approvals --help`.Switch to existing worktree:-```console+```bashwt switch feature-branch```Create new worktree from main:-```console+```bashwt switch --create new-feature```Switch to previous worktree:-```console+```bashwt switch -```Create from specific base:-```console+```bashwt switch --create hotfix --base production```Create and run command:-```console+```bashwt switch --create docs --execute "code ."```Skip hooks during creation:-```console+```bashwt switch --create temp --no-verify```@@ -600,7 +600,7 @@ wt switch --create temp --no-verifyUse `@` for current HEAD, `-` for previous, `^` for main:-```console+```bashwt switch @ # Switch to current branch's worktreewt switch - # Switch to previous worktreewt switch --create new-feature --base=^ # Branch from main (default)@@ -617,7 +617,7 @@ wt remove @ # Remove current worktree<!-- ⚠️ AUTO-GENERATED from `wt merge --help-md` — edit source to update -->-```text+```wt merge — Merge worktree into target branchUsage: wt merge [OPTIONS] [TARGET]@@ -707,25 +707,25 @@ See `wt config approvals --help`.Basic merge to main:-```console+```bashwt merge```Merge without squashing:-```console+```bashwt merge --no-squash```Keep worktree after merging:-```console+```bashwt merge --no-remove```Skip all hooks:-```console+```bashwt merge --no-verify```@@ -738,7 +738,7 @@ wt merge --no-verify<!-- ⚠️ AUTO-GENERATED from `wt remove --help-md` — edit source to update -->-```text+```wt remove — Remove worktree and branchUsage: wt remove [OPTIONS] [WORKTREES]...@@ -834,37 +834,37 @@ Stops any git fsmonitor daemon for the worktree before removal. This prevents orRemove current worktree and branch:-```console+```bashwt remove```Remove specific worktree and branch:-```console+```bashwt remove feature-branch```Remove worktree but keep branch:-```console+```bashwt remove --no-delete-branch feature-branch```Remove multiple worktrees:-```console+```bashwt remove old-feature another-branch```Remove in foreground (blocking):-```console+```bashwt remove --no-background feature-branch```Switch to default in main:-```console+```bashwt remove # (when already in main worktree)```@@ -877,7 +877,7 @@ wt remove # (when already in main worktree)<!-- ⚠️ AUTO-GENERATED from `wt list --help-md` — edit source to update -->-```text+```wt list — List worktrees and optionally branchesUsage: wt list [OPTIONS]wt list <COMMAND>@@ -992,7 +992,7 @@ Note: `locked` and `prunable` are top-level fields on worktree objects, not in s**Query examples:**-```console+```bash# Find worktrees with conflictsjq '.[] | select(.status.branch_state == "Conflicts")'@@ -1021,7 +1021,7 @@ jq '.[] | select(.is_current == true)'<!-- ⚠️ AUTO-GENERATED from `wt config --help-md` — edit source to update -->-```text+```wt config — Manage configuration and shell integrationUsage: wt config [OPTIONS] <COMMAND>@@ -1053,19 +1053,19 @@ Global Options:1. Set up shell integration- ```console+ ```bashwt config shell install```Or manually add to the shell config:- ```console+ ```basheval "$(wt config shell init bash)"```2. (Optional) Create user config file- ```console+ ```bashwt config create```@@ -1086,7 +1086,7 @@ Global Options:For Claude:-```console+```bashllm install llm-anthropicllm keys set anthropicllm models default claude-haiku-4-5-20251001@@ -1094,7 +1094,7 @@ llm models default claude-haiku-4-5-20251001For OpenAI:-```console+```bashllm keys set openai```@@ -1122,7 +1122,7 @@ Docs: <https://llm.datasette.io/> | <https://github.com/sigoden/aichat><!-- ⚠️ AUTO-GENERATED from `wt step --help-md` — edit source to update -->-```text+```wt step — Workflow building blocksUsage: wt step [OPTIONS] <COMMAND>@@ -1167,7 +1167,7 @@ Commands from project hooks and LLM configuration require approval on first run.<!-- ⚠️ AUTO-GENERATED from tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_approval_prompt.snap — edit source to update -->-```text+```🟡 repo needs approval to execute 3 commands:⚪ post-create install:@@ -1200,7 +1200,7 @@ Worktrees give each agent its own directory.Git's built-in worktree commands work but require manual lifecycle management:-```console+```bash# Plain git worktree workflowgit worktree add -b feature-branch ../myapp-feature maincd ../myapp-feature@@ -1213,7 +1213,7 @@ git branch -d feature-branchWorktrunk automates the full lifecycle:-```console+```bashwt switch --create feature-branch # Creates worktree, runs setup hooks# ...work...wt merge # Squashes, merges, removes worktree@@ -1251,7 +1251,7 @@ each worktree directory.Errors related to tree-sitter or C compilation (C99 mode, `le16toh` undefined)can be avoided by installing without syntax highlighting:-```console+```bashcargo install worktrunk --no-default-features```@@ -1298,7 +1298,7 @@ cargo test --test integration --features shell-integration-testsUse [cargo-release](https://github.com/crate-ci/cargo-release) to publish new versions:-```console+```bashcargo install cargo-release# Bump version, update Cargo.lock, commit, tag, and push@@ -1315,7 +1315,7 @@ Run without `--execute` to preview changes first.After `cargo release` completes and the GitHub release is created, update the [homebrew-worktrunk](https://github.com/max-sixty/homebrew-worktrunk) tap:-```console+```bash./dev/update-homebrew.sh```diff --git a/benches/CLAUDE.md b/benches/CLAUDE.mdindex 764096d7c..6bb841b99 100644--- a/benches/CLAUDE.md+++ b/benches/CLAUDE.md@@ -4,7 +4,7 @@ See `list.rs` header for the authoritative list of benchmark groups and run exam## Quick Start-```console+```bash# Fast iteration (skip slow benchmarks)cargo bench --bench list -- --skip cold --skip real@@ -22,12 +22,12 @@ Real repo benchmarks clone rust-lang/rust on first run (~2-5 minutes). The clone## Faster Iteration**Skip slow benchmarks:**-```console+```bashcargo bench --bench list -- --skip cold --skip real```**Pattern matching:**-```console+```bashcargo bench --bench list scaling # All scaling benchmarkscargo bench --bench list -- --skip cold # Warm cache only```diff --git a/dev/wt-demo/CLAUDE.md b/dev/wt-demo/CLAUDE.mdindex 8c09c3854..ba14d20f8 100644--- a/dev/wt-demo/CLAUDE.md+++ b/dev/wt-demo/CLAUDE.md@@ -2,7 +2,7 @@## Running the Demo-```console+```bash./dev/wt-demo-build```diff --git a/docs/content/commands.md b/docs/content/commands.mdindex 8e6dabb11..140c82f19 100644--- a/docs/content/commands.md+++ b/docs/content/commands.md@@ -7,7 +7,7 @@ weight = 5<!-- ⚠️ AUTO-GENERATED from `wt switch --help-md` — edit source to update -->-```text+```wt switch — Switch to a worktreeUsage: wt switch [OPTIONS] <BRANCH>@@ -107,37 +107,37 @@ See `wt config approvals --help`.Switch to existing worktree:-```console+```bashwt switch feature-branch```Create new worktree from main:-```console+```bashwt switch --create new-feature```Switch to previous worktree:-```console+```bashwt switch -```Create from specific base:-```console+```bashwt switch --create hotfix --base production```Create and run command:-```console+```bashwt switch --create docs --execute "code ."```Skip hooks during creation:-```console+```bashwt switch --create temp --no-verify```@@ -145,7 +145,7 @@ wt switch --create temp --no-verifyUse `@` for current HEAD, `-` for previous, `^` for main:-```console+```bashwt switch @ # Switch to current branch's worktreewt switch - # Switch to previous worktreewt switch --create new-feature --base=^ # Branch from main (default)@@ -161,7 +161,7 @@ wt remove @ # Remove current worktree<!-- ⚠️ AUTO-GENERATED from `wt merge --help-md` — edit source to update -->-```text+```wt merge — Merge worktree into target branchUsage: wt merge [OPTIONS] [TARGET]@@ -251,25 +251,25 @@ See `wt config approvals --help`.Basic merge to main:-```console+```bashwt merge```Merge without squashing:-```console+```bashwt merge --no-squash```Keep worktree after merging:-```console+```bashwt merge --no-remove```Skip all hooks:-```console+```bashwt merge --no-verify```@@ -281,7 +281,7 @@ wt merge --no-verify<!-- ⚠️ AUTO-GENERATED from `wt remove --help-md` — edit source to update -->-```text+```wt remove — Remove worktree and branchUsage: wt remove [OPTIONS] [WORKTREES]...@@ -377,37 +377,37 @@ Stops any git fsmonitor daemon for the worktree before removal. This prevents orRemove current worktree and branch:-```console+```bashwt remove```Remove specific worktree and branch:-```console+```bashwt remove feature-branch```Remove worktree but keep branch:-```console+```bashwt remove --no-delete-branch feature-branch```Remove multiple worktrees:-```console+```bashwt remove old-feature another-branch```Remove in foreground (blocking):-```console+```bashwt remove --no-background feature-branch```Switch to default in main:-```console+```bashwt remove # (when already in main worktree)```@@ -419,7 +419,7 @@ wt remove # (when already in main worktree)<!-- ⚠️ AUTO-GENERATED from `wt list --help-md` — edit source to update -->-```text+```wt list — List worktrees and optionally branchesUsage: wt list [OPTIONS]wt list <COMMAND>@@ -534,7 +534,7 @@ Note: `locked` and `prunable` are top-level fields on worktree objects, not in s**Query examples:**-```console+```bash# Find worktrees with conflictsjq '.[] | select(.status.branch_state == "Conflicts")'@@ -562,7 +562,7 @@ jq '.[] | select(.is_current == true)'<!-- ⚠️ AUTO-GENERATED from `wt config --help-md` — edit source to update -->-```text+```wt config — Manage configuration and shell integrationUsage: wt config [OPTIONS] <COMMAND>@@ -594,19 +594,19 @@ Global Options:1. Set up shell integration- ```console+ ```bashwt config shell install```Or manually add to the shell config:- ```console+ ```basheval "$(wt config shell init bash)"```2. (Optional) Create user config file- ```console+ ```bashwt config create```@@ -627,7 +627,7 @@ Global Options:For Claude:-```console+```bashllm install llm-anthropicllm keys set anthropicllm models default claude-haiku-4-5-20251001@@ -635,7 +635,7 @@ llm models default claude-haiku-4-5-20251001For OpenAI:-```console+```bashllm keys set openai```@@ -662,7 +662,7 @@ Docs: <https://llm.datasette.io/> | <https://github.com/sigoden/aichat><!-- ⚠️ AUTO-GENERATED from `wt step --help-md` — edit source to update -->-```text+```wt step — Workflow building blocksUsage: wt step [OPTIONS] <COMMAND>diff --git a/docs/content/faq.md b/docs/content/faq.mdindex 15475cec7..879255617 100644--- a/docs/content/faq.md+++ b/docs/content/faq.md@@ -17,7 +17,7 @@ Commands from project hooks and LLM configuration require approval on first run.<!-- ⚠️ AUTO-GENERATED from tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_approval_prompt.snap — edit source to update -->-```txt+```🟡 repo needs approval to execute 3 commands:⚪ post-create install:diff --git a/docs/sass/custom.scss b/docs/sass/custom.scssindex be69442f3..960401c42 100644--- a/docs/sass/custom.scss+++ b/docs/sass/custom.scss@@ -17,7 +17,7 @@ html {body {font-family: var(--wt-font-sans);- font-size: 17px;+ font-size: 15px;line-height: 1.6;color: var(--wt-color-text);background-color: var(--wt-color-bg);@@ -250,7 +250,6 @@ table {th {background-color: var(--wt-color-bg-soft);font-weight: 600;- font-size: 0.9rem;color: var(--wt-color-text);}@@ -319,7 +318,7 @@ table {margin: 0 0.5rem;a {- font-size: 0.8rem;+ font-size: 0.9rem;color: var(--wt-color-text-soft);padding: 0.1rem 0.4rem;border-radius: 0.3rem;@@ -337,7 +336,7 @@ table {padding-left: 2.5rem;a {- font-size: 0.75rem;+ font-size: 0.85rem;}}}diff --git a/src/commands/CLAUDE.md b/src/commands/CLAUDE.mdindex ca98c40fe..8e8d1eecf 100644--- a/src/commands/CLAUDE.md+++ b/src/commands/CLAUDE.md@@ -6,7 +6,7 @@ When debugging TUI commands like `wt select`, use the `tmux-cli` skill (preferre### 1. Create Test Environment-```console+```bashcargo run --bin setup-select-test```@@ -18,7 +18,7 @@ This creates a reproducible test repo at `/tmp/wt-select-test/test-repo`.Load the `tmux-cli` skill, then use the `tmux-cli` tool. Install if needed: `uv tool install claude-code-tools` (requires tmux).-```console+```bash# Launch shell in test repopane=$(tmux-cli launch "zsh")tmux-cli send "cd /tmp/wt-select-test/test-repo" --pane=$pane@@ -60,7 +60,7 @@ mcp__node-terminal__terminal_read({ sessionId: "test" })### 3. Analyze Logs-```console+```bashtail -100 debug.log | grep -E "error|hang|stuck"```@@ -69,7 +69,7 @@ tail -100 debug.log | grep -E "error|hang|stuck"- **`-C <path>`**: Set working directory (alternative to `cd`)- **`--source`**: Use local source (only needed with installed `wt`, not with `cargo run`)-```console+```bash# Testing with cargo run (already uses local source):cargo run --quiet -- -C /path/to/repo select