Skip to content

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

Update mock CLI paths to use ~/.local/bin

Maximilian Roos72b5b9faec16
diff --git a/docs/demos/build b/docs/demos/build
index 70d39e392..46ef83be2 100755
--- a/docs/demos/build
+++ b/docs/demos/build
@@ -156,7 +156,7 @@ url = "http://localhost:{{{{ branch | hash_port }}}}"
_write_user_config(env, [dev_cmd])
# Override npm mock to start nc listener so URL appears active
- npm_mock = env.home / "bin" / "npm"
+ npm_mock = env.home / ".local" / "bin" / "npm"
npm_mock.write_text("""#!/bin/bash
if [[ "$1" == "run" && "$2" == "dev" ]]; then
PORT="$5"
@@ -197,7 +197,7 @@ url = "http://localhost:{{ branch | hash_port }}"
git(["-C", str(env.repo), "config", "color.ui", "always"])
# Override llm mock with different commit message for this demo
- llm_mock = env.home / "bin" / "llm"
+ llm_mock = env.home / ".local" / "bin" / "llm"
llm_mock.write_text("""#!/bin/bash
sleep 0.5
echo "feat: add user settings module"
@@ -229,7 +229,7 @@ echo "Add placeholder module for user profile settings."
demo_env = {
**os.environ,
"HOME": str(env.home),
- "PATH": f"{REPO_ROOT}/target/debug:{env.home}/bin:{os.environ.get('PATH', '')}"
+ "PATH": f"{REPO_ROOT}/target/debug:{env.home}/.local/bin:{os.environ.get('PATH', '')}"
}
def run_wt(args, cwd):
@@ -350,7 +350,7 @@ def spawn_debug_shell(env: DemoEnv, starship_config: Path):
"HOME": str(env.home),
"XDG_CONFIG_HOME": str(env.home / ".config"),
"STARSHIP_CONFIG": str(starship_config),
- "PATH": f"{REPO_ROOT / 'target' / 'debug'}:{env.home / 'bin'}:{os.environ.get('PATH', '')}",
+ "PATH": f"{REPO_ROOT / 'target' / 'debug'}:{env.home / '.local' / 'bin'}:{os.environ.get('PATH', '')}",
# Keep real rustup/cargo for any rust tools
"RUSTUP_HOME": str(Path.home() / ".rustup"),
"CARGO_HOME": str(Path.home() / ".cargo"),
diff --git a/docs/demos/shared/lib.py b/docs/demos/shared/lib.py
index 79e35d3ef..1030cf6dc 100644
--- a/docs/demos/shared/lib.py
+++ b/docs/demos/shared/lib.py
@@ -204,7 +204,7 @@ def prepare_base_repo(env: DemoEnv, repo_root: Path):
git(["-C", str(env.repo), "push", "-q"])
# Mock CLI tools
- bin_dir = env.home / "bin"
+ bin_dir = env.home / ".local" / "bin"
bin_dir.mkdir(parents=True, exist_ok=True)
# bat wrapper for syntax highlighting (alias cat to bat for toml files)
@@ -291,6 +291,14 @@ def setup_claude_code_config(
"projects": projects_config
}, indent=2))
+ # Copy claude binary to prevent "installMethod is native" warnings
+ # Claude Code detects native install by checking if ~/.local/bin/claude exists
+ local_bin = env.home / ".local" / "bin"
+ local_bin.mkdir(parents=True, exist_ok=True)
+ real_claude = REAL_HOME / ".local" / "bin" / "claude"
+ if real_claude.exists():
+ shutil.copy(real_claude.resolve(), local_bin / "claude")
+
# Claude settings.json
claude_dir = env.home / ".claude"
claude_dir.mkdir(exist_ok=True)
@@ -446,7 +454,7 @@ def setup_mock_clis(env: DemoEnv) -> None:
Creates mocks for: npm, docker, flyctl, llm, cargo.
Each mock handles all cases - demos just use the branches they need.
"""
- bin_dir = env.home / "bin"
+ bin_dir = env.home / ".local" / "bin"
bin_dir.mkdir(parents=True, exist_ok=True)
# npm mock - handles install, build, dev (with optional port)
@@ -558,7 +566,7 @@ def prepare_demo_repo(env: DemoEnv, repo_root: Path, hooks_config: str = None):
git(["-C", str(env.repo), "push", "-q"])
# Mock gh CLI with varied CI status per branch
- bin_dir = env.home / "bin"
+ bin_dir = env.home / ".local" / "bin"
gh_mock = bin_dir / "gh"
shutil.copy(FIXTURES_DIR / "gh-mock.sh", gh_mock)
gh_mock.chmod(0o755)
diff --git a/docs/demos/tapes/shared-commands.tape b/docs/demos/tapes/shared-commands.tape
index ac5ec5578..c224068b6 100644
--- a/docs/demos/tapes/shared-commands.tape
+++ b/docs/demos/tapes/shared-commands.tape
@@ -15,7 +15,7 @@ Type "set -g fish_autosuggestion_enabled 0"
Enter
Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"
Enter
-Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"
+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/.local/bin $PATH"
Enter
Type "starship init fish | source"
Enter