@kianax/wt 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -0
- package/dist/cli.js +55224 -0
- package/package.json +76 -0
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# wt - Git Worktree Manager
|
|
2
|
+
|
|
3
|
+
A fast, simple CLI for managing git worktrees.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# npm
|
|
9
|
+
npm install -g @kianax/wt
|
|
10
|
+
|
|
11
|
+
# Or build from source (requires Bun)
|
|
12
|
+
bun install && bun run build
|
|
13
|
+
cp wt /usr/local/bin/
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
Add shell integration to your `.bashrc` or `.zshrc`:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
eval "$(wt shell-init bash)" # or zsh
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For fish, add to `~/.config/fish/config.fish`:
|
|
25
|
+
|
|
26
|
+
```fish
|
|
27
|
+
wt shell-init fish | source
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
wt # Open interactive TUI
|
|
34
|
+
wt new feature # Create new worktree
|
|
35
|
+
wt cd feature # Switch to worktree
|
|
36
|
+
wt rm feature # Remove worktree
|
|
37
|
+
wt list # List all worktrees
|
|
38
|
+
wt current # Show current worktree name
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### TUI Keybindings
|
|
42
|
+
|
|
43
|
+
| Key | Action |
|
|
44
|
+
|-----|--------|
|
|
45
|
+
| `j/k` or arrows | Navigate |
|
|
46
|
+
| `Enter` | Switch to worktree |
|
|
47
|
+
| `n` | New worktree |
|
|
48
|
+
| `d` | Delete worktree |
|
|
49
|
+
| `r` | Rename worktree |
|
|
50
|
+
| `q` | Quit |
|
|
51
|
+
|
|
52
|
+
## How It Works
|
|
53
|
+
|
|
54
|
+
Worktrees are stored in `~/.worktrees/<repo-id>/` by default. Each worktree gets its own directory with a branch of the same name.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
~/.worktrees/
|
|
58
|
+
github.com-user-repo/
|
|
59
|
+
feature-auth/
|
|
60
|
+
bugfix-login/
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
|
|
65
|
+
Create `~/.config/wt/config.json` for global settings:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"defaults": {
|
|
70
|
+
"branchPrefix": "feature/"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Or `.wtrc.json` in your repo for per-project settings.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|