Commit Graph

1003 Commits

Author SHA1 Message Date
Maximilian Roos 74f72ac9b3 docs: add comprehensive hook design guide (#367)
Add "Designing effective hooks" section to wt hook docs covering:
- post-create vs post-start decision guidance
- Copying untracked files (deps, caches, assets, env files)
- Copy-on-write with cross-platform detection script
- Dev servers with hash_port
- Databases with Docker patterns

Replace generic "Examples" with "Language-specific tips" focused on
ecosystem quirks (Rust CoW for target/, Python uv sync, Node.js
CoW/symlinks). Invite contributions for other languages.

Update tips-patterns.md to reference the new hook docs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 17:20:07 -08:00
Maximilian Roos 53c604468c Improve hooks documentation (#366)
- Update intro to be about hooks generally, not just `wt hook` command
- Add "Running hooks manually" section with `wt hook <type>` examples
- Expand NAME argument help to explain user:/project: prefix syntax
- Fix inaccurate claim that hooks only run during `wt switch --create`
  (they also run during regular `wt switch` for post-switch hooks)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 14:45:46 -08:00
Maximilian Roos 88f2cc97f9 docs: add wt config show to command docs (#365)
Add subdoc directive for `wt config show` and fix the `--full` flag
documentation to accurately describe both diagnostic checks:
- CI tool status (gh/glab installation and authentication)
- Commit generation (LLM command verification)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 14:17:30 -08:00
Maximilian Roos b424450022 fix(demos): fix split command timing in omnibus demo (#360)
The `git diff` command was splitting across panes because the sleep
after `Ctrl+n` (new pane) was too short (600ms). Increased to 1.2s.

Also added GIF review documentation to help catch similar issues.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-01 12:44:01 -08:00
Maximilian Roos 4460635d2f Clarify hook execution timing in switch help text
Move mention of hooks from summary to "Creating worktrees" section to
accurately reflect that hooks only run when a worktree is created, not
when switching to an existing one.
2026-01-01 10:28:10 -08:00
Maximilian Roos 92fd28508b Unify wt-select demos and fix zellij-omnibus approval mismatch
- Merge wt-select-short.tape into wt-select.tape for single unified demo
- Update docs and build config to use wt-select for both docs and social
- Adjust timing and interactions in unified tape
- Fix wt-zellij-omnibus demo npm dev server backgrounding
2026-01-01 10:08:33 -08:00
Maximilian Roos ad0277d10f Fix approved command and update URL column formatting
Fix the npm dev server command to remove the background ampersand to
match hook configuration, and update URL column snapshots to apply dim
formatting consistently across test outputs.
2026-01-01 09:39:00 -08:00
Maximilian Roos e530a16081 Refactor demo setup and remove unused function
Remove is_interactive_tape function and simplify hooks config
generation in prepare_with_hooks by using list concatenation instead
of f-string formatting.
2026-01-01 09:34:18 -08:00
Maximilian Roos b029e6c4d6 Refactor demo scripts with improved formatting
- Reformat imports and function arguments for better readability
- Consolidate multi-line imports into organized lists
- Wrap long function signatures and calls
- Normalize string quotes and spacing in configuration files
- Improve code style consistency across build, lib.py, and themes.py
2026-01-01 09:10:06 -08:00
Maximilian Roos 72b5b9faec Update mock CLI paths to use ~/.local/bin
Change bin directory from ~/bin to ~/.local/bin for mock CLIs (npm, llm,
gh, cat) and update PATH references in build script and tape files to
match the standard XDG Base Directory specification.
2026-01-01 09:04:45 -08:00
Maximilian Roos 167c4e727a Update snapshots: remove GIT_EDITOR and fix URL formatting
Remove the GIT_EDITOR environment variable from test snapshots and
remove markdown formatting from localhost URLs to match expected output.
2026-01-01 08:55:44 -08:00
Maximilian Roos 2fe04dff81 Add prerequisites section for Claude Code demos
Document the requirement to set ANTHROPIC_API_KEY environment variable for demos that launch Claude Code, and explain that API credits are consumed during recording.
2025-12-31 18:42:13 -08:00
Maximilian Roos 5d4c53d8f5 Simplify text recording by removing interactive tape validation 2025-12-31 18:39:01 -08:00
Maximilian Roos 5e27a7bd5a Remove background process ampersand from dev commands
Remove the trailing `&` from npm dev commands in devserver and
zellij_omnibus demo configurations. The ampersand was causing
processes to run in the background unnecessarily.
2025-12-31 18:29:10 -08:00
Maximilian Roos 83fd393013 Clarify --execute command behavior in help text
Update documentation and CLI help to better explain how arguments after
-- are passed to the execute command, with a concrete example showing
the resulting command invocation.
2025-12-31 17:37:45 -08:00
Maximilian Roos cfae445136 Update example prompts in switch command docs
Replace generic examples with concrete GitHub issue reference format
to better illustrate passing initial prompts to Claude via --execute.
Updates docs, CLI help text, and related snapshots.
2025-12-31 17:26:27 -08:00
Maximilian Roos 016fc5f0b3 Simplify install instructions to single-line commands
Combine brew/cargo install with shell config into single commands
using && operator. Add custom success message to dist config for
post-install guidance.
2025-12-31 13:07:08 -08:00
Maximilian Roos b7fb8a9a1c Add encourage-issues callout to list help text
Add a note encouraging users to open issues for missing fields in the
JSON output, even for small improvements. Updates help text in cli.rs
and docs, with corresponding snapshot updates for terminal output.
2025-12-31 12:58:24 -08:00
Maximilian Roos 455b43bbd7 Remove 2nd person pronouns from user-facing messages (#332)
Replace "you/your" with direct references following CLI output
formatting guidelines. Changes:

- "your config" → "the config"
- "your shell" → "the shell"
- "You can hash" → "Hash"
- "when you know" → "to a known"
- "unless you pass" → "unless ... is passed"
- "Commands you provide" → "Explicitly provided commands"
- "when you approve" → "when approving"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-31 11:45:00 -08:00
Maximilian Roos 9e625ec22a fix: approval bypass when using project: filter prefix (#331)
The approval gate in `approve_hooks_filtered` didn't parse the
`user:`/`project:` prefix syntax, so filters like `project:foo` or
`project:` matched nothing (command names are just "foo" without
prefix), returned Ok(true), and project hooks ran without approval.

Fix by reusing `ParsedFilter` from hooks.rs:
- Parse filter to extract source and name separately
- Skip approval for `user:` filters (user hooks don't need approval)
- Use parsed name (not raw filter) for matching command names

Also adds security regression tests for the fix.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-31 11:31:47 -08:00
Maximilian Roos a3057d8a0e Add fade-in animation for demo GIFs on load
Hide demo images until they finish loading to prevent broken-image icon
flash. Add JavaScript to detect load completion and visibility toggle via
CSS class. Update demo figure styles to support dynamic visibility and
maintain aspect ratio during scroll.
2025-12-31 10:33:47 -08:00
Maximilian Roos 2cdd5f6245 docs: remove outdated JSON stderr FAQ entry (#328) 2025-12-31 17:09:45 +00:00
Maximilian Roos 5dac49806a docs: add demo GIFs to command pages (#324)
* docs: add demo GIFs to command pages

Add demos to switch, list, merge, llm-commits, and claude-code pages.
Position demos after the intro sentence for consistent layout.

Changes:
- Add wt-switch, wt-list, wt-commit, wt-statusline to DOCS_DEMOS
- Update doc pages with <figure class="demo"> elements
- Update CLAUDE.md with new available demos list

Note: Demos involving `claude` (wt-switch, wt-statusline) need fixes
to the Claude Code mock before the GIFs look correct.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: add demo markers to cli.rs for switch, list, merge commands

Demo markers in after_long_help allow demos to persist through page
regeneration by test_command_pages_are_in_sync.

Positioned after intro sentence (matching wt-select pattern).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: add new demo pages to lychee exclude_path

These files have root-relative asset paths that lychee can't resolve
locally (assets are fetched at deploy time from worktrunk-assets repo).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update help snapshots for demo markers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: exclude asset GIF links by pattern instead of by file

Broadened `/assets/wt-.*\.gif` to `/assets/.*\.gif` to match all asset
directories including `/assets/docs/{light,dark}/`. This is cleaner than
excluding entire files from link checking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: pin lychee to 0.20.x in CI

Version 0.22.0 has a regression where exclude patterns for root-relative
paths (like /assets/*.gif) don't work properly - they're treated as
errors instead of being excluded.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-31 01:37:41 -08:00
Maximilian Roos d2a3ebffe6 Simplify demo description phrasing
Remove "Here's" from two demo descriptions, replacing with "A" for
more concise language.
2025-12-31 01:15:05 -08:00
Maximilian Roos 4fe53b0175 docs: reorganize resource links in llm-commits section 2025-12-31 00:34:28 -08:00
Maximilian Roos 285efa2ed3 docs: reorganize resource links in llm-commits section
Move resource links from end of fallback behavior section to alternative
tools section for better document flow.
2025-12-31 00:22:58 -08:00
Maximilian Roos f21388acc0 Add nested bare repo documentation and test helpers (#320)
Add documentation example showing worktree-path template for nested bare
repo layout (project/.git pattern from issue #313). Users can use relative
paths like `../{{ branch | sanitize }}` to create worktrees as siblings to
the .git directory.

Also adds a standalone configure_git_cmd() helper function in tests/common
that can be reused by different test fixtures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-30 23:50:06 -08:00
Maximilian Roos 413a92c4ee Refactor demo setup and consolidate preparation functions
Remove duplicate Require statements from tape files by sourcing
shared-commands.tape after shared-setup.tape. Consolidate multiple
preparation functions into parameterized versions using functools.partial
to reduce code duplication in demo registrations.
2025-12-30 23:43:34 -08:00
Maximilian Roos 88734db48f Extract shared VHS tape setup into reusable Source files
Move repeated VHS configuration and environment setup from individual tape
files into two shared sources:

- shared-setup.tape: VHS Set directives (Width, Height, Theme, etc)
- shared-commands.tape: Environment variables and shell initialization

Update render_tape() to inline Source directives since VHS doesn't support
them natively. This reduces duplication across 11 tape files by ~330 lines
while keeping tape logic readable.
2025-12-30 23:24:52 -08:00
Maximilian Roos bd32c16159 Refactor demo build script for parallel recording
Add concurrent.futures ProcessPoolExecutor to record multiple demos in
parallel. Introduce record_demo() function to encapsulate single demo
recording logic for subprocess compatibility. Replace lambda with named
function prepare_with_hooks_deps() for multiprocessing pickling. Add
--sequential flag to opt out of parallel execution. Improve output
formatting and error handling with failed demo tracking.
2025-12-30 22:46:06 -08:00
Maximilian Roos e0c41ca8e4 Reorganize demo assets into mode/theme subdirectories
Restructure demo asset output to use mode (docs/social) and theme (light/dark)
subdirectories. Updates all asset references in documentation, build scripts,
and publish tooling to match the new layout:

- docs/light/ and docs/dark/ for documentation site demos (1600x900)
- social/light/ for social media demos (1200x700)

Simplifies asset management and allows docs/social builds to coexist without
overwriting each other. Updates build script to organize GIFs by theme after
recording, fetch-assets to preserve directory structure, and all markdown
references to use the new paths. Renames twitter build target to social for
broader applicability.
2025-12-30 22:00:22 -08:00
Maximilian Roos e01cee6a04 Add tab completion demos to removal and omnibus tapes
Update wt-list-remove and wt-zellij-omnibus tapes to demonstrate
tab completion functionality. Add fish completion sourcing and
replace direct command typing with tab-completion sequences showing
menu selection, review time, and command execution flow.
2025-12-30 21:16:19 -08:00
Maximilian Roos 23c4003e84 Revert "Extract shared VHS tape setup into reusable Source file"
This reverts commit 0a886ba734.
2025-12-30 21:11:07 -08:00
Maximilian Roos 9e27a51d15 Standardize worktree/branch terminology in CLI and docs (#316)
Align with spec: "Worktrees are addressed by branch name."

CLI changes:
- Switch: "Branch or worktree name" → "Branch name"
- Remove: argument renamed from `worktrees` to `branches`
- Remove: "Worktree or branch" → "Branch name [default: current]"

Internal changes:
- GitError::UncommittedChanges field: `worktree` → `branch`
- Repository::ensure_clean_working_tree param: `worktree` → `branch`

Documentation:
- Added explanation: "Each worktree has exactly one branch, so Worktrunk
  uses branch names to address worktrees. The path is derived automatically."
- Appears in worktrunk.md (landing page) and `wt switch --help`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-30 21:09:39 -08:00
Maximilian Roos 0a886ba734 Extract shared VHS tape setup into reusable Source file
Create shared-setup.tape with common configuration (shell settings,
env vars, fish initialization) and update all 12 demo tapes to Source
it instead of duplicating the setup. Each tape can still customize
pre-show commands for demo-specific needs like claude plugin install.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-30 20:42:58 -08:00
Maximilian Roos 20162f74ae docs: add dev server and database per-worktree patterns (#315)
Add practical examples to tips-patterns.md:
- Enhanced dev server section with lvh.me subdomain routing for
  cookies/CORS isolation between worktrees
- New "Database per worktree" section showing Docker containers
  with unique ports via hash_port, plus .env.local generation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-30 20:37:12 -08:00
Maximilian Roos 74ff38927a Add tab completion to wt-core demo
Add tab completion support to the wt-core demo by installing fish
completions during base repo setup and pre-loading them in the demo
shell config. Update demo tape to showcase tab cycling through branch
options when switching worktrees. Simplify setup by removing redundant
repo_root parameter from fish config function. Add timing guidelines
for tab completion sequences to maintain natural pacing.
2025-12-30 20:14:23 -08:00
Maximilian Roos 0188408b50 Remove wt-zellij demo and consolidate to wt-zellij-omnibus 2025-12-30 16:20:05 -08:00
Maximilian Roos 98ce5fbd27 Refactor 1Password extension workaround and update code copy detection 2025-12-30 15:46:10 -08:00
Maximilian Roos 2585953cda Add text output recording for demo tapes using VHS
Support recording text output from demo tapes via VHS native .txt format
for capturing authentic shell sessions. Add --text flag to build script to
record shell output instead of GIFs, with automatic detection and skipping
of interactive demos. Refactor tape rendering to share template variable
replacements between GIF and text recording modes.
2025-12-30 15:36:41 -08:00
Maximilian Roos 43d78ae56d Simplify worktree API and bare repository support (#312)
- Remove WorktreeList wrapper, list_worktrees() returns Vec<Worktree> directly
- Add current_worktree() method to Repository for common lookup pattern
- Simplify load_project_config() - returns None when not in worktree
- Remove require_project_config() - inline error handling at call site
- Simplify remove_current_worktree() - use current_branch() directly
- Add integration tests for bare repository bootstrap workflow

Fixes #293

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-30 14:34:38 -08:00
Maximilian Roos c1ea17d1b4 Replace --force flag with --yes throughout codebase
Update documentation, tests, and snapshots to use the new `--yes` flag
instead of `--force`. The `--yes` flag is used to bypass approval prompts
and confirmations, while `--force` is now reserved for destructive
operations like forced file removal.
2025-12-30 14:22:38 -08:00
Maximilian Roos 212fcc9828 Remove unused demo helper functions
Remove setup_gh_mock, build_shell_env, clean_ansi_output, and
run_fish_script from the shared demo library along with their exports
from __init__.py. These functions are no longer used by any demo
recording scripts.
2025-12-30 14:00:24 -08:00
Maximilian Roos 1a9ce24f36 Separate --force into --yes (prompts) and --force (removal) (#311)
* Add --force flag to wt remove for worktrees with untracked files

The --force flag now also passes --force to git worktree remove,
allowing removal of worktrees containing untracked files like build
artifacts (.vite/, node_modules/, etc).

- Extended existing --force flag semantics (was: skip approval prompts)
- Added -f short form for convenience
- wt merge now always forces worktree removal (build artifacts unneeded post-merge)

Fixes #301

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Separate --force into --yes (prompts) and --force (removal)

The --force flag on wt remove had two meanings: skipping approval prompts
AND forcing worktree removal with untracked files. This was confusing and
potentially dangerous.

Now:
- --yes/-y: Skip approval prompts (all commands with prompts)
- --force/-f: Force worktree removal with untracked files (wt remove only)

This follows CLI conventions (apt, npm, etc.) where --yes skips prompts
and --force overrides safety checks.

Breaking change acceptable per project guidelines (early release mode).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix unit test for NotInteractive error message

Update test to check for --yes instead of --force.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-30 14:00:06 -08:00
Maximilian Roos 4cfa7611fa Remove demo output artifacts
Add docs/demos/out/ to .gitignore and delete generated files from
that directory including git objects, hooks, config files, mock
binaries, and demo recordings.
2025-12-30 12:40:07 -08:00
Maximilian Roos 4ba6fc2104 Add demo environment and GIF recordings
Add demo configuration files, mock CLI binaries, and recorded GIF
demonstrations for worktrunk-core showcase. Includes starship prompt
config, git repository structure, and tool mocks for cargo, npm, docker,
gh, and llm. Also updates theme colors and removes unnecessary asset
copying logic.
2025-12-30 12:40:07 -08:00
Maximilian Roos 52e18855fd Update dev server instructions with background execution note
Add guidance on running the dev server in the background and checking
the output for the server URL before proceeding with verification.
2025-12-30 12:40:07 -08:00
Maximilian Roos 7e5057b1ef Add --force flag to wt remove for worktrees with untracked files (#310)
The --force flag now also passes --force to git worktree remove,
allowing removal of worktrees containing untracked files like build
artifacts (.vite/, node_modules/, etc).

- Extended existing --force flag semantics (was: skip approval prompts)
- Added -f short form for convenience
- wt merge now always forces worktree removal (build artifacts unneeded post-merge)

Fixes #301

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-30 12:34:03 -08:00
Maximilian Roos 7aba503542 Consolidate demo assets to docs/static/assets/
- Move demo GIF output directory from docs/demos/out/ to docs/static/assets/
- Update build and publish scripts to use consolidated assets location
- Update .gitignore to reflect new assets path
- Document unified workflow for building and fetching demo assets
2025-12-30 12:05:12 -08:00
Maximilian Roos 10db3b0e28 Add publishing and fetching instructions for demo assets 2025-12-30 11:17:43 -08:00