https://github.com/trungung/wt
Opinionated Go CLI for branch-first git worktree management—create, exec, and safely prune isolated environments with automation-friendly defaults.
https://github.com/trungung/wt
cli git git-worktree go golang multi-agent productivity
Last synced: 9 days ago
JSON representation
Opinionated Go CLI for branch-first git worktree management—create, exec, and safely prune isolated environments with automation-friendly defaults.
- Host: GitHub
- URL: https://github.com/trungung/wt
- Owner: trungung
- License: mit
- Created: 2026-01-06T01:07:51.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-01-10T18:52:18.000Z (about 1 month ago)
- Last Synced: 2026-01-11T05:35:39.963Z (about 1 month ago)
- Topics: cli, git, git-worktree, go, golang, multi-agent, productivity
- Language: Go
- Homepage:
- Size: 2.07 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# wt
**An opinionated git worktree manager**
`wt` manages git worktrees using branch names instead of paths. Create worktrees,
run commands in isolated environments, and clean up safely.
[](LICENSE)
[](https://golang.org)
[](https://github.com/trungung/wt/releases)
---
## What is wt?
`wt` is a CLI for git worktree management. Use branch names to create worktrees,
execute commands in them, and remove them when done.
Built for multi-branch workflows and AI-assisted development.
## Why use `wt`?
- **Multi-branch workflows:** Run commands in multiple worktrees from your main terminal
- **Safe cleanup:** Won't delete worktrees with uncommitted changes
- **Automatic setup:** New branches copy config files and run setup commands
- **Multi-agent support:** AI agents work in isolated environments while you stay in your main repo
See [Multi-Agent Workflows](docs/user/guides/multi-agent-workflow.md) for details.
## Quick Start
### 1. Install
**Recommended** - Install via Homebrew (handles PATH + completions):
```bash
brew tap trungung/wt
brew install wt
```
Homebrew installs completion files automatically, but you still need `eval "$(wt shell-setup)"` to enable the `wt cd` wrapper.
**Alternative** - Install via Go:
```bash
go install github.com/trungung/wt/cmd/wt@latest
```
For binary downloads (macOS/Linux), see [GitHub Releases](https://github.com/trungung/wt/releases).
If installing via Go or binary, add `wt` to your PATH (see quick PATH snippet in the Quickstart) and follow [Shell Setup](docs/user/guides/quickstart.md#shell-setup-completions--navigation) to enable completions and `wt cd`.
### 2. Initialize
Run this in your main repository to create the local configuration file `.wt.config.json`:
```bash
wt init
```
### 3. Use Worktrees
Create a worktree for a new branch, execute commands inside it, and remove it when done:
| Command | Action |
| :------------------------------------ | :--------------------------------------------- |
| `wt feature/payment` | Create worktree at `./repo.wt/feature-payment` |
| `(cd "$(wt feature/payment)" && npm test)` | Run command in the worktree directory |
| `wt prune` | Automatically remove merged worktrees |
### 4. Easy Navigation (Recommended)
Set up seamless navigation to worktrees:
```bash
# One-time setup
eval "$(wt shell-setup)"
# Now navigate easily
wt cd feature/new-auth # Creates worktree if needed and changes directory
```
The `wt cd` command creates the worktree (if needed) and changes your shell's working directory to it. Supported shells: zsh, bash, fish.
For comprehensive setup and examples, see the [Quickstart Guide](docs/user/guides/quickstart.md).
---
## Documentation
- **[Quickstart Guide](docs/user/guides/quickstart.md)** – Installation, setup, and examples
- **[Multi-Agent Workflows](docs/user/guides/multi-agent-workflow.md)** – Parallel development and AI agent workflows
- **[API Reference](docs/user/api-references/index.md)** – Detailed command documentation
- **[Configuration Reference](docs/user/api-references/configuration.md)** – All configuration options explained
## Contributing
Contributions are welcome! Please see the [developer documentation](docs/developer/) for guidelines.
## License
`wt` is released under the [MIT License](LICENSE).