vde-worktree 0.0.4 → 0.0.6

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.ja.md CHANGED
@@ -3,6 +3,7 @@
3
3
  `vde-worktree` は、人間とコーディングエージェントの両方を想定した、安全な Git worktree 管理 CLI です。
4
4
 
5
5
  利用できるコマンド名:
6
+
6
7
  - `vde-worktree`
7
8
  - `vw`(エイリアス)
8
9
 
@@ -122,6 +123,7 @@ vw init
122
123
  ```
123
124
 
124
125
  機能:
126
+
125
127
  - `.worktree/` と `.vde/worktree/*` を作成
126
128
  - `.git/info/exclude` に管理エントリ追加
127
129
  - デフォルト hook テンプレートを作成
@@ -134,8 +136,10 @@ vw list --json
134
136
  ```
135
137
 
136
138
  機能:
139
+
137
140
  - Git の porcelain 情報から worktree 一覧を取得
138
141
  - branch/path/dirty/lock/merged/upstream を表示
142
+ - 対話ターミナルでは Catppuccin 風の ANSI 色で表示
139
143
 
140
144
  ### `status`
141
145
 
@@ -146,6 +150,7 @@ vw status --json
146
150
  ```
147
151
 
148
152
  機能:
153
+
149
154
  - 対象 worktree 1件の状態を表示
150
155
  - branch 指定なしなら現在 `cwd` から該当 worktree を解決
151
156
 
@@ -157,6 +162,7 @@ vw path feature/foo --json
157
162
  ```
158
163
 
159
164
  機能:
165
+
160
166
  - 指定 branch の絶対 worktree path を返す
161
167
 
162
168
  ### `new`
@@ -167,6 +173,7 @@ vw new feature/foo
167
173
  ```
168
174
 
169
175
  機能:
176
+
170
177
  - 新しい branch + worktree を `.worktree/` に作成
171
178
  - branch 省略時は `wip-xxxxxx` を自動生成
172
179
 
@@ -177,6 +184,7 @@ vw switch feature/foo
177
184
  ```
178
185
 
179
186
  機能:
187
+
180
188
  - 指定 branch の worktree があれば再利用、なければ作成
181
189
  - 冪等な branch 入口コマンド
182
190
 
@@ -187,6 +195,7 @@ vw mv feature/new-name
187
195
  ```
188
196
 
189
197
  機能:
198
+
190
199
  - 現在の非primary worktree の branch 名と path をリネーム
191
200
  - detached HEAD では実行不可
192
201
 
@@ -199,10 +208,12 @@ vw del feature/foo --force-unmerged --allow-unpushed --allow-unsafe
199
208
  ```
200
209
 
201
210
  機能:
211
+
202
212
  - worktree と branch を安全に削除
203
213
  - デフォルトで dirty / locked / unmerged(unknown含む) / unpushed(unknown含む) を拒否
204
214
 
205
215
  主な解除フラグ:
216
+
206
217
  - `--force-dirty`
207
218
  - `--allow-unpushed`
208
219
  - `--force-unmerged`
@@ -218,6 +229,7 @@ vw gone --json
218
229
  ```
219
230
 
220
231
  機能:
232
+
221
233
  - 一括クリーンアップ候補の抽出/削除
222
234
  - デフォルトは dry-run
223
235
  - `--apply` で削除実行
@@ -229,6 +241,7 @@ vw get origin/feature/foo
229
241
  ```
230
242
 
231
243
  機能:
244
+
232
245
  - remote branch を fetch
233
246
  - ローカル追跡 branch がなければ作成
234
247
  - worktree を作成/再利用
@@ -241,11 +254,13 @@ vw extract --current --stash
241
254
  ```
242
255
 
243
256
  機能:
257
+
244
258
  - primary worktree の現在 branch を `.worktree/` 側へ切り出し
245
259
  - primary を base branch に戻す
246
260
  - dirty 状態で切り出す場合は `--stash` を使用
247
261
 
248
262
  現状の制約:
263
+
249
264
  - 実装は primary worktree の抽出フローが中心
250
265
 
251
266
  ### `use`
@@ -256,10 +271,12 @@ vw use feature/foo --allow-agent --allow-unsafe
256
271
  ```
257
272
 
258
273
  機能:
274
+
259
275
  - primary worktree を指定 branch に checkout
260
276
  - primary context を固定したい用途向け
261
277
 
262
278
  安全条件:
279
+
263
280
  - primary が dirty なら拒否
264
281
  - 非TTYでは `--allow-agent` と `--allow-unsafe` の両方が必要
265
282
 
@@ -271,10 +288,12 @@ vw exec feature/foo --json -- pnpm test
271
288
  ```
272
289
 
273
290
  機能:
291
+
274
292
  - 指定 branch の worktree を `cwd` にしてコマンド実行
275
293
  - shell 展開は使わず引数配列で実行
276
294
 
277
295
  終了コード:
296
+
278
297
  - 子プロセス成功: `0`
279
298
  - 子プロセス失敗: `21`(JSON では `CHILD_PROCESS_FAILED`)
280
299
 
@@ -286,6 +305,7 @@ vw invoke pre-new -- --arg1 --arg2
286
305
  ```
287
306
 
288
307
  機能:
308
+
289
309
  - `pre-*` / `post-*` hook を手動実行
290
310
  - hook デバッグ用
291
311
 
@@ -296,6 +316,7 @@ vw copy .envrc .claude/settings.local.json
296
316
  ```
297
317
 
298
318
  機能:
319
+
299
320
  - repo 相対パスのファイル/ディレクトリを target worktree にコピー
300
321
  - 主に hook 内で `WT_WORKTREE_PATH` と合わせて使う想定
301
322
 
@@ -307,6 +328,7 @@ vw link .envrc --no-fallback
307
328
  ```
308
329
 
309
330
  機能:
331
+
310
332
  - target worktree 側に symlink を作成
311
333
  - Windows では `--no-fallback` がない場合、copy にフォールバック可
312
334
 
@@ -319,6 +341,7 @@ vw unlock feature/foo --force
319
341
  ```
320
342
 
321
343
  機能:
344
+
322
345
  - `lock`: `.vde/worktree/locks/` に lock 情報を保存
323
346
  - `unlock`: lock を解除(owner 不一致時は `--force` 必須)
324
347
 
@@ -329,7 +352,11 @@ cd "$(vw cd)"
329
352
  ```
330
353
 
331
354
  機能:
355
+
332
356
  - `fzf` で worktree を対話選択
357
+ - Picker では worktree の branch 名 + 最小 state(dirty / merged / lock)を表示
358
+ - preview で path と states(dirty / locked / merged / upstream)を表示
359
+ - 対話ターミナルでは Picker/preview を Catppuccin 風 ANSI 色で表示
333
360
  - 選択した絶対 path を stdout に出力
334
361
 
335
362
  ### `completion`
@@ -341,6 +368,7 @@ vw completion zsh --install
341
368
  ```
342
369
 
343
370
  機能:
371
+
344
372
  - zsh / fish 向け補完スクリプトを出力
345
373
  - `--install` 指定時はデフォルトまたは `--path` に補完ファイルを書き込む
346
374
 
@@ -359,6 +387,7 @@ vw completion zsh --install
359
387
  - `byPR === null` -> `byAncestry` にフォールバック
360
388
 
361
389
  `byPR` が `null` になる例:
390
+
362
391
  - `gh` 未導入
363
392
  - `gh auth` 未設定
364
393
  - API 失敗
@@ -369,12 +398,14 @@ vw completion zsh --install
369
398
  `--json` 指定時、stdout は常に単一 JSON オブジェクトです。
370
399
 
371
400
  共通成功フィールド:
401
+
372
402
  - `schemaVersion`
373
403
  - `command`
374
404
  - `status`
375
405
  - `repoRoot`
376
406
 
377
407
  エラー時:
408
+
378
409
  - `status: "error"`
379
410
  - `code`
380
411
  - `message`
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  `vde-worktree` is a safe Git worktree manager designed for both humans and coding agents.
4
4
 
5
5
  It installs two command names:
6
+
6
7
  - `vde-worktree`
7
8
  - `vw` (alias)
8
9
 
@@ -122,6 +123,7 @@ vw init
122
123
  ```
123
124
 
124
125
  What it does:
126
+
125
127
  - Creates `.worktree/` and `.vde/worktree/*`
126
128
  - Appends managed entries to `.git/info/exclude`
127
129
  - Creates default hook templates
@@ -134,8 +136,10 @@ vw list --json
134
136
  ```
135
137
 
136
138
  What it does:
139
+
137
140
  - Lists all worktrees from Git porcelain output
138
141
  - Includes metadata such as branch, path, dirty, lock, merged, and upstream status
142
+ - In interactive terminal, uses Catppuccin-style ANSI colors
139
143
 
140
144
  ### `status`
141
145
 
@@ -146,6 +150,7 @@ vw status --json
146
150
  ```
147
151
 
148
152
  What it does:
153
+
149
154
  - Shows one worktree state
150
155
  - Without branch argument, resolves current worktree from current `cwd`
151
156
 
@@ -157,6 +162,7 @@ vw path feature/foo --json
157
162
  ```
158
163
 
159
164
  What it does:
165
+
160
166
  - Resolves and returns the absolute worktree path for the target branch
161
167
 
162
168
  ### `new`
@@ -167,6 +173,7 @@ vw new feature/foo
167
173
  ```
168
174
 
169
175
  What it does:
176
+
170
177
  - Creates a new branch + worktree under `.worktree/`
171
178
  - Without argument, generates `wip-xxxxxx`
172
179
 
@@ -177,6 +184,7 @@ vw switch feature/foo
177
184
  ```
178
185
 
179
186
  What it does:
187
+
180
188
  - Idempotent branch entrypoint
181
189
  - Reuses existing worktree if present, otherwise creates one
182
190
 
@@ -187,6 +195,7 @@ vw mv feature/new-name
187
195
  ```
188
196
 
189
197
  What it does:
198
+
190
199
  - Renames current non-primary worktree branch and moves its directory
191
200
  - Requires branch checkout (not detached HEAD)
192
201
 
@@ -199,10 +208,12 @@ vw del feature/foo --force-unmerged --allow-unpushed --allow-unsafe
199
208
  ```
200
209
 
201
210
  What it does:
211
+
202
212
  - Removes worktree and branch safely
203
213
  - By default, rejects dirty, locked, unmerged/unknown, or unpushed/unknown states
204
214
 
205
215
  Useful force flags:
216
+
206
217
  - `--force-dirty`
207
218
  - `--allow-unpushed`
208
219
  - `--force-unmerged`
@@ -218,6 +229,7 @@ vw gone --json
218
229
  ```
219
230
 
220
231
  What it does:
232
+
221
233
  - Bulk cleanup candidate finder/remover
222
234
  - Default mode is dry-run
223
235
  - `--apply` actually deletes eligible branches/worktrees
@@ -229,6 +241,7 @@ vw get origin/feature/foo
229
241
  ```
230
242
 
231
243
  What it does:
244
+
232
245
  - Fetches remote branch
233
246
  - Creates tracking local branch when missing
234
247
  - Creates/reuses local worktree
@@ -241,11 +254,13 @@ vw extract --current --stash
241
254
  ```
242
255
 
243
256
  What it does:
257
+
244
258
  - Extracts current primary worktree branch into `.worktree/`
245
259
  - Switches primary worktree back to base branch
246
260
  - `--stash` allows extraction when primary is dirty
247
261
 
248
262
  Current limitation:
263
+
249
264
  - Implementation currently supports primary worktree extraction flow.
250
265
 
251
266
  ### `use`
@@ -256,10 +271,12 @@ vw use feature/foo --allow-agent --allow-unsafe
256
271
  ```
257
272
 
258
273
  What it does:
274
+
259
275
  - Checks out the target branch in the primary worktree
260
276
  - Intended for human workflows where primary context must be fixed
261
277
 
262
278
  Safety:
279
+
263
280
  - Rejects dirty primary worktree
264
281
  - In non-TTY mode, requires `--allow-agent` and `--allow-unsafe`
265
282
 
@@ -271,10 +288,12 @@ vw exec feature/foo --json -- pnpm test
271
288
  ```
272
289
 
273
290
  What it does:
291
+
274
292
  - Executes command inside the target branch worktree path
275
293
  - Does not use shell expansion
276
294
 
277
295
  Exit behavior:
296
+
278
297
  - Child success => `0`
279
298
  - Child failure => `21` (`CHILD_PROCESS_FAILED` in JSON mode)
280
299
 
@@ -286,6 +305,7 @@ vw invoke pre-new -- --arg1 --arg2
286
305
  ```
287
306
 
288
307
  What it does:
308
+
289
309
  - Manually invokes `pre-*` / `post-*` hook scripts
290
310
  - Useful for debugging hook behavior
291
311
 
@@ -296,6 +316,7 @@ vw copy .envrc .claude/settings.local.json
296
316
  ```
297
317
 
298
318
  What it does:
319
+
299
320
  - Copies repo-relative files/dirs from repo root into target worktree
300
321
  - Primarily intended for hook usage with `WT_WORKTREE_PATH`
301
322
 
@@ -307,6 +328,7 @@ vw link .envrc --no-fallback
307
328
  ```
308
329
 
309
330
  What it does:
331
+
310
332
  - Creates symlink in target worktree pointing to repo-root file
311
333
  - On Windows, can fallback to copy unless `--no-fallback`
312
334
 
@@ -319,6 +341,7 @@ vw unlock feature/foo --force
319
341
  ```
320
342
 
321
343
  What they do:
344
+
322
345
  - `lock` writes lock metadata under `.vde/worktree/locks/`
323
346
  - `unlock` clears lock, enforcing owner match unless `--force`
324
347
 
@@ -329,7 +352,11 @@ cd "$(vw cd)"
329
352
  ```
330
353
 
331
354
  What it does:
355
+
332
356
  - Interactive worktree picker via `fzf`
357
+ - Picker list shows worktree branch names with minimal states (dirty/merged/lock)
358
+ - Preview pane shows path and worktree states (dirty/locked/merged/upstream)
359
+ - Picker and preview use Catppuccin-style ANSI colors in interactive terminal
333
360
  - Prints selected absolute path to stdout
334
361
 
335
362
  ### `completion`
@@ -341,6 +368,7 @@ vw completion zsh --install
341
368
  ```
342
369
 
343
370
  What it does:
371
+
344
372
  - Prints completion script for zsh/fish
345
373
  - With `--install`, writes completion file to shell default path or `--path`
346
374
 
@@ -365,12 +393,14 @@ Overall policy:
365
393
  With `--json`, stdout always emits exactly one JSON object.
366
394
 
367
395
  Common success fields:
396
+
368
397
  - `schemaVersion`
369
398
  - `command`
370
399
  - `status`
371
400
  - `repoRoot`
372
401
 
373
402
  Error shape:
403
+
374
404
  - `status: "error"`
375
405
  - `code`
376
406
  - `message`