Skip to content

v0.4.2

Latest

Choose a tag to compare

@nusje2000 nusje2000 released this 20 Mar 16:21
· 3 commits to main since this release

New Commands

  • worktree dotenv — Manage .env files in worktrees

    • worktree dotenv set PORT=3000 — Set environment variables (supports KEY VALUE and KEY=VALUE syntax)
    • worktree dotenv get PORT — Read values from .env files
    • --worktree <name> to target a specific worktree, --file to use a custom env file path
  • worktree cp — Copy files and directories between worktrees

    • worktree cp .env — Copy from main repo to current worktree
    • --from / --to to specify source and destination worktrees
    • --force to overwrite existing files
    • --skip-if-not-exists to silently skip missing source files
    • --create-if-not-exists to create an empty file if source is missing
    • --reverse to swap source and destination
    • Supports recursive directory copying
  • worktree path — Print the filesystem path of a worktree

New Features

  • --no-ai flag for init — Generates template scripts without calling the Claude CLI (worktree init --defaults --no-ai). Useful in CI, testing, and environments without Claude access. Distinct from --no-scripts which skips script generation entirely.
  • Linux support — Terminal detection and launching now works on Linux (GNOME Terminal, Konsole, Kitty, Alacritty, Xfce Terminal)

Improvements

  • Improved setup script templates — Default setup.sh now includes commented examples for worktree cp (copying .env, config files) and worktree dotenv set (configuring ports and database URLs using allocated worktree ports)
  • Deduplicated command logic — Shared worktree resolution, removal, and listing logic extracted into commands/common.rs, reducing code duplication across close, cleanup, open, rename, list, and status
  • Fixed install script for improved reliability

Testing

  • 46 integration tests across 12 test files covering every testable command (init, new, list, status, path, close, rename, dotenv, run, stop, cp, completions)
  • Tests verify both CLI output and filesystem side-effects (created files, JSON content, port allocations, file permissions, git branches)
  • Fully isolated TestEnv helper with fake $HOME, pre-seeded config, and disposable git repos