Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
docs: update README.md examples for latest CLI output
Maximilian Roos0909d0f967d5
diff --git a/.claude-plugin/skills/worktrunk/reference/README.md b/.claude-plugin/skills/worktrunk/reference/README.mdindex d751a0fa5..1f0d2a87f 100644--- a/.claude-plugin/skills/worktrunk/reference/README.md+++ b/.claude-plugin/skills/worktrunk/reference/README.md@@ -22,7 +22,7 @@ Worktrunk offers transparency and automation for this lifecycle.**Create a worktree:**-<!-- Output from: tests/snapshots/integration__integration_tests__merge__readme_example_simple_switch.snap -->+<!-- Output from: tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap -->```bash$ wt switch --create fix-auth@@ -42,7 +42,7 @@ $ wt merge1 file changed, 13 insertions(+)β Merged to main (1 commit, 1 file, +13)π Removing worktree & branch...-β Removed worktree & branch for fix-auth, returned to primary at ../repo/+β Removed worktree & branch for fix-auth, changed directory to ../repo/# Shell back in main```@@ -52,10 +52,12 @@ $ wt merge```bash$ wt list-Branch Status HEADΒ± mainβ Path-main ./myapp/-feature-x β! +5 -2 β3 ./myapp.feature-x/-bugfix-y β +0 -0 β1 ./myapp.bugfix-y/+Branch Status HEADΒ± mainβ Path Remoteβ Commit Age Message+main ./test-repo β0 β0 b834638e 10 months ago Initial commit+bugfix-y β β1 ./bugfix-y 412a27c8 10 months ago Fix bug+feature-x + β +5 β3 ./feature-x 7fd821aa 10 months ago Add file 3++βͺ Showing 3 worktrees, 1 with changes, 2 ahead```## Installation@@ -85,16 +87,17 @@ Then `wt merge` will generate commit messages automatically:```bash$ wt merge+π Squashing 3 commits into 1 (3 files, +33)...π Generating squash commit message...- feat(auth): Implement JWT authentication system+ feat(auth): Implement JWT authentication system- Add comprehensive JWT token handling including validation, refresh logic,- and authentication tests. This establishes the foundation for secure- API authentication.+ Add comprehensive JWT token handling including validation, refresh logic,+ and authentication tests. This establishes the foundation for secure+ API authentication.- - Implement token refresh mechanism with expiry handling- - Add JWT encoding/decoding with signature verification- - Create test suite covering all authentication flows+ - Implement token refresh mechanism with expiry handling+ - Add JWT encoding/decoding with signature verification+ - Create test suite covering all authentication flowsβ Squashed @ a1b2c3d```@@ -140,18 +143,14 @@ Automate common tasks by creating `.config/wt.toml` in the repository root. Inst```bash$ wt switch --create feature-x-π Creating worktree for feature-x...-β Created worktree, changed directory to ../repo.feature-x/π Running post-create install:uv sync+β Created new worktree for feature-x from main at ../repo.feature-x/+π Running post-start dev:+ uv run devResolved 24 packages in 145msInstalled 24 packages in 1.2s--π Running post-start dev (background):- uv run dev-- Starting dev server on http://localhost:3000...```**Example: Merging with pre-merge hooks:**@@ -171,14 +170,13 @@ $ wt mergeuv run pytest============================= test session starts ==============================- collected 18 items+ collected 3 items- tests/test_auth.py::test_login_success PASSED [ 11%]- tests/test_auth.py::test_login_invalid_password PASSED [ 22%]- tests/test_auth.py::test_token_refresh PASSED [ 33%]- tests/test_auth.py::test_token_validation PASSED [ 44%]+ tests/test_auth.py::test_login_success PASSED [ 33%]+ tests/test_auth.py::test_login_invalid_password PASSED [ 66%]+ tests/test_auth.py::test_token_validation PASSED [100%]- ============================== 18 passed in 0.8s ===============================+ ============================== 3 passed in 0.8s ===============================π Running pre-merge lint:uv run ruff check@@ -186,16 +184,13 @@ $ wt mergeAll checks passed!π Merging 1 commit to main @ a1b2c3d (no rebase needed)-* a1b2c3d (HEAD -> feature-auth) feat(api): Add user authentication endpoints-- api/auth.py | 32 ++++++++++++++++++++++++++++++++- tests/test_auth.py | 13 ++++++++++++++ api/auth.py | 31 ++++++++++++++++++++++++++++++++ tests/test_auth.py | 14 ++++++++++++++2 files changed, 45 insertions(+)-β Merged to main (1 commit, 2 files, +45)π Removing worktree & branch...-β Removed worktree & branch for feature-auth, returned to primary at ../repo/+β Removed worktree & branch for feature-auth, changed directory to ../repo/```<details>@@ -433,9 +428,14 @@ When using Claude:```bash$ wt list-Branch Status HEADΒ± mainβ Path-main ./myapp/-dirty-with-status β‘?π€ ./myapp.dirty-with-status/+Branch Status HEADΒ± mainβ Path Remoteβ Commit Age Message+main ./test-repo b834638e 10 months ago Initial commit+clean-no-status β‘ ./clean-no-status b834638e 10 months ago Initial commit+clean-with-status β‘ π¬ ./clean-with-status b834638e 10 months ago Initial commit+dirty-no-status ! +1 -1 ./dirty-no-status b834638e 10 months ago Initial commit+dirty-with-status β‘?π€ ./dirty-with-status b834638e 10 months ago Initial commit++βͺ Showing 5 worktrees, 1 with changes```**How it works:**@@ -524,9 +524,19 @@ Commands from project hooks and LLM configuration require approval on first run.**Example approval prompt:**+<!-- Output from: tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap -->+```-π‘ Permission required: post-create install- uv sync+π‘ test-repo needs approval to execute 3 commands:++π post-create install:+ echo 'Installing dependencies...'++π post-create build:+ echo 'Building project...'++π post-create test:+ echo 'Running tests...'π‘ Allow and remember? [y/N]```diff --git a/README.md b/README.mdindex d751a0fa5..1f0d2a87f 100644--- a/README.md+++ b/README.md@@ -22,7 +22,7 @@ Worktrunk offers transparency and automation for this lifecycle.**Create a worktree:**-<!-- Output from: tests/snapshots/integration__integration_tests__merge__readme_example_simple_switch.snap -->+<!-- Output from: tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap -->```bash$ wt switch --create fix-auth@@ -42,7 +42,7 @@ $ wt merge1 file changed, 13 insertions(+)β Merged to main (1 commit, 1 file, +13)π Removing worktree & branch...-β Removed worktree & branch for fix-auth, returned to primary at ../repo/+β Removed worktree & branch for fix-auth, changed directory to ../repo/# Shell back in main```@@ -52,10 +52,12 @@ $ wt merge```bash$ wt list-Branch Status HEADΒ± mainβ Path-main ./myapp/-feature-x β! +5 -2 β3 ./myapp.feature-x/-bugfix-y β +0 -0 β1 ./myapp.bugfix-y/+Branch Status HEADΒ± mainβ Path Remoteβ Commit Age Message+main ./test-repo β0 β0 b834638e 10 months ago Initial commit+bugfix-y β β1 ./bugfix-y 412a27c8 10 months ago Fix bug+feature-x + β +5 β3 ./feature-x 7fd821aa 10 months ago Add file 3++βͺ Showing 3 worktrees, 1 with changes, 2 ahead```## Installation@@ -85,16 +87,17 @@ Then `wt merge` will generate commit messages automatically:```bash$ wt merge+π Squashing 3 commits into 1 (3 files, +33)...π Generating squash commit message...- feat(auth): Implement JWT authentication system+ feat(auth): Implement JWT authentication system- Add comprehensive JWT token handling including validation, refresh logic,- and authentication tests. This establishes the foundation for secure- API authentication.+ Add comprehensive JWT token handling including validation, refresh logic,+ and authentication tests. This establishes the foundation for secure+ API authentication.- - Implement token refresh mechanism with expiry handling- - Add JWT encoding/decoding with signature verification- - Create test suite covering all authentication flows+ - Implement token refresh mechanism with expiry handling+ - Add JWT encoding/decoding with signature verification+ - Create test suite covering all authentication flowsβ Squashed @ a1b2c3d```@@ -140,18 +143,14 @@ Automate common tasks by creating `.config/wt.toml` in the repository root. Inst```bash$ wt switch --create feature-x-π Creating worktree for feature-x...-β Created worktree, changed directory to ../repo.feature-x/π Running post-create install:uv sync+β Created new worktree for feature-x from main at ../repo.feature-x/+π Running post-start dev:+ uv run devResolved 24 packages in 145msInstalled 24 packages in 1.2s--π Running post-start dev (background):- uv run dev-- Starting dev server on http://localhost:3000...```**Example: Merging with pre-merge hooks:**@@ -171,14 +170,13 @@ $ wt mergeuv run pytest============================= test session starts ==============================- collected 18 items+ collected 3 items- tests/test_auth.py::test_login_success PASSED [ 11%]- tests/test_auth.py::test_login_invalid_password PASSED [ 22%]- tests/test_auth.py::test_token_refresh PASSED [ 33%]- tests/test_auth.py::test_token_validation PASSED [ 44%]+ tests/test_auth.py::test_login_success PASSED [ 33%]+ tests/test_auth.py::test_login_invalid_password PASSED [ 66%]+ tests/test_auth.py::test_token_validation PASSED [100%]- ============================== 18 passed in 0.8s ===============================+ ============================== 3 passed in 0.8s ===============================π Running pre-merge lint:uv run ruff check@@ -186,16 +184,13 @@ $ wt mergeAll checks passed!π Merging 1 commit to main @ a1b2c3d (no rebase needed)-* a1b2c3d (HEAD -> feature-auth) feat(api): Add user authentication endpoints-- api/auth.py | 32 ++++++++++++++++++++++++++++++++- tests/test_auth.py | 13 ++++++++++++++ api/auth.py | 31 ++++++++++++++++++++++++++++++++ tests/test_auth.py | 14 ++++++++++++++2 files changed, 45 insertions(+)-β Merged to main (1 commit, 2 files, +45)π Removing worktree & branch...-β Removed worktree & branch for feature-auth, returned to primary at ../repo/+β Removed worktree & branch for feature-auth, changed directory to ../repo/```<details>@@ -433,9 +428,14 @@ When using Claude:```bash$ wt list-Branch Status HEADΒ± mainβ Path-main ./myapp/-dirty-with-status β‘?π€ ./myapp.dirty-with-status/+Branch Status HEADΒ± mainβ Path Remoteβ Commit Age Message+main ./test-repo b834638e 10 months ago Initial commit+clean-no-status β‘ ./clean-no-status b834638e 10 months ago Initial commit+clean-with-status β‘ π¬ ./clean-with-status b834638e 10 months ago Initial commit+dirty-no-status ! +1 -1 ./dirty-no-status b834638e 10 months ago Initial commit+dirty-with-status β‘?π€ ./dirty-with-status b834638e 10 months ago Initial commit++βͺ Showing 5 worktrees, 1 with changes```**How it works:**@@ -524,9 +524,19 @@ Commands from project hooks and LLM configuration require approval on first run.**Example approval prompt:**+<!-- Output from: tests/integration_tests/snapshots/integration__integration_tests__approval_pty__approval_prompt_named_commands.snap -->+```-π‘ Permission required: post-create install- uv sync+π‘ test-repo needs approval to execute 3 commands:++π post-create install:+ echo 'Installing dependencies...'++π post-create build:+ echo 'Building project...'++π post-create test:+ echo 'Running tests...'π‘ Allow and remember? [y/N]```diff --git a/tests/integration_tests/shell_wrapper.rs b/tests/integration_tests/shell_wrapper.rsindex 4936344a3..ed3f302f1 100644--- a/tests/integration_tests/shell_wrapper.rs+++ b/tests/integration_tests/shell_wrapper.rs@@ -1103,6 +1103,23 @@ approved-commands = ["echo 'test command executed'"]assert_snapshot!(output.normalized());}+ #[test]+ fn test_readme_example_simple_switch() {+ let mut repo = TestRepo::new();+ repo.commit("Initial commit");+ repo.setup_remote("main");++ // Create worktree through shell wrapper (suppresses hint)+ let output = exec_through_wrapper("bash", &repo, "switch", &["--create", "fix-auth"]);++ assert!(+ !output.combined.contains("To enable automatic cd"),+ "Shell integration hint should be suppressed"+ );++ assert_snapshot!(output.normalized());+ }+#[test]fn test_wrapper_preserves_progress_messages() {let repo = TestRepo::new();diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snapnew file mode 100644index 000000000..ae93fcdc4--- /dev/null+++ b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__readme_example_simple_switch.snap@@ -0,0 +1,5 @@+---+source: tests/integration_tests/shell_wrapper.rs+expression: output.normalized()+---+β [32mCreated new worktree for [1m[32mfix-auth[0m[32m from [1m[32mmain[0m[32m at [1m[32m[TMPDIR]/test-repo.fix-auth[0m[0m