@getsolaris/copse 1.0.0 → 1.0.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.ko.md +180 -180
- package/README.md +180 -180
- package/dist/{cop.js → copse.js} +60 -60
- package/package.json +13 -5
package/README.md
CHANGED
|
@@ -12,35 +12,35 @@ Manage git worktrees with ease. Create, switch, and clean up worktrees with conf
|
|
|
12
12
|
|
|
13
13
|
## Features
|
|
14
14
|
|
|
15
|
-
- **TUI mode** — interactive terminal UI (`
|
|
16
|
-
- **CLI mode** — scriptable commands (`
|
|
15
|
+
- **TUI mode** — interactive terminal UI (`copse`)
|
|
16
|
+
- **CLI mode** — scriptable commands (`copse add`, `copse list`, etc.)
|
|
17
17
|
- **Config-driven** — per-repo hooks, file copying, symlinks
|
|
18
18
|
- **Monorepo support** — auto-detect packages, per-package hooks, focus tracking
|
|
19
|
-
- **Health checks** — `
|
|
19
|
+
- **Health checks** — `copse doctor` diagnoses worktree issues
|
|
20
20
|
- **Centralized worktrees** — all worktrees under `~/.copse/worktrees/` by default
|
|
21
21
|
- **Smart cleanup** — auto-detect and remove merged worktrees
|
|
22
22
|
- **Themes** — 9 built-in color themes (OpenCode, Tokyo Night, Dracula, Nord, Catppuccin, GitHub Dark, One Dark, Monokai, GitHub Light)
|
|
23
|
-
- **Templates** — reusable worktree presets (`
|
|
24
|
-
- **Cross-worktree exec** — run commands across all worktrees (`
|
|
25
|
-
- **GitHub PR integration** — create worktrees from PRs (`
|
|
23
|
+
- **Templates** — reusable worktree presets (`copse add --template review`)
|
|
24
|
+
- **Cross-worktree exec** — run commands across all worktrees (`copse exec "bun test"`)
|
|
25
|
+
- **GitHub PR integration** — create worktrees from PRs (`copse add --pr 123`)
|
|
26
26
|
- **Fuzzy branch picker** — interactive branch selection in TUI with type-ahead filtering
|
|
27
27
|
- **Lifecycle management** — auto-detect stale/merged worktrees, configurable limits
|
|
28
28
|
- **Shared dependencies** — save disk with hardlink/symlink strategies for `node_modules`
|
|
29
|
-
- **Worktree diff** — compare changes between worktrees (`
|
|
30
|
-
- **Pin protection** — protect worktrees from auto-cleanup (`
|
|
31
|
-
- **Activity log** — track create/delete/switch/rename/archive/import events (`
|
|
32
|
-
- **Archive** — preserve worktree changes as patches before removal (`
|
|
33
|
-
- **Branch rename** — rename worktree branches with metadata migration (`
|
|
34
|
-
- **Clone & init** — clone repos with
|
|
35
|
-
- **Import worktrees** — adopt manually-created worktrees (`
|
|
29
|
+
- **Worktree diff** — compare changes between worktrees (`copse diff feature/a feature/b`)
|
|
30
|
+
- **Pin protection** — protect worktrees from auto-cleanup (`copse pin`)
|
|
31
|
+
- **Activity log** — track create/delete/switch/rename/archive/import events (`copse log`)
|
|
32
|
+
- **Archive** — preserve worktree changes as patches before removal (`copse archive`)
|
|
33
|
+
- **Branch rename** — rename worktree branches with metadata migration (`copse rename`)
|
|
34
|
+
- **Clone & init** — clone repos with copse config initialization (`copse clone`)
|
|
35
|
+
- **Import worktrees** — adopt manually-created worktrees (`copse import`)
|
|
36
36
|
- **Detail view** — expanded worktree info with commits, diff stats, upstream status (TUI)
|
|
37
37
|
- **Bulk actions** — multi-select and batch operations on worktrees (TUI)
|
|
38
38
|
- **Toast notifications** — non-blocking operation feedback (TUI)
|
|
39
|
-
- **Shell completions** — tab completion for bash/zsh/fish (`
|
|
40
|
-
- **Config profiles** — switch between configuration sets (`
|
|
41
|
-
- **Tmux sessions** — auto-create/kill tmux sessions per worktree with layout templates (`
|
|
39
|
+
- **Shell completions** — tab completion for bash/zsh/fish (`copse shell-init --completions`)
|
|
40
|
+
- **Config profiles** — switch between configuration sets (`copse config --profiles`)
|
|
41
|
+
- **Tmux sessions** — auto-create/kill tmux sessions per worktree with layout templates (`copse session`)
|
|
42
42
|
- **Workspaces** — auto-discover git repos under parent directories with per-workspace defaults (`workspaces` config)
|
|
43
|
-
- **AI agent init** — create config by default or install
|
|
43
|
+
- **AI agent init** — create config by default or install copse skill for Claude Code, Codex, OpenCode (`copse init`, `copse init --skill`)
|
|
44
44
|
|
|
45
45
|
## Requirements
|
|
46
46
|
|
|
@@ -48,7 +48,7 @@ Manage git worktrees with ease. Create, switch, and clean up worktrees with conf
|
|
|
48
48
|
- git 2.17+
|
|
49
49
|
- macOS or Linux
|
|
50
50
|
- [gh CLI](https://cli.github.com) (optional, for `--pr` flag)
|
|
51
|
-
- [tmux](https://github.com/tmux/tmux) (optional, for `
|
|
51
|
+
- [tmux](https://github.com/tmux/tmux) (optional, for `copse session`)
|
|
52
52
|
|
|
53
53
|
## Installation
|
|
54
54
|
|
|
@@ -91,75 +91,75 @@ Prefer targeted tests first when you change covered code, then run the full chec
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
# Launch TUI
|
|
94
|
-
|
|
94
|
+
copse
|
|
95
95
|
|
|
96
96
|
# List worktrees
|
|
97
|
-
|
|
97
|
+
copse list
|
|
98
98
|
|
|
99
99
|
# Create a new worktree
|
|
100
|
-
|
|
100
|
+
copse add feature/my-feature
|
|
101
101
|
|
|
102
102
|
# Create with monorepo focus
|
|
103
|
-
|
|
103
|
+
copse add feature/my-feature --focus apps/web,apps/api
|
|
104
104
|
|
|
105
105
|
# Create from a GitHub PR
|
|
106
|
-
|
|
106
|
+
copse add --pr 123
|
|
107
107
|
|
|
108
108
|
# Use a template
|
|
109
|
-
|
|
109
|
+
copse add feature/login --template review
|
|
110
110
|
|
|
111
111
|
# Pin a worktree to protect from cleanup
|
|
112
|
-
|
|
112
|
+
copse pin feature/important --reason "active sprint"
|
|
113
113
|
|
|
114
114
|
# View activity log
|
|
115
|
-
|
|
115
|
+
copse log
|
|
116
116
|
|
|
117
117
|
# Archive worktree changes before removing
|
|
118
|
-
|
|
118
|
+
copse archive feature/done --yes
|
|
119
119
|
|
|
120
120
|
# Rename a worktree branch
|
|
121
|
-
|
|
121
|
+
copse rename old-name new-name
|
|
122
122
|
|
|
123
|
-
# Clone and initialize
|
|
124
|
-
|
|
123
|
+
# Clone and initialize copse
|
|
124
|
+
copse clone https://github.com/user/repo.git
|
|
125
125
|
|
|
126
126
|
# Import an existing worktree
|
|
127
|
-
|
|
127
|
+
copse import /path/to/worktree
|
|
128
128
|
|
|
129
129
|
# Open/attach tmux session for a worktree
|
|
130
|
-
|
|
130
|
+
copse session feature/my-feature
|
|
131
131
|
|
|
132
132
|
# Create worktree with tmux session
|
|
133
|
-
|
|
133
|
+
copse add feature/new --session
|
|
134
134
|
|
|
135
135
|
# Run command across all worktrees
|
|
136
|
-
|
|
136
|
+
copse exec "bun test"
|
|
137
137
|
|
|
138
138
|
# Compare two worktrees
|
|
139
|
-
|
|
139
|
+
copse diff feature/a feature/b --stat
|
|
140
140
|
|
|
141
141
|
# Check worktree health
|
|
142
|
-
|
|
142
|
+
copse doctor
|
|
143
143
|
|
|
144
144
|
# Switch to a worktree (requires shell integration)
|
|
145
|
-
|
|
145
|
+
copse switch feature/my-feature
|
|
146
146
|
|
|
147
147
|
# Remove a worktree
|
|
148
|
-
|
|
148
|
+
copse remove feature/my-feature --yes
|
|
149
149
|
|
|
150
150
|
# Clean up merged worktrees
|
|
151
|
-
|
|
151
|
+
copse clean --dry-run
|
|
152
152
|
|
|
153
153
|
# Initialize config file
|
|
154
|
-
|
|
154
|
+
copse init
|
|
155
155
|
|
|
156
156
|
# Generate AI agent skill file
|
|
157
|
-
|
|
157
|
+
copse init --skill claude-code
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
## TUI Usage
|
|
161
161
|
|
|
162
|
-
Launch with `
|
|
162
|
+
Launch with `copse` (no arguments).
|
|
163
163
|
|
|
164
164
|
### Keyboard Shortcuts
|
|
165
165
|
|
|
@@ -270,50 +270,50 @@ Every commit runs `validateConfig` before writing. Invalid input surfaces as an
|
|
|
270
270
|
|
|
271
271
|
| Command | Description |
|
|
272
272
|
| ------------------------ | ------------------------------------ |
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
292
|
-
|
|
293
|
-
### `
|
|
273
|
+
| `copse` | Launch TUI |
|
|
274
|
+
| `copse list` | List all worktrees (with focus info) |
|
|
275
|
+
| `copse add <branch>` | Create worktree |
|
|
276
|
+
| `copse remove <branch>` | Remove worktree |
|
|
277
|
+
| `copse switch <branch>` | Switch to worktree |
|
|
278
|
+
| `copse clean` | Remove merged worktrees |
|
|
279
|
+
| `copse doctor` | Check worktree health |
|
|
280
|
+
| `copse config` | Manage configuration |
|
|
281
|
+
| `copse exec <command>` | Run command in each worktree |
|
|
282
|
+
| `copse diff <ref1> [ref2]` | Diff between worktrees/branches |
|
|
283
|
+
| `copse pin <branch>` | Pin/unpin worktree (protect from cleanup) |
|
|
284
|
+
| `copse log` | Show worktree activity log |
|
|
285
|
+
| `copse archive <branch>` | Archive changes and optionally remove |
|
|
286
|
+
| `copse rename <old> <new>` | Rename worktree branch |
|
|
287
|
+
| `copse clone <url>` | Clone repo and initialize copse |
|
|
288
|
+
| `copse import <path>` | Adopt worktree with copse metadata |
|
|
289
|
+
| `copse session [branch]` | Manage tmux sessions for worktrees |
|
|
290
|
+
| `copse open [branch]` | Open a worktree in your editor (focus-aware) |
|
|
291
|
+
| `copse init` | Initialize config or install AI agent skills |
|
|
292
|
+
|
|
293
|
+
### `copse add`
|
|
294
294
|
|
|
295
295
|
```bash
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
copse add feature/login # Create branch if needed + worktree
|
|
297
|
+
copse add feature/login --base main # New branches start from main
|
|
298
|
+
copse add existing-branch # Worktree for existing branch
|
|
299
299
|
|
|
300
300
|
# Monorepo: create with focus packages
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
copse add feature/login --focus apps/web,apps/api
|
|
302
|
+
copse add feature/login --focus apps/web --focus apps/api
|
|
303
303
|
|
|
304
304
|
# Use a template
|
|
305
|
-
|
|
305
|
+
copse add feature/login --template review
|
|
306
306
|
|
|
307
307
|
# Create from a GitHub PR (requires gh CLI)
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
copse add --pr 123
|
|
309
|
+
copse add --pr 456 --template review
|
|
310
310
|
```
|
|
311
311
|
|
|
312
|
-
### `
|
|
312
|
+
### `copse doctor`
|
|
313
313
|
|
|
314
314
|
```bash
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
copse doctor # Human-readable output
|
|
316
|
+
copse doctor --json # JSON output for scripting
|
|
317
317
|
```
|
|
318
318
|
|
|
319
319
|
Exit code: `0` if healthy, `1` if any warnings or errors.
|
|
@@ -331,43 +331,43 @@ copse doctor
|
|
|
331
331
|
All checks passed.
|
|
332
332
|
```
|
|
333
333
|
|
|
334
|
-
### `
|
|
334
|
+
### `copse list`
|
|
335
335
|
|
|
336
336
|
```bash
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
copse list # Table with Focus column
|
|
338
|
+
copse list --json # JSON with focus array
|
|
339
|
+
copse list --porcelain # Machine-readable
|
|
340
340
|
```
|
|
341
341
|
|
|
342
342
|
Output includes a `Focus` column showing monorepo focus paths per worktree.
|
|
343
343
|
|
|
344
|
-
### `
|
|
344
|
+
### `copse remove`
|
|
345
345
|
|
|
346
346
|
```bash
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
copse remove feature/login # Remove by branch name
|
|
348
|
+
copse remove feature/login --force # Force remove (dirty worktree)
|
|
349
|
+
copse remove feature/login --yes # Skip confirmation
|
|
350
350
|
```
|
|
351
351
|
|
|
352
|
-
### `
|
|
352
|
+
### `copse clean`
|
|
353
353
|
|
|
354
354
|
```bash
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
355
|
+
copse clean --dry-run # Preview what would be removed
|
|
356
|
+
copse clean # Remove all merged worktrees
|
|
357
|
+
copse clean --stale # Also show stale worktrees (uses lifecycle config)
|
|
358
358
|
```
|
|
359
359
|
|
|
360
|
-
### `
|
|
360
|
+
### `copse exec`
|
|
361
361
|
|
|
362
362
|
Run a shell command in every non-main worktree.
|
|
363
363
|
|
|
364
364
|
```bash
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
365
|
+
copse exec "bun test" # Run in all worktrees (sequential)
|
|
366
|
+
copse exec "bun test" --parallel # Run in parallel
|
|
367
|
+
copse exec "git pull" --all # Across all configured repos
|
|
368
|
+
copse exec "bun install" --dirty # Only dirty worktrees
|
|
369
|
+
copse exec "git rebase main" --behind # Only worktrees behind upstream
|
|
370
|
+
copse exec "bun test" --json # JSON output
|
|
371
371
|
```
|
|
372
372
|
|
|
373
373
|
| Flag | Description |
|
|
@@ -379,116 +379,116 @@ cop exec "bun test" --json # JSON output
|
|
|
379
379
|
| `--behind` | Only run in worktrees behind upstream |
|
|
380
380
|
| `--json` / `-j` | Output results as JSON |
|
|
381
381
|
|
|
382
|
-
Environment variables available in commands: `
|
|
382
|
+
Environment variables available in commands: `COPSE_BRANCH`, `COPSE_WORKTREE_PATH`, `COPSE_REPO_PATH`.
|
|
383
383
|
|
|
384
|
-
### `
|
|
384
|
+
### `copse diff`
|
|
385
385
|
|
|
386
386
|
Show diff between two worktree branches.
|
|
387
387
|
|
|
388
388
|
```bash
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
copse diff feature/a feature/b # Full diff
|
|
390
|
+
copse diff feature/a feature/b --stat # Diffstat summary
|
|
391
|
+
copse diff feature/a --name-only # Changed file names only
|
|
392
|
+
copse diff feature/a # Compare against current HEAD
|
|
393
393
|
```
|
|
394
394
|
|
|
395
|
-
### `
|
|
395
|
+
### `copse pin`
|
|
396
396
|
|
|
397
397
|
```bash
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
398
|
+
copse pin feature/auth --reason "active sprint" # Pin with reason
|
|
399
|
+
copse pin --list # List pinned worktrees
|
|
400
|
+
copse pin --list --json # JSON output
|
|
401
|
+
copse unpin feature/auth # Unpin
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
-
Pinned worktrees are excluded from `
|
|
404
|
+
Pinned worktrees are excluded from `copse clean` and lifecycle auto-cleanup.
|
|
405
405
|
|
|
406
|
-
### `
|
|
406
|
+
### `copse log`
|
|
407
407
|
|
|
408
408
|
```bash
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
copse log # Show last 20 events
|
|
410
|
+
copse log --limit 50 # Show last 50 events
|
|
411
|
+
copse log --json # JSON output
|
|
412
|
+
copse log --clear # Clear activity log
|
|
413
413
|
```
|
|
414
414
|
|
|
415
415
|
Events are color-coded: create (green), delete (red), switch (blue), rename (yellow), archive (magenta), import (cyan).
|
|
416
416
|
|
|
417
|
-
### `
|
|
417
|
+
### `copse archive`
|
|
418
418
|
|
|
419
419
|
```bash
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
420
|
+
copse archive feature/done --yes # Archive and remove
|
|
421
|
+
copse archive feature/wip --keep # Archive without removing
|
|
422
|
+
copse archive --list # List all archives
|
|
423
|
+
copse archive --list --json # JSON output
|
|
424
424
|
```
|
|
425
425
|
|
|
426
426
|
Archives are stored as patch files in `~/.copse/archives/`.
|
|
427
427
|
|
|
428
|
-
### `
|
|
428
|
+
### `copse rename`
|
|
429
429
|
|
|
430
430
|
```bash
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
copse rename old-branch new-branch # Rename branch
|
|
432
|
+
copse rename old-branch new-branch --move-path # Also move worktree directory
|
|
433
433
|
```
|
|
434
434
|
|
|
435
|
-
### `
|
|
435
|
+
### `copse clone`
|
|
436
436
|
|
|
437
437
|
```bash
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
438
|
+
copse clone https://github.com/user/repo.git # Clone and init
|
|
439
|
+
copse clone https://github.com/user/repo.git ./my-dir # Custom target path
|
|
440
|
+
copse clone https://github.com/user/repo.git --template review # Apply template
|
|
441
|
+
copse clone https://github.com/user/repo.git --no-init-config # Skip config init
|
|
442
442
|
```
|
|
443
443
|
|
|
444
|
-
### `
|
|
444
|
+
### `copse import`
|
|
445
445
|
|
|
446
446
|
```bash
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
447
|
+
copse import /path/to/worktree # Adopt worktree
|
|
448
|
+
copse import /path/to/worktree --focus apps/web,apps/api # With focus
|
|
449
|
+
copse import /path/to/worktree --pin # Pin immediately
|
|
450
450
|
```
|
|
451
451
|
|
|
452
|
-
### `
|
|
452
|
+
### `copse session`
|
|
453
453
|
|
|
454
454
|
Manage tmux sessions for worktrees. Requires tmux.
|
|
455
455
|
|
|
456
456
|
```bash
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
457
|
+
copse session feature/auth # Open/attach session (create if needed)
|
|
458
|
+
copse session feature/auth --layout api # Use named layout from config
|
|
459
|
+
copse session --list # List active copse sessions
|
|
460
|
+
copse session --list --json # JSON output
|
|
461
|
+
copse session feature/auth --kill # Kill session for worktree
|
|
462
|
+
copse session --kill-all # Kill all copse sessions
|
|
463
463
|
```
|
|
464
464
|
|
|
465
465
|
Sessions are auto-created/killed when `sessions.autoCreate` / `sessions.autoKill` are enabled in config.
|
|
466
466
|
|
|
467
467
|
```bash
|
|
468
468
|
# Create worktree with tmux session
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
copse add feature/login --session
|
|
470
|
+
copse add feature/login --session --layout api
|
|
471
471
|
```
|
|
472
472
|
|
|
473
|
-
When `sessions.enabled` is `true` and you're inside tmux, `
|
|
473
|
+
When `sessions.enabled` is `true` and you're inside tmux, `copse switch` automatically switches to the target worktree's tmux session.
|
|
474
474
|
|
|
475
|
-
### `
|
|
475
|
+
### `copse open`
|
|
476
476
|
|
|
477
477
|
Open a worktree in your editor or IDE. Auto-detects `$VISUAL` / `$EDITOR` and falls back to a known list (`code`, `cursor`, `vim`, `nvim`, `emacs`, `nano`, `subl`, `zed`, `idea`, `webstorm`).
|
|
478
478
|
|
|
479
479
|
```bash
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
copse open # Open the current worktree
|
|
481
|
+
copse open feature/auth # Open a specific worktree
|
|
482
|
+
copse open feature/auth -e nvim # Override editor
|
|
483
483
|
|
|
484
484
|
# Focus-aware behavior (when the worktree was created with --focus)
|
|
485
|
-
|
|
485
|
+
copse open feature/auth # 1 focus path → opens that focus
|
|
486
486
|
# 2+ focus paths → errors with hint
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
487
|
+
copse open feature/auth --focus apps/web # Pick a specific focus path
|
|
488
|
+
copse open feature/auth -f apps/api # Same with the short alias
|
|
489
|
+
copse open feature/auth --root # Force the worktree root, ignore focus
|
|
490
490
|
|
|
491
|
-
|
|
491
|
+
copse open --list-editors # List detected editors
|
|
492
492
|
```
|
|
493
493
|
|
|
494
494
|
| Flag | Alias | Description |
|
|
@@ -504,22 +504,22 @@ cop open --list-editors # List detected editors
|
|
|
504
504
|
- 1 focus path set → opens `<worktree>/<focus>` automatically.
|
|
505
505
|
- 2+ focus paths set → errors out and asks for `--focus <path>` or `--root` (the TUI shows an interactive picker instead).
|
|
506
506
|
|
|
507
|
-
### `
|
|
507
|
+
### `copse init`
|
|
508
508
|
|
|
509
|
-
Initialize
|
|
509
|
+
Initialize copse config by default, or install copse skill for AI coding agents so they can use copse commands.
|
|
510
510
|
|
|
511
511
|
```bash
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
512
|
+
copse init # → ~/.config/copse/config.json
|
|
513
|
+
copse init --skill claude-code # → ~/.claude/skills/copse/
|
|
514
|
+
copse init --skill codex # → ~/.agents/skills/copse/
|
|
515
|
+
copse init --skill opencode # → ~/.config/opencode/skill/copse/
|
|
516
516
|
```
|
|
517
517
|
|
|
518
518
|
| Platform | Skill Path |
|
|
519
519
|
|----------|-----------|
|
|
520
|
-
| `claude-code` | `~/.claude/skills/
|
|
521
|
-
| `codex` | `~/.agents/skills/
|
|
522
|
-
| `opencode` | `~/.config/opencode/skill/
|
|
520
|
+
| `claude-code` | `~/.claude/skills/copse/` |
|
|
521
|
+
| `codex` | `~/.agents/skills/copse/` |
|
|
522
|
+
| `opencode` | `~/.config/opencode/skill/copse/` |
|
|
523
523
|
|
|
524
524
|
Each skill directory contains:
|
|
525
525
|
- `SKILL.md` — overview and common workflows
|
|
@@ -530,19 +530,19 @@ The command is idempotent — running it again updates the skill directory.
|
|
|
530
530
|
|
|
531
531
|
#### Auto-init on first run
|
|
532
532
|
|
|
533
|
-
You don't have to run `
|
|
533
|
+
You don't have to run `copse init` manually. The first time you run any `copse` command (including launching the TUI), if `~/.config/copse/config.json` does not exist, copse creates it with the default template and prints a one-line notice to stderr:
|
|
534
534
|
|
|
535
535
|
```
|
|
536
|
-
|
|
536
|
+
copse: created default config at /Users/you/.config/copse/config.json
|
|
537
537
|
```
|
|
538
538
|
|
|
539
|
-
The notice is suppressed when stdout is not a TTY (so pipes, scripts, and CI stay quiet) and when you run `
|
|
539
|
+
The notice is suppressed when stdout is not a TTY (so pipes, scripts, and CI stay quiet) and when you run `copse init` explicitly (to avoid duplicate messages with init's own success line). Auto-init is fully idempotent — subsequent runs do nothing.
|
|
540
540
|
|
|
541
541
|
## Configuration
|
|
542
542
|
|
|
543
543
|
Config file: `~/.config/copse/config.json`
|
|
544
544
|
|
|
545
|
-
Initialize with: `
|
|
545
|
+
Initialize with: `copse config --init` (or just run any `copse` command — see [Auto-init on first run](#auto-init-on-first-run))
|
|
546
546
|
|
|
547
547
|
### Full Example
|
|
548
548
|
|
|
@@ -588,7 +588,7 @@ Initialize with: `cop config --init` (or just run any `cop` command — see [Aut
|
|
|
588
588
|
"enabled": true,
|
|
589
589
|
"autoCreate": false,
|
|
590
590
|
"autoKill": true,
|
|
591
|
-
"prefix": "
|
|
591
|
+
"prefix": "copse",
|
|
592
592
|
"defaultLayout": "dev",
|
|
593
593
|
"layouts": {
|
|
594
594
|
"dev": {
|
|
@@ -809,13 +809,13 @@ Named presets for worktree creation. Each template can override any default fiel
|
|
|
809
809
|
| `autoUpstream` | `boolean` | Override upstream tracking |
|
|
810
810
|
| `base` | `string` | Default base branch for newly created branches |
|
|
811
811
|
|
|
812
|
-
Usage: `
|
|
812
|
+
Usage: `copse add feature/login --template review`
|
|
813
813
|
|
|
814
814
|
Template values override the resolved repo config. The `base` field sets a default for `--base` if not explicitly provided.
|
|
815
815
|
|
|
816
816
|
#### `lifecycle`
|
|
817
817
|
|
|
818
|
-
Automatic worktree lifecycle management. Used by `
|
|
818
|
+
Automatic worktree lifecycle management. Used by `copse clean --stale`.
|
|
819
819
|
|
|
820
820
|
```json
|
|
821
821
|
{
|
|
@@ -838,9 +838,9 @@ Automatic worktree lifecycle management. Used by `cop clean --stale`.
|
|
|
838
838
|
Switch between different configuration sets.
|
|
839
839
|
|
|
840
840
|
```bash
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
841
|
+
copse config --profiles # List profiles
|
|
842
|
+
copse config --profile work --activate # Activate profile
|
|
843
|
+
copse config --profile personal --delete # Delete profile
|
|
844
844
|
```
|
|
845
845
|
|
|
846
846
|
#### `sessions`
|
|
@@ -853,7 +853,7 @@ Tmux session management for worktrees.
|
|
|
853
853
|
"enabled": true,
|
|
854
854
|
"autoCreate": true,
|
|
855
855
|
"autoKill": true,
|
|
856
|
-
"prefix": "
|
|
856
|
+
"prefix": "copse",
|
|
857
857
|
"defaultLayout": "dev",
|
|
858
858
|
"layouts": {
|
|
859
859
|
"dev": {
|
|
@@ -871,9 +871,9 @@ Tmux session management for worktrees.
|
|
|
871
871
|
| Field | Type | Default | Description |
|
|
872
872
|
| --------------- | --------- | ------- | -------------------------------------------------- |
|
|
873
873
|
| `enabled` | `boolean` | `false` | Enable session integration (auto-switch in tmux) |
|
|
874
|
-
| `autoCreate` | `boolean` | `false` | Auto-create tmux session on `
|
|
875
|
-
| `autoKill` | `boolean` | `false` | Auto-kill tmux session on `
|
|
876
|
-
| `prefix` | `string` | `"
|
|
874
|
+
| `autoCreate` | `boolean` | `false` | Auto-create tmux session on `copse add` |
|
|
875
|
+
| `autoKill` | `boolean` | `false` | Auto-kill tmux session on `copse remove` |
|
|
876
|
+
| `prefix` | `string` | `"copse"` | Prefix for tmux session names |
|
|
877
877
|
| `defaultLayout` | `string` | — | Default layout name for new sessions |
|
|
878
878
|
| `layouts` | `object` | `{}` | Named layouts with window definitions |
|
|
879
879
|
|
|
@@ -884,7 +884,7 @@ Tmux session management for worktrees.
|
|
|
884
884
|
| `name` | `string` | Yes | Window name |
|
|
885
885
|
| `command` | `string` | No | Command to run in the window |
|
|
886
886
|
|
|
887
|
-
Session naming: branch `feat/auth-token` → tmux session `
|
|
887
|
+
Session naming: branch `feat/auth-token` → tmux session `copse_feat-auth-token`.
|
|
888
888
|
|
|
889
889
|
#### `sharedDeps`
|
|
890
890
|
|
|
@@ -919,12 +919,12 @@ Share dependencies between main repo and worktrees to save disk space. Can be se
|
|
|
919
919
|
Track which monorepo packages a worktree is working on.
|
|
920
920
|
|
|
921
921
|
```bash
|
|
922
|
-
|
|
922
|
+
copse add feature/login --focus apps/web,apps/api
|
|
923
923
|
```
|
|
924
924
|
|
|
925
925
|
- Supports comma-separated, space-separated, or multiple `--focus` flags
|
|
926
926
|
- Focus metadata is stored in git internals (not in the worktree root)
|
|
927
|
-
- `
|
|
927
|
+
- `copse list` shows focus paths per worktree
|
|
928
928
|
- Monorepo hooks only fire for matching focus paths
|
|
929
929
|
- Focus is optional — omitting it creates a normal worktree
|
|
930
930
|
|
|
@@ -961,41 +961,41 @@ Available: `opencode`, `tokyo-night`, `dracula`, `nord`, `catppuccin`, `github-d
|
|
|
961
961
|
|
|
962
962
|
## Shell Integration
|
|
963
963
|
|
|
964
|
-
Use `
|
|
964
|
+
Use `copse shell-init` to install shell integration for `copse switch`.
|
|
965
965
|
|
|
966
966
|
### Completions
|
|
967
967
|
|
|
968
968
|
```bash
|
|
969
969
|
# Add completions (bash)
|
|
970
|
-
eval "$(
|
|
970
|
+
eval "$(copse shell-init --completions bash)"
|
|
971
971
|
|
|
972
972
|
# Add completions (zsh)
|
|
973
|
-
eval "$(
|
|
973
|
+
eval "$(copse shell-init --completions zsh)"
|
|
974
974
|
|
|
975
975
|
# Add completions (fish)
|
|
976
|
-
|
|
976
|
+
copse shell-init --completions fish | source
|
|
977
977
|
```
|
|
978
978
|
|
|
979
979
|
### Examples
|
|
980
980
|
|
|
981
981
|
```bash
|
|
982
982
|
# zsh
|
|
983
|
-
echo 'eval "$(
|
|
983
|
+
echo 'eval "$(copse shell-init zsh)"' >> ~/.zshrc
|
|
984
984
|
source ~/.zshrc
|
|
985
985
|
|
|
986
986
|
# bash
|
|
987
|
-
echo 'eval "$(
|
|
987
|
+
echo 'eval "$(copse shell-init bash)"' >> ~/.bashrc
|
|
988
988
|
source ~/.bashrc
|
|
989
989
|
|
|
990
990
|
# fish
|
|
991
|
-
|
|
991
|
+
copse shell-init fish >> ~/.config/fish/config.fish
|
|
992
992
|
source ~/.config/fish/config.fish
|
|
993
993
|
```
|
|
994
994
|
|
|
995
995
|
You can also preview the generated wrapper before saving it:
|
|
996
996
|
|
|
997
997
|
```bash
|
|
998
|
-
|
|
998
|
+
copse shell-init zsh
|
|
999
999
|
```
|
|
1000
1000
|
|
|
1001
1001
|
## License
|