oh-my-worktree 0.10.2 → 0.14.1
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 +163 -52
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,100 +1,211 @@
|
|
|
1
1
|
# owt (oh-my-worktree)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[한국어](./README.ko.md) | [English](./README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A fast terminal UI for developers who use Git branches as working contexts, not bookmarks.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<img width="786" height="580" alt="Image" src="./owt.png" />
|
|
8
|
+
|
|
9
|
+
## Why owt exists
|
|
10
|
+
|
|
11
|
+
Modern development rarely happens on one branch at a time. You might be reviewing a PR, testing a hotfix, keeping a long-running feature open, and checking main before a release. Plain `git switch` makes that workflow expensive because every context switch drags along uncommitted files, dependencies, editor state, and mental state.
|
|
12
|
+
|
|
13
|
+
Git worktrees solve the underlying problem. `owt` makes them easy enough to use every day.
|
|
14
|
+
|
|
15
|
+
Open `owt`, pick a worktree, create another one, delete the stale ones, fetch, pull, push, or merge without remembering the exact Git incantation. It works from a normal repository and from the `.bare` layout if you prefer keeping all worktrees side by side.
|
|
16
|
+
|
|
17
|
+
## What you get
|
|
18
|
+
|
|
19
|
+
- A keyboard-first TUI for browsing and managing worktrees
|
|
20
|
+
- First-class support for existing regular repositories
|
|
21
|
+
- Optional `.bare` project layout for teams that like sibling worktrees
|
|
22
|
+
- Fast worktree creation from local or remote branches
|
|
23
|
+
- Dirty-state, ahead/behind, last-commit, and GitHub PR status visibility
|
|
24
|
+
- Built-in fetch, pull, push, upstream merge, branch merge, editor open, terminal open, and path copy
|
|
25
|
+
- Shell integration so `Enter` can move your shell into the selected worktree
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
Current release with Cargo (`v0.13.0`):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cargo install --git https://github.com/dding-g/oh-my-worktree --tag v0.13.0 --force
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Prebuilt binaries are attached to the latest [GitHub Release](https://github.com/dding-g/oh-my-worktree/releases/latest).
|
|
36
|
+
|
|
37
|
+
This npm wrapper is also supported when the npm registry package is current:
|
|
8
38
|
|
|
9
39
|
```bash
|
|
10
40
|
npm install -g oh-my-worktree
|
|
11
41
|
```
|
|
12
42
|
|
|
13
|
-
|
|
43
|
+
From source:
|
|
14
44
|
|
|
15
45
|
```bash
|
|
16
|
-
|
|
46
|
+
git clone https://github.com/dding-g/oh-my-worktree.git
|
|
47
|
+
cd oh-my-worktree
|
|
48
|
+
cargo build --release
|
|
17
49
|
```
|
|
18
50
|
|
|
19
|
-
##
|
|
51
|
+
## Start from the repo you already have
|
|
52
|
+
|
|
53
|
+
You do not need to convert your repository.
|
|
20
54
|
|
|
21
55
|
```bash
|
|
22
|
-
|
|
23
|
-
cd /path/to/regular-git-repo
|
|
56
|
+
cd ~/src/my-app
|
|
24
57
|
owt
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
In a regular repository, new worktrees are created under:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
~/.owt/worktree/<repo-name>/
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Set `worktree_root` if you want them somewhere else.
|
|
67
|
+
|
|
68
|
+
## Or start with a `.bare` workspace
|
|
25
69
|
|
|
26
|
-
|
|
70
|
+
If you like all worktrees living inside one project folder, use `owt clone`.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
27
73
|
owt clone https://github.com/user/repo.git
|
|
28
74
|
cd repo/main
|
|
75
|
+
owt
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
That creates a layout like this:
|
|
29
79
|
|
|
30
|
-
|
|
80
|
+
```text
|
|
81
|
+
repo/
|
|
82
|
+
├── .bare/
|
|
83
|
+
├── main/
|
|
84
|
+
├── feature-login/
|
|
85
|
+
└── hotfix-api/
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`owt init` prints a conversion guide if you want to move an existing repository into this layout manually.
|
|
89
|
+
|
|
90
|
+
## Daily workflow
|
|
91
|
+
|
|
92
|
+
```bash
|
|
31
93
|
owt
|
|
32
94
|
```
|
|
33
95
|
|
|
34
|
-
|
|
96
|
+
Then use the TUI:
|
|
35
97
|
|
|
36
|
-
### Navigation
|
|
37
98
|
| Key | Action |
|
|
38
|
-
|
|
39
|
-
| `j` /
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `G` | Jump to bottom |
|
|
44
|
-
| `/` | Search/filter |
|
|
45
|
-
|
|
46
|
-
### Worktree Actions
|
|
47
|
-
| Key | Action |
|
|
48
|
-
|-----|--------|
|
|
49
|
-
| `Enter` | Enter selected worktree |
|
|
50
|
-
| `a` | Add new worktree |
|
|
51
|
-
| `d` | Delete worktree |
|
|
52
|
-
| `o` | Open in editor |
|
|
53
|
-
| `t` | Open in terminal |
|
|
54
|
-
| `y` | Copy path to clipboard |
|
|
55
|
-
|
|
56
|
-
### Other
|
|
57
|
-
| Key | Action |
|
|
58
|
-
|-----|--------|
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `j` / `k` | Move selection |
|
|
101
|
+
| `Enter` | Enter the selected worktree |
|
|
102
|
+
| `a` | Add a worktree |
|
|
103
|
+
| `d` | Delete a worktree |
|
|
59
104
|
| `f` | Fetch remotes |
|
|
60
|
-
| `
|
|
105
|
+
| `p` / `P` | Pull / push |
|
|
106
|
+
| `m` / `M` | Merge upstream / merge selected branch |
|
|
107
|
+
| `o` / `t` | Open in editor / terminal |
|
|
108
|
+
| `y` | Copy path |
|
|
109
|
+
| `/` | Filter |
|
|
61
110
|
| `s` | Cycle sort mode |
|
|
62
|
-
| `c` |
|
|
63
|
-
| `?` |
|
|
111
|
+
| `c` | View config |
|
|
112
|
+
| `?` | Help |
|
|
64
113
|
| `q` | Quit |
|
|
65
114
|
|
|
66
|
-
##
|
|
115
|
+
## What the list tells you
|
|
116
|
+
|
|
117
|
+
| Signal | Meaning |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| `✓ clean` | No local changes |
|
|
120
|
+
| `+ staged` | Staged changes |
|
|
121
|
+
| `~ unstaged` | Unstaged changes |
|
|
122
|
+
| `! conflict` | Merge conflict |
|
|
123
|
+
| `* mixed` | Staged and unstaged changes |
|
|
124
|
+
| `↑N` / `↓N` | Ahead / behind upstream |
|
|
125
|
+
| `PR` | GitHub PR state: `open`, `closed`, `merged`, `draft`, or `-` |
|
|
126
|
+
|
|
127
|
+
The `PR` column is GitHub-only and best-effort. No PR, non-GitHub remotes, missing auth, network failures, and unknown states all show `-` so the worktree list stays fast and reliable.
|
|
128
|
+
|
|
129
|
+
## Plain CLI for agents
|
|
130
|
+
|
|
131
|
+
Use noun command groups when you need stable, non-TUI output:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
owt worktree list
|
|
135
|
+
owt worktree create feature/login --base main
|
|
136
|
+
owt worktree delete feature/login --branch --force
|
|
137
|
+
owt worktree prune
|
|
138
|
+
owt worktree prune --dry-run
|
|
139
|
+
owt pr status --branch feature/login
|
|
140
|
+
owt commit tree -n 12
|
|
141
|
+
owt search login
|
|
142
|
+
```
|
|
67
143
|
|
|
68
|
-
|
|
144
|
+
Agent bootstrap assets are versioned in the repository under `.agents/`: use `.agents/prompts/install-owt.md`, `.agents/skills/owt-install/SKILL.md`, and `.agents/skills/owt-worktree/SKILL.md` so worktree handling goes through `owt`.
|
|
69
145
|
|
|
70
|
-
|
|
146
|
+
`worktree prune` logs every worktree decision as tab-separated output. Normal mode removes non-current clean worktrees whose branch is already merged into `HEAD`, except the `HEAD` branch worktree itself; `--dry-run` previews stale metadata pruning, prompts through removable candidates, and records selected candidates without deleting them.
|
|
71
147
|
|
|
72
|
-
|
|
73
|
-
|------|---------|
|
|
74
|
-
| `✓` | Clean |
|
|
75
|
-
| `+` | Staged changes |
|
|
76
|
-
| `~` | Unstaged changes |
|
|
77
|
-
| `!` | Conflicts |
|
|
78
|
-
| `*` | Staged + Unstaged |
|
|
148
|
+
## Shell integration
|
|
79
149
|
|
|
80
|
-
|
|
150
|
+
Install the shell helper:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
owt setup
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Reload your shell. After that, pressing `Enter` in the TUI exits `owt` and moves the current shell into the selected worktree. When you create a worktree from the TUI, `owt` exits the TUI first, creates the worktree, runs copy/post-add/tmux steps in the normal terminal, then hands off to the new worktree path. Without shell integration, `owt` still prints the target path for wrapper scripts and manual use.
|
|
81
157
|
|
|
82
158
|
## Configuration
|
|
83
159
|
|
|
84
|
-
Config file:
|
|
160
|
+
Config file:
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
~/.config/owt/config.toml
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Example:
|
|
85
167
|
|
|
86
168
|
```toml
|
|
87
169
|
editor = "code"
|
|
88
170
|
terminal = "Ghostty"
|
|
89
171
|
worktree_root = "~/.owt/worktree"
|
|
90
172
|
copy_files = [".env", ".envrc"]
|
|
173
|
+
post_add_script = ".owt/post-add.sh"
|
|
174
|
+
tmux_worktree_mode = false
|
|
175
|
+
run_post_add_script_in_tmux = false
|
|
91
176
|
```
|
|
92
177
|
|
|
178
|
+
Useful options:
|
|
179
|
+
|
|
180
|
+
| Option | Purpose |
|
|
181
|
+
| --- | --- |
|
|
182
|
+
| `editor` | Command used by `o` |
|
|
183
|
+
| `terminal` | Terminal app used by `t` |
|
|
184
|
+
| `worktree_root` | Root for new worktrees in regular repositories |
|
|
185
|
+
| `copy_files` | Files copied into new worktrees. Only files are copied; copy problems are shown as warnings after creation. |
|
|
186
|
+
| `post_add_script` | Script path for post-add setup. Relative paths use the current effective project root. |
|
|
187
|
+
| `tmux_worktree_mode` | Open a tmux pane in each new worktree and focus an existing matching pane on `Enter`. |
|
|
188
|
+
| `run_post_add_script_in_tmux` | Run the post-add script in detached tmux after creating a worktree. Only global config can enable this. |
|
|
189
|
+
|
|
190
|
+
Project config in `.owt/config.toml` can override safe values, including `post_add_script`, but it cannot enable automatic post-add execution. A regular linked worktree only reads its own project config; it does not inherit an ancestor `.owt/config.toml`.
|
|
191
|
+
|
|
192
|
+
## Commands
|
|
193
|
+
|
|
194
|
+
| Command | Purpose |
|
|
195
|
+
| --- | --- |
|
|
196
|
+
| `owt [PATH]` | Open the TUI for a repository or worktree |
|
|
197
|
+
| `owt clone <URL> [PATH]` | Clone into the `.bare` layout and create the first worktree |
|
|
198
|
+
| `owt init` | Print a manual conversion guide for `.bare` layout |
|
|
199
|
+
| `owt setup` | Install shell integration |
|
|
200
|
+
| `owt --version` | Print version |
|
|
201
|
+
|
|
93
202
|
## Requirements
|
|
94
203
|
|
|
95
|
-
- Git 2.5+
|
|
96
|
-
- A Git repository
|
|
204
|
+
- Git 2.5+
|
|
205
|
+
- A regular Git repository or a `.bare` worktree layout
|
|
206
|
+
- Optional: GitHub CLI `gh` for PR status
|
|
207
|
+
- Optional: tmux for worktree pane mode and post-add setup scripts
|
|
97
208
|
|
|
98
|
-
##
|
|
209
|
+
## License
|
|
99
210
|
|
|
100
|
-
|
|
211
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-worktree",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "A TUI tool for managing Git worktrees in bare and regular repositories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/dding-g/oh-my-worktree"
|
|
22
22
|
},
|
|
23
|
-
"homepage": "https://
|
|
23
|
+
"homepage": "https://dding-g.github.io/oh-my-worktree/",
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/dding-g/oh-my-worktree/issues"
|
|
26
26
|
},
|