11# Worktee
22
3- ` wtt ` is a safe Git worktree manager for Linux and macOS. It indexes repositories, provides fast
3+ ` wtt ` is a Git worktree manager: index worktrees, fast interactive
44fuzzy switching and a full-screen dashboard, creates managed worktrees, and plans removals and
55pruning without weakening Git safety checks.
66
7- The project is under active, pre-release development. The core CLI, incremental indexing daemon,
8- interactive picker, Mission dashboard, GitHub provider integration, and safety-planned mutations
9- are implemented. Release hardening is still in progress; see
10- [ ` PLAN.md ` ] ( PLAN.md ) and [ ` ISSUES.md ` ] ( ISSUES.md ) for current status.
11-
12- Windows support is deferred until process-tree cleanup and shell integration can provide the same
13- safety guarantees.
14-
157## Install
168
17- WTT currently installs from source. It requires Git and the Rust toolchain pinned by this
18- repository. Clone the repository, then run:
9+ WTT requires Git and a Rust toolchain. Install the published crate with:
1910
2011``` sh
21- cargo install --path . --locked
12+ cargo install worktee
2213```
2314
24- This installs the ` wtt ` binary. GitHub pull-request status is optional and uses the authenticated
25- [ ` gh ` ] ( https://cli.github.com/ ) CLI; all local worktree features continue to work without it .
15+ To install the current source checkout instead, run ` cargo install --path . --locked ` from the
16+ repository root .
2617
27- The first interactive non-metadata command prompts for scan roots before creating an editable,
28- commented default configuration. Its removable ` ~/ghq ` suggestion is inspired by
29- [ ghq] ( https://github.com/x-motemen/ghq ) , a lovely tool for organizing remote repository clones.
30- Non-interactive first runs retain an empty scan-root list. The generated file includes
31- schema-derived section and setting guidance and labels normal intent separately from advanced
32- safety controls. An explicitly supplied, missing ` --config ` path remains an error.
18+ Both methods install the ` wtt ` binary. GitHub pull-request status is optional and uses the
19+ authenticated [ ` gh ` ] ( https://cli.github.com/ ) CLI; all local worktree features continue to work
20+ without it.
3321
3422## Quick start
3523
36- Tell WTT where your repositories live. Values use TOML syntax, so replace the example with one or
37- more absolute paths :
24+ Run WTT and follow the setup wizard. It creates an editable, commented configuration and asks which
25+ folders contain your Git repositories :
3826
3927``` sh
40- wtt config set scan_roots ' ["/path/to/repos"] '
28+ wtt
4129```
4230
43- Start the daemon, wait for the initial scan, and inspect the index:
31+ WTT starts the daemon automatically. Wait for the initial scan, then inspect the index:
4432
4533``` sh
46- wtt daemon start --detach --if-needed
4734wtt scan --wait
4835wtt list --all
4936```
5037
51- Install shell integration so ` wtt switch ` can change the directory of your current shell:
38+ ## Shell integration
5239
53- ``` sh
54- # Bash: add to ~/.bashrc
55- eval " $( wtt shell init bash) "
40+ Plug into your configuration
5641
57- # Zsh: add to ~/.zshrc
58- eval " $( wtt shell init zsh) "
42+ ``` bash
43+ wtt shell init < bash| fish| zsh> # required for the switcher to work
44+ ```
5945
60- # Fish: add to ~/.config/fish/config.fish
61- wtt shell init fish | source
46+ ``` bash
47+ wtt shell completions < bash | fish| zsh > # optional
6248```
6349
64- Restart the shell or source its startup file, then try:
50+ St
6551
6652``` sh
6753wtt switch
@@ -118,95 +104,20 @@ wtt create feature-api --new-branch feature/api
118104wtt tui
119105```
120106
121- Mission is the global repository and worktree inventory. It starts with a focused view of active or
122- uncertain pull-request work and hides quiet main worktrees. Use ` Show all ` or clear the filter chips
123- to reveal the complete index.
107+ Mission is the global repository and worktree inventory. It starts with a focused view of active worktrees.
108+ Use ` Show all ` or clear the filter chips to reveal the complete index.
124109
125- Useful default controls include:
126-
127- - ` j ` / ` k ` : move through rows;
128- - ` / ` : search with fuzzy text and structured filters;
129- - ` Enter ` : inspect the selected worktree and its actions;
130- - ` ? ` or ` Ctrl-P ` : open Commands;
131- - ` , ` / ` s ` : change grouping or sorting;
132- - ` r ` / ` R ` : refresh the current or visible provider state;
133- - ` ! ` : open diagnostics;
134- - ` q ` : quit.
135-
136- Run ` wtt config reference ` to see every stable TUI action name and its bindings. Bindings can be
137- replaced under ` [tui.bindings] ` ; an empty list intentionally leaves an action unbound while keeping
138- it available in Commands.
110+ Use ` ctrl-P ` to reveal actions and shortkeys, further configurable through the config file.
139111
140112### Remove and prune safely
141113
142- Preview the validated plan before removing a worktree:
143-
144- ``` sh
145- wtt remove feature --dry-run
146- wtt remove feature --yes
147- ```
148-
149- Preview repository-wide pruning using provider or exact Git integration proofs:
150-
151- ``` sh
152- wtt prune --merged-pr --dry-run
153- wtt prune --merged-into --dry-run
154- wtt prune --merged-into release/1.x --include-unmerged --dry-run --json
155- wtt prune --all-repositories --merged-pr --merged-into --yes
156- ```
157-
158- Interactive mutations require confirmation; redirected mutations require ` --yes ` . ` --yes ` skips
159- the prompt but never relaxes a safety check. Named overrides such as ` --allow-dirty ` ,
160- ` --allow-locked ` , and prune-only ` --allow-unpushed ` relax only their stated refusal. WTT never
161- removes the main worktree, and removal retains the local branch.
162-
163- ` --merged-into ` without a branch uses each repository's structural main-worktree branch; an explicit
164- value names an exact local branch. Selectors form a union. Ancestry-only pruning is fully local and
165- does not contact a provider. ` --include-unmerged ` requires decisive Git and provider assessment and
166- always retains the candidate branch, as does detached selection.
167-
168- The dashboard exposes the same planners. Remove and prune show their exact eligible targets and
169- revalidate the confirmed plan at the mutation boundary.
170-
171- ### Refresh GitHub state
114+ Prune worktrees matching certain criteria with ` wtt prune ` .
172115
173- WTT discovers GitHub pull requests through ` gh ` , using each branch's effective fetch and push
174- remotes. Provider failures never hide local worktrees, and unknown, unavailable, stale, and known
175- absence remain distinct states.
176-
177- ``` sh
178- wtt refresh # current worktree
179- wtt refresh feature # exact worktree
180- wtt refresh --repository
181- wtt refresh --all
182-
183- wtt list --provider-refresh never
184- wtt list --provider-refresh all
185- wtt scan --refresh --wait # local scan plus complete provider refresh
186- ```
187-
188- Provider collection runs only in the daemon. Read commands retain cached rows and report
189- ` MAYBE_STALE ` when the daemon or validation coverage is unavailable; explicit refresh and prune
190- fail rather than silently falling back to client-side provider work.
116+ - See ` --help ` for filters and options.
117+ - Supports ` --dry-run `
191118
192119## Configuration and daemon operation
193120
194- The first non-metadata command creates an editable, commented configuration when the default file
195- does not exist. It starts with no scan roots. An explicitly supplied missing ` --config ` path is an
196- error.
197-
198- ``` sh
199- wtt config show
200- wtt config get provider.timeout_seconds
201- wtt config set provider.timeout_seconds 20
202- wtt config path
203- wtt config validate
204- wtt config reference
205- ```
206-
207- Updates use stable dotted keys, validate the complete configuration, and atomically replace the
208- file only after validation succeeds.
209-
210121Default paths follow XDG conventions on Linux and macOS:
211122
212123- configuration: ` $XDG_CONFIG_HOME/wtt/config.toml ` , normally ` ~/.config/wtt/config.toml ` ;
@@ -218,18 +129,6 @@ The daemon owns filesystem discovery and provider synchronization. Snapshot read
218129` list ` , switching, completion, and the dashboard remain responsive and never start a filesystem
219130scan themselves.
220131
221- ``` sh
222- wtt daemon start --detach --if-needed
223- wtt daemon status
224- wtt scan
225- wtt scan --wait
226- wtt daemon stop
227- ```
228-
229- Set ` daemon.auto_start = true ` to let snapshot readers start a missing daemon. By default, this is
230- disabled. For a user service manager, run ` wtt daemon start ` in the foreground, restart it on
231- failure, and send ` SIGTERM ` for shutdown. WTT does not install service definitions.
232-
233132` wtt doctor ` performs read-only checks of configuration, scan roots, the index, daemon, Git,
234133watchers, and shell integration:
235134
@@ -239,41 +138,18 @@ wtt doctor --provider
239138wtt doctor --json
240139```
241140
242- Doctor reports problems and recovery guidance but never repairs state.
243-
244- Fatal human diagnostics separate the failed condition from one deterministic recovery action. The
245- stable ` wtt::... ` code identifies the concrete condition, the primary message states what failed,
246- and an optional ` help: ` section gives the next safe command or decision. WTT omits a hint when it
247- cannot prove one is appropriate, and never writes human hints to JSON or machine-protocol stdout.
248- For example, an exact switch miss may suggest a normalized logical name, a matching global target,
249- an already attached branch's worktree, or a live-preflighted ` wtt switch -c ` command—in that order.
250- Known collisions never receive a creation command.
251-
252- If ` doctor ` reports an index created by a newer WTT version, upgrade WTT; an older binary must not
253- rebuild that index. For a corrupt, unversioned, or otherwise incompatible index, first use ` doctor `
254- to identify the database and state paths. Stop the owning daemon, copy the complete state directory
255- to a backup, and move the database plus any same-named ` -wal ` and ` -shm ` files into a separate
256- retained backup location. Then start the daemon and run ` wtt scan --wait ` to rebuild the index from
257- Git and filesystem authority. Do not delete the old files. Apply the same steps to a custom
258- ` --database ` path at the location reported by ` doctor ` .
259-
260141## Shell completions
261142
262- Generate completions from the current command graph:
263-
264- ``` sh
265- wtt shell completions bash > ~/.local/share/bash-completion/completions/wtt
266- wtt shell completions zsh > ~/.local/share/zsh/site-functions/_wtt
267- wtt shell completions fish > ~/.config/fish/completions/wtt.fish
268- ```
143+ ` wtt shell completions SHELL ` generates completions from the current command graph. Use the shell
144+ name and destination listed in Quick start.
269145
270146Create the destination directory first if necessary. WTT prints scripts but never edits shell
271147configuration. Dynamic completions use cached index data only; they do not scan, contact providers,
272148start the daemon, or create persistent state.
273149
274150## Repository hooks
275151
276- Place executable setup files in ` .wtt/hooks/post-create ` , then install and trust their exact
152+ Place executable setup files in ` .wtt/hooks/post-create ` , then install and trust their
277153contents from any worktree in the repository:
278154
279155``` sh
@@ -287,40 +163,3 @@ reinstalling a hook changes its digest and requires trust again; `wtt hooks revo
287163
288164If Git creation succeeds but hook approval or execution fails, WTT preserves the new worktree and
289165reports its recovery path.
290-
291- ## Safety model
292-
293- WTT treats filesystems, Git, subprocesses, provider tools, caches, and cancellation as fallible:
294-
295- - filesystem discovery preserves the last authoritative snapshot when a scan is partial;
296- - mutations use typed safety plans and revalidate immediately before changing Git state;
297- - cancellation and timeouts terminate bounded subprocess trees without publishing partial state;
298- - cached state is never presented as authoritative when validation or watcher coverage is missing;
299- - optional provider integration degrades without disabling local worktree operations;
300- - machine output uses versioned, byte-safe JSON schemas and keeps diagnostics off stdout.
301-
302- For the complete behavioral contract, see [ ` SPEC.md ` ] ( SPEC.md ) .
303-
304- ## Development
305-
306- The repository pins its Rust toolchain. Keep build and test artifacts in the default ` ./target `
307- directory.
308-
309- ``` sh
310- cargo build
311- cargo fmt --all -- --check
312- cargo clippy --all-targets --all-features -- -D warnings
313- cargo test --all-targets
314- git diff --check
315- ```
316-
317- Useful development overrides are available without changing the normal user configuration:
318-
319- ``` sh
320- cargo run -- --config /tmp/wtt.toml --database /tmp/wtt.sqlite3 daemon start
321- ```
322-
323- Architecture and delivery sequencing are documented in
324- [ ` PLAN.md ` ] ( PLAN.md ) . Focused design documents live under
325- [ ` docs/ ` ] ( docs/ ) , and verified residual defects and unresolved product decisions live in
326- [ ` ISSUES.md ` ] ( ISSUES.md ) .
0 commit comments