wrk

module
v0.0.101 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: MIT

README

wrk

Git worktree helper for isolated feature branches. Create linked worktrees, manage dependencies, merge back, and inspect project status — without disturbing your main checkout.

Install

go install github.com/xhd2015/wrk/cmd/wrk@latest

Requires Go 1.25+ and git on PATH.

Quick start

wrk                              # create worktree from cwd
wrk -t 'fix login bug'           # append task slug to branch/dir names
wrk --done                       # merge back and remove worktree

Common commands

Command Purpose
wrk --status Status for git repos under this directory
wrk -l List worktrees
wrk --projects Recorded main repository paths
wrk --projects --github Same as --projects, only github.com origin remotes
wrk --where <basename> Look up saved project path(s)
wrk --main Nested shell at main repository root
wrk --bring p1 p2 Spawn one or more dependency worktrees under ./external; with create, apply inside the new worktree
wrk --dep-replace --undo Drop local filesystem go.mod replaces introduced since HEAD (undo uncommitted --bring / --dep-replace)
wrk --web Local web UI (React SPA + API on 127.0.0.1)

Run wrk -h for the full flag list.

Configuration

  • WRK_HOME — storage root (default: ~/.wrk). Holds worktrees, projects.json, events.jsonl, and config.json.
  • WRK_DATE — override the run date (YYYY-MM-DD) used in worktree/branch names.
  • wrk --set-config — manage create UX defaults (iTerm2, Mission Control, agent launch).

Bash tab-completion and auto-cd: wrk --bash-integration.

Dependencies

wrk is a standalone CLI that reuses shared libraries from dot-pkgs:

  • Go — github.com/xhd2015/dot-pkgs/go-pkgs (git, gotool, shell, pathfmt, …)
  • React — dot-pkgs/react shared components (routePrefix, API client) consumed by wrk-react/

Local development expects sibling checkouts:

$X/
├── wrk/
└── dot-pkgs/

go.mod includes replace github.com/xhd2015/dot-pkgs/go-pkgs => ../dot-pkgs/go-pkgs.

Development

# Build CLI
go build -o wrk ./cmd/wrk

# Unit tests
go test ./...

# Doctest integration suite
doctest test -v ./...

# Rebuild embedded web UI
./script/build-frontend.sh

# Dev server with HMR (requires bun)
wrk --web --dev
Project layout
cmd/wrk/          CLI entry + doctest tree
wrkcli/           Core logic, storage, wrkserver, embedded web/dist
wrk-react/        wrk web SPA (depends on dot-pkgs/react)
script/           Frontend build helper

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
wrk command
docs
skills/wrk
Package wrkskill embeds the wrk agent skill (docs/skills/wrk/SKILL.md).
Package wrkskill embeds the wrk agent skill (docs/skills/wrk/SKILL.md).
script
debug command
Command debug hosts local harnesses for manual wrk verification.
Command debug hosts local harnesses for manual wrk verification.
teapre
Package teapre must be imported before bubbletea so OSC background probes do not hang on PTYs that never answer (tty-watch, some CI harnesses).
Package teapre must be imported before bubbletea so OSC background probes do not hang on PTYs that never answer (tty-watch, some CI harnesses).
tui
Package tui implements the interactive Bubble Tea dashboard for bare `wrk`.
Package tui implements the interactive Bubble Tea dashboard for bare `wrk`.
web
Package web serves the wrk React SPA (wrk-react) and mounts wrkserver.
Package web serves the wrk React SPA (wrk-react) and mounts wrkserver.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL