@getsolaris/copse 1.0.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/LICENSE +21 -0
- package/README.ko.md +985 -0
- package/README.md +1003 -0
- package/dist/cop.js +223 -0
- package/package.json +36 -0
package/README.ko.md
ADDED
|
@@ -0,0 +1,985 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./banner.png" alt="copse" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# ๐ฒ copse
|
|
6
|
+
|
|
7
|
+
[English](./README.md) | **ํ๊ตญ์ด**
|
|
8
|
+
|
|
9
|
+
> Git worktree ๋งค๋์ โ ํฐ๋ฏธ๋ UI
|
|
10
|
+
|
|
11
|
+
Git worktree๋ฅผ ์ฝ๊ฒ ๊ด๋ฆฌํ์ธ์. ์ค์ ๊ธฐ๋ฐ ์๋ํ, ๋ชจ๋
ธ๋ ํฌ ์ง์, ํฌ์ค ์ฒดํฌ๋ก worktree๋ฅผ ์์ฑ, ์ ํ, ์ ๋ฆฌํ ์ ์์ต๋๋ค.
|
|
12
|
+
|
|
13
|
+
## ์ฃผ์ ๊ธฐ๋ฅ
|
|
14
|
+
|
|
15
|
+
- **TUI ๋ชจ๋** โ ์ธํฐ๋ํฐ๋ธ ํฐ๋ฏธ๋ UI (`cop`)
|
|
16
|
+
- **CLI ๋ชจ๋** โ ์คํฌ๋ฆฝํธ์์ ์ฌ์ฉ ๊ฐ๋ฅํ ์ปค๋งจ๋ (`cop add`, `cop list` ๋ฑ)
|
|
17
|
+
- **์ค์ ๊ธฐ๋ฐ** โ ๋ ํฌ๋ณ ํ
, ํ์ผ ๋ณต์ฌ, ์ฌ๋ณผ๋ฆญ ๋งํฌ
|
|
18
|
+
- **๋ชจ๋
ธ๋ ํฌ ์ง์** โ ํจํค์ง ์๋ ๊ฐ์ง, ํจํค์ง๋ณ ํ
, ํฌ์ปค์ค ์ถ์
|
|
19
|
+
- **ํฌ์ค ์ฒดํฌ** โ `cop doctor`๋ก worktree ๋ฌธ์ ์ง๋จ
|
|
20
|
+
- **์ค์ ์ง์ค์ worktree** โ ๊ธฐ๋ณธ์ ์ผ๋ก `~/.copse/worktrees/`์ ๋ชจ๋ worktree ๊ด๋ฆฌ
|
|
21
|
+
- **์ค๋งํธ ์ ๋ฆฌ** โ ๋จธ์ง๋ worktree ์๋ ๊ฐ์ง ๋ฐ ์ ๊ฑฐ
|
|
22
|
+
- **ํ
๋ง** โ 9๊ฐ์ง ๋ด์ฅ ์ปฌ๋ฌ ํ
๋ง (OpenCode, Tokyo Night, Dracula, Nord, Catppuccin, GitHub Dark, One Dark, Monokai, GitHub Light)
|
|
23
|
+
- **ํ
ํ๋ฆฟ** โ ์ฌ์ฌ์ฉ ๊ฐ๋ฅํ worktree ํ๋ฆฌ์
(`cop add --template review`)
|
|
24
|
+
- **ํฌ๋ก์ค worktree ์คํ** โ ๋ชจ๋ worktree์์ ๋ช
๋ น ์คํ (`cop exec "bun test"`)
|
|
25
|
+
- **GitHub PR ์ฐ๋** โ PR์์ worktree ์์ฑ (`cop add --pr 123`)
|
|
26
|
+
- **ํผ์ง ๋ธ๋์น ํผ์ปค** โ TUI์์ ํ์ดํํ๋ฉด ๋ธ๋์น ์๋์์ฑ
|
|
27
|
+
- **๋ผ์ดํ์ฌ์ดํด ๊ด๋ฆฌ** โ ๋นํ์ฑ/๋จธ์ง๋ worktree ์๋ ๊ฐ์ง, ์ ํ ์ค์
|
|
28
|
+
- **์์กด์ฑ ๊ณต์ ** โ `node_modules` ๋ฑ์ ํ๋๋งํฌ/์ฌ๋ณผ๋ฆญ์ผ๋ก ๋์คํฌ ์ ์ฝ
|
|
29
|
+
- **Worktree ๋น๊ต** โ worktree ๊ฐ ๋ณ๊ฒฝ์ฌํญ ๋น๊ต (`cop diff feature/a feature/b`)
|
|
30
|
+
- **ํ ๋ณดํธ** โ worktree๋ฅผ ์๋ ์ ๋ฆฌ์์ ๋ณดํธ (`cop pin`)
|
|
31
|
+
- **ํ๋ ๋ก๊ทธ** โ ์์ฑ/์ญ์ /์ ํ/๋ฆฌ๋ค์/์์นด์ด๋ธ/์ํฌํธ ์ด๋ฒคํธ ์ถ์ (`cop log`)
|
|
32
|
+
- **์์นด์ด๋ธ** โ ์ ๊ฑฐ ์ worktree ๋ณ๊ฒฝ์ฌํญ์ ํจ์น๋ก ๋ณด์กด (`cop archive`)
|
|
33
|
+
- **๋ธ๋์น ๋ฆฌ๋ค์** โ ๋ฉํ๋ฐ์ดํฐ ๋ง์ด๊ทธ๋ ์ด์
๊ณผ ํจ๊ป worktree ๋ธ๋์น ์ด๋ฆ ๋ณ๊ฒฝ (`cop rename`)
|
|
34
|
+
- **ํด๋ก ๋ฐ ์ด๊ธฐํ** โ cop ์ค์ ๊ณผ ํจ๊ป ๋ ํฌ ํด๋ก (`cop clone`)
|
|
35
|
+
- **Worktree ์ํฌํธ** โ ์๋ ์์ฑ๋ worktree ์ฑํ (`cop import`)
|
|
36
|
+
- **์์ธ ๋ทฐ** โ ์ปค๋ฐ ํ์คํ ๋ฆฌ, diff ํต๊ณ, upstream ์ํ ํ์ธ (TUI)
|
|
37
|
+
- **์ผ๊ด ์์
** โ ๋ค์ค ์ ํ ๋ฐ ๋ฐฐ์น ์์
(TUI)
|
|
38
|
+
- **ํ ์คํธ ์๋ฆผ** โ ๋น๋๊ธฐ ์์
๊ฒฐ๊ณผ ์๋ฆผ (TUI)
|
|
39
|
+
- **์
ธ ์๋์์ฑ** โ bash/zsh/fish ํญ ์๋์์ฑ (`cop shell-init --completions`)
|
|
40
|
+
- **์ค์ ํ๋กํ** โ ์ค์ ์ธํธ ์ ํ (`cop config --profiles`)
|
|
41
|
+
- **Tmux ์ธ์
** โ worktree๋ณ tmux ์ธ์
์๋ ์์ฑ/์ข
๋ฃ, ๋ ์ด์์ ํ
ํ๋ฆฟ (`cop session`)
|
|
42
|
+
- **์ํฌ์คํ์ด์ค** โ ๋ถ๋ชจ ๋๋ ํ ๋ฆฌ ์๋์ git repo๋ฅผ ์๋ ๋ฐ๊ฒฌํ๊ณ ์ํฌ์คํ์ด์ค๋ณ defaults ์ ์ฉ (`workspaces` ์ค์ )
|
|
43
|
+
- **AI ์์ด์ ํธ ์ด๊ธฐํ** โ ๊ธฐ๋ณธ ์ค์ ํ์ผ ์์ฑ ๋๋ Claude Code, Codex, OpenCode์ฉ ์คํฌ ์ค์น (`cop init`, `cop init --skill`)
|
|
44
|
+
|
|
45
|
+
## ์๊ตฌ์ฌํญ
|
|
46
|
+
|
|
47
|
+
- [Bun](https://bun.sh) ๋ฐํ์
|
|
48
|
+
- git 2.17+
|
|
49
|
+
- macOS ๋๋ Linux
|
|
50
|
+
- [gh CLI](https://cli.github.com) (์ ํ์ฌํญ, `--pr` ํ๋๊ทธ์ฉ)
|
|
51
|
+
- [tmux](https://github.com/tmux/tmux) (์ ํ์ฌํญ, `cop session`์ฉ)
|
|
52
|
+
|
|
53
|
+
## ์ค์น
|
|
54
|
+
|
|
55
|
+
### Homebrew (macOS/Linux)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
brew install getsolaris/tap/copse
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### curl (์๋ผ์ด๋)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
curl -fsSL https://raw.githubusercontent.com/getsolaris/copse/main/install.sh | bash
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### npm / bun
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bun install -g @getsolaris/copse
|
|
71
|
+
# or
|
|
72
|
+
npm install -g @getsolaris/copse
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## ๋น ๋ฅธ ์์
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# TUI ์คํ
|
|
79
|
+
cop
|
|
80
|
+
|
|
81
|
+
# worktree ๋ชฉ๋ก
|
|
82
|
+
cop list
|
|
83
|
+
|
|
84
|
+
# ์ worktree ์์ฑ
|
|
85
|
+
cop add feature/my-feature
|
|
86
|
+
|
|
87
|
+
# ๋ชจ๋
ธ๋ ํฌ ํฌ์ปค์ค์ ํจ๊ป ์์ฑ
|
|
88
|
+
cop add feature/my-feature --focus apps/web,apps/api
|
|
89
|
+
|
|
90
|
+
# GitHub PR์์ ์์ฑ
|
|
91
|
+
cop add --pr 123
|
|
92
|
+
|
|
93
|
+
# ํ
ํ๋ฆฟ ์ฌ์ฉ
|
|
94
|
+
cop add feature/login --template review
|
|
95
|
+
|
|
96
|
+
# ๋ชจ๋ worktree์์ ๋ช
๋ น ์คํ
|
|
97
|
+
cop exec "bun test"
|
|
98
|
+
|
|
99
|
+
# ๋ worktree ๋น๊ต
|
|
100
|
+
cop diff feature/a feature/b --stat
|
|
101
|
+
|
|
102
|
+
# ํฌ์ค ์ฒดํฌ
|
|
103
|
+
cop doctor
|
|
104
|
+
|
|
105
|
+
# worktree ์ ํ (์
ธ ํตํฉ ํ์)
|
|
106
|
+
cop switch feature/my-feature
|
|
107
|
+
|
|
108
|
+
# worktree ์ ๊ฑฐ
|
|
109
|
+
cop remove feature/my-feature --yes
|
|
110
|
+
|
|
111
|
+
# ๋จธ์ง๋ worktree ์ ๋ฆฌ
|
|
112
|
+
cop clean --dry-run
|
|
113
|
+
|
|
114
|
+
# worktree ํ ์ค์ (์ ๋ฆฌ์์ ๋ณดํธ)
|
|
115
|
+
cop pin feature/important --reason "active sprint"
|
|
116
|
+
|
|
117
|
+
# ํ๋ ๋ก๊ทธ ๋ณด๊ธฐ
|
|
118
|
+
cop log
|
|
119
|
+
|
|
120
|
+
# worktree ์์นด์ด๋ธ ํ ์ ๊ฑฐ
|
|
121
|
+
cop archive feature/done --yes
|
|
122
|
+
|
|
123
|
+
# worktree ๋ธ๋์น ๋ฆฌ๋ค์
|
|
124
|
+
cop rename old-name new-name
|
|
125
|
+
|
|
126
|
+
# ๋ ํฌ ํด๋ก ๋ฐ cop ์ด๊ธฐํ
|
|
127
|
+
cop clone https://github.com/user/repo.git
|
|
128
|
+
|
|
129
|
+
# ๊ธฐ์กด worktree ์ํฌํธ
|
|
130
|
+
cop import /path/to/worktree
|
|
131
|
+
|
|
132
|
+
# worktree์ tmux ์ธ์
์ด๊ธฐ/์ฐ๊ฒฐ
|
|
133
|
+
cop session feature/my-feature
|
|
134
|
+
|
|
135
|
+
# tmux ์ธ์
๊ณผ ํจ๊ป worktree ์์ฑ
|
|
136
|
+
cop add feature/new --session
|
|
137
|
+
|
|
138
|
+
# ์ค์ ํ์ผ ์ด๊ธฐํ
|
|
139
|
+
cop init
|
|
140
|
+
|
|
141
|
+
# AI ์์ด์ ํธ ์คํฌ ํ์ผ ์์ฑ
|
|
142
|
+
cop init --skill claude-code
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## TUI ์ฌ์ฉ๋ฒ
|
|
146
|
+
|
|
147
|
+
`cop` (์ธ์ ์์ด)๋ก ์คํํฉ๋๋ค.
|
|
148
|
+
|
|
149
|
+
### ํค๋ณด๋ ๋จ์ถํค
|
|
150
|
+
|
|
151
|
+
| ํค | ๋์ |
|
|
152
|
+
|----|------|
|
|
153
|
+
| `j` / `k` | worktree ๋ชฉ๋ก ํ์ |
|
|
154
|
+
| `a` | worktree ์ถ๊ฐ |
|
|
155
|
+
| `d` | worktree ์ญ์ |
|
|
156
|
+
| `o` | ์๋ํฐ๋ก ์ด๊ธฐ (focus ์ธ์) |
|
|
157
|
+
| `h` | Doctor (ํฌ์ค ์ฒดํฌ) |
|
|
158
|
+
| `r` | ๋ชฉ๋ก ์๋ก๊ณ ์นจ |
|
|
159
|
+
| `Ctrl+P` | ์ปค๋งจ๋ ํ๋ ํธ |
|
|
160
|
+
| `Enter` | ์์ธ ๋ทฐ ์ด๊ธฐ |
|
|
161
|
+
| `Escape` | ์์ธ ๋ทฐ / ํผ์ปค ๋ซ๊ธฐ |
|
|
162
|
+
| `Space` | worktree ์ ํ ํ ๊ธ |
|
|
163
|
+
| `Ctrl+A` | ๋ชจ๋ worktree ์ ํ |
|
|
164
|
+
| `x` | ์ผ๊ด ์์
๋ฉ๋ด |
|
|
165
|
+
| `?` | ๋์๋ง |
|
|
166
|
+
| `q` | ์ข
๋ฃ |
|
|
167
|
+
|
|
168
|
+
#### `o` โ Focus๋ฅผ ์ธ์ํ๋ ์๋ํฐ ์ด๊ธฐ
|
|
169
|
+
|
|
170
|
+
`o`๋ฅผ ๋๋ฅด๋ฉด ์ ํ๋ worktree๋ฅผ `$VISUAL` / `$EDITOR`๋ก ์ฝ๋๋ค:
|
|
171
|
+
|
|
172
|
+
- **focus ๊ฒฝ๋ก ์์** โ worktree ๋ฃจํธ๋ฅผ ์ฝ๋๋ค.
|
|
173
|
+
- **focus ๊ฒฝ๋ก 1๊ฐ** โ `<worktree>/<focus>`๋ฅผ ๋ฐ๋ก ์ฝ๋๋ค.
|
|
174
|
+
- **focus ๊ฒฝ๋ก 2๊ฐ ์ด์** โ ํผ์ปค๊ฐ ๋ ์ ์ด๋ค focus ๊ฒฝ๋ก(๋๋ worktree ๋ฃจํธ)๋ฅผ ์ด์ง ์ ํํ ์ ์์ต๋๋ค.
|
|
175
|
+
|
|
176
|
+
ํผ์ปค๋ `j`/`k` ๋๋ `โ`/`โ`๋ก ํ์, `Enter`๋ก ์ด๊ธฐ, `Esc`๋ก ์ทจ์ํฉ๋๋ค.
|
|
177
|
+
|
|
178
|
+
### ์ปค๋งจ๋ ํ๋ ํธ (`Ctrl+P`)
|
|
179
|
+
|
|
180
|
+
๊ฒ์ ๊ฐ๋ฅํ ์ปค๋งจ๋ ๋ฉ๋ด:
|
|
181
|
+
- worktree ์ถ๊ฐ / ์ญ์ / ์๋ก๊ณ ์นจ
|
|
182
|
+
- Doctor ์คํ
|
|
183
|
+
- ์ค์ ์ด๊ธฐ
|
|
184
|
+
- ํ
๋ง ๋ณ๊ฒฝ
|
|
185
|
+
- ์ข
๋ฃ
|
|
186
|
+
|
|
187
|
+
ํ์ดํ์ผ๋ก ํํฐ, `โโ`์ผ๋ก ํ์, `Enter`๋ก ์คํ, `Esc`๋ก ๋ซ๊ธฐ.
|
|
188
|
+
|
|
189
|
+
### Worktree ์์ฑ ํ๋ฆ
|
|
190
|
+
|
|
191
|
+
1. `a`๋ฅผ ๋๋ฌ ์์ฑ ๋ทฐ ์ด๊ธฐ
|
|
192
|
+
2. ๋ธ๋์น๋ช
์
๋ ฅ ์์ โ ํ์ดํํ๋ฉด ๋งค์นญ๋๋ ๋ธ๋์น๊ฐ ํ์๋จ
|
|
193
|
+
3. `โโ`์ผ๋ก ์ถ์ฒ ๋ธ๋์น ์ ํ, ๋๋ ๊ณ์ ์
๋ ฅํ์ฌ ์ ๋ธ๋์น ์์ฑ
|
|
194
|
+
4. `Tab`์ผ๋ก Focus ํ๋ ์ ํ (์ ํ์ฌํญ)
|
|
195
|
+
5. ํฌ์ปค์ค ๊ฒฝ๋ก ์
๋ ฅ (์: `apps/web,apps/api`)
|
|
196
|
+
6. `Enter`๋ก ๋ฏธ๋ฆฌ๋ณด๊ธฐ
|
|
197
|
+
7. `Enter`๋ก ํ์ธ
|
|
198
|
+
|
|
199
|
+
ํผ์ง ๋ธ๋์น ํผ์ปค๋ ๋ก์ปฌ/๋ฆฌ๋ชจํธ ๋ธ๋์น๋ฅผ ๋ง์ง๋ง ์ปค๋ฐ ๋ ์ง ์์ผ๋ก ์ ๋ ฌํ์ฌ ์ค์๊ฐ ํํฐ๋งํฉ๋๋ค.
|
|
200
|
+
|
|
201
|
+
์์ฑ ํ ์ค์ ๋ `copyFiles`, `linkFiles`, `postCreate` ํ
, ๋ชจ๋
ธ๋ ํฌ ํ
์ด ์๋์ผ๋ก ์คํ๋ฉ๋๋ค.
|
|
202
|
+
|
|
203
|
+
### Doctor ๋ทฐ
|
|
204
|
+
|
|
205
|
+
`h`๋ฅผ ๋๋ฌ Doctor ํญ์ ์ฝ๋๋ค. ํฌ์ค ์ฒดํฌ ๊ฒฐ๊ณผ ํ์:
|
|
206
|
+
- โ Git ๋ฒ์ ํ์ธ
|
|
207
|
+
- โ ์ค์ ์ ํจ์ฑ ๊ฒ์ฆ
|
|
208
|
+
- โ ๋นํ์ฑ worktree ๊ฐ์ง
|
|
209
|
+
- โ ๊ณ ์ ๋๋ ํ ๋ฆฌ ๊ฐ์ง
|
|
210
|
+
- โ ์ ๊ธ ์ํ ํ์ธ
|
|
211
|
+
- โ ๋ํฐ worktree ๊ฐ์ง
|
|
212
|
+
|
|
213
|
+
`r`๋ก ์ฌํ์ธ, `Esc`๋ก ๋์๊ฐ๊ธฐ.
|
|
214
|
+
|
|
215
|
+
### Config ๋ทฐ
|
|
216
|
+
|
|
217
|
+
`Ctrl+P` โ `Open Config`๋ก ์ฝ๋๋ค. Config ํญ์ `~/.config/copse/config.json`์ ์ ์ฒด ๋ด์ฉ์ ๋ ๋๋งํฉ๋๋ค:
|
|
218
|
+
|
|
219
|
+
- ์ต์์: `version`, `theme`, `activeProfile`
|
|
220
|
+
- `defaults` (`postRemove`, `autoUpstream`, `sharedDeps` ํฌํจ)
|
|
221
|
+
- ๋ชจ๋ ๋ ํฌ๋ณ ์ค๋ฒ๋ผ์ด๋
|
|
222
|
+
- ์ ์ฒด `monorepo` ํธ๋ฆฌ โ `autoDetect`, `extraPatterns`, ๊ฐ `hooks[]` ํญ๋ชฉ๊ณผ `glob` / `copyFiles` / `linkFiles` / `postCreate` / `postRemove`
|
|
223
|
+
- `templates`, `lifecycle`, `sessions`, `profiles`
|
|
224
|
+
|
|
225
|
+
๋๋ถ๋ถ์ ์ค์นผ๋ผ/๋ฌธ์์ด ๋ฐฐ์ด ํ๋๋ ์ธ๋ผ์ธ์ผ๋ก ์์ ๊ฐ๋ฅํฉ๋๋ค. ํค๋ ์นด์ดํฐ(`1/20`)๋ ํ์ฌ ์ ํ๋ ํ๋ ์์น๋ฅผ ๋ํ๋
๋๋ค.
|
|
226
|
+
|
|
227
|
+
| ํค | ๋์ |
|
|
228
|
+
| --- | --- |
|
|
229
|
+
| `j` / `k` | ์์ ๊ฐ๋ฅํ ํ๋ ์ด๋ |
|
|
230
|
+
| `g` / `G` | ์ฒซ ๋ฒ์งธ / ๋ง์ง๋ง ํ๋๋ก ์ด๋ |
|
|
231
|
+
| `Enter` | ์ ํ๋ ํ๋ ํธ์ง ์์ |
|
|
232
|
+
| `Tab` | ํ๋ฆฌ์
๊ฐ ์ํ (ํธ์ง ๋ชจ๋) |
|
|
233
|
+
| `Space` / `โโ` | ๋ถ๋ฆฌ์ธ ํ ๊ธ / ํ
๋ง ๋ณ๊ฒฝ (ํธ์ง ๋ชจ๋) |
|
|
234
|
+
| `Enter` | ํธ์ง ์ปค๋ฐ (๋์คํฌ์ ์ ์ฅ ํ ์ฌ๋ก๋) |
|
|
235
|
+
| `Esc` | ํธ์ง ์ทจ์ |
|
|
236
|
+
| `e` | `$EDITOR`๋ก config ํ์ผ ์ด๊ธฐ |
|
|
237
|
+
| `r` | ๋์คํฌ์์ ํ์ผ ์ฌ๋ก๋ |
|
|
238
|
+
| `i` | ์ค์ ํ์ผ ์ด๊ธฐํ |
|
|
239
|
+
|
|
240
|
+
์ธ๋ผ์ธ ํธ์ง์ ๋ค์ฏ ์ข
๋ฅ์ ํ๋๋ฅผ ์ง์ํฉ๋๋ค:
|
|
241
|
+
|
|
242
|
+
- **๋ฌธ์์ด** โ ์ผ๋ฐ ํ
์คํธ ์
๋ ฅ (์: `worktreeDir`, ํ
`glob`, `sessions.prefix`). `Tab`์ผ๋ก ์์ฃผ ์ฐ์ด๋ ํ๋ฆฌ์
์ํ
|
|
243
|
+
- **๋ฌธ์์ด ๋ฐฐ์ด** โ `[".env", ".env.local"]` ๊ฐ์ JSON ์
๋ ฅ. ๋น ์
๋ ฅ์ `[]`๋ก ์ฒ๋ฆฌ. `Tab`์ผ๋ก ํ๋ฆฌ์
์ํ (`[]` ๋น ๋ฐฐ์ด๋ ์ฒซ ํ๋ฆฌ์
์ผ๋ก ํฌํจ)
|
|
244
|
+
- **๋ถ๋ฆฌ์ธ** โ `Space`, `Tab`, `โโ`๋ก ํ ๊ธ, `Enter`๋ก ์ปค๋ฐ
|
|
245
|
+
- **ํ
๋ง** โ `Tab` ๋๋ `โโ`๋ก ์ํ, `Enter`๋ก ์ปค๋ฐ. ์ ํ
๋ง๋ ์ฆ์ ์ ์ฉ๋จ
|
|
246
|
+
- **Enum** โ ์ ํจํ ๊ฐ์ด ๊ณ ์ ๋ ํ๋ (์: `sharedDeps.strategy` = `hardlink` / `symlink` / `copy`). `Tab` ๋๋ `โโ`๋ก ์ํ, `Enter`๋ก ์ปค๋ฐ
|
|
247
|
+
|
|
248
|
+
ํธํฐ์ ํ์ฌ ํ๋ฆฌ์
์์น๊ฐ ํ์๋ฉ๋๋ค (์: `Tab:preset (2/4)`). ์ํ์ ํ์ฌ ๊ฐ๊ณผ ์ผ์นํ๋ ์์น์์ ์์ํ๋ฏ๋ก, ์ฒซ `Tab` ์
๋ ฅ์ ํญ์ ๋ค๋ฅธ ๊ฐ์ผ๋ก ์ด๋ํฉ๋๋ค.
|
|
249
|
+
|
|
250
|
+
์ปค๋ฐ ์ `validateConfig`๋ก ์ ํจ์ฑ ๊ฒ์ฆ ํ ํ์ผ์ ๊ธฐ๋กํฉ๋๋ค. ์ ํจํ์ง ์์ ์
๋ ฅ์ ์ธ๋ผ์ธ ์๋ฌ๋ก ํ์๋๋ฉฐ ์์ ํ ์ ์๋๋ก ํธ์ง ๋ชจ๋๊ฐ ์ ์ง๋ฉ๋๋ค. ๋ณต์กํ ํ๋(`sessions.layouts`, `templates`, `profiles`)๋ `e`๋ก `$EDITOR`๋ฅผ ์ด์ด ํธ์งํ์ธ์.
|
|
251
|
+
|
|
252
|
+
## CLI ์ปค๋งจ๋
|
|
253
|
+
|
|
254
|
+
| ์ปค๋งจ๋ | ์ค๋ช
|
|
|
255
|
+
|--------|------|
|
|
256
|
+
| `cop` | TUI ์คํ |
|
|
257
|
+
| `cop list` | ๋ชจ๋ worktree ๋ชฉ๋ก (ํฌ์ปค์ค ์ ๋ณด ํฌํจ) |
|
|
258
|
+
| `cop add <branch>` | worktree ์์ฑ |
|
|
259
|
+
| `cop remove <branch>` | worktree ์ ๊ฑฐ |
|
|
260
|
+
| `cop switch <branch>` | worktree ์ ํ |
|
|
261
|
+
| `cop clean` | ๋จธ์ง๋ worktree ์ ๊ฑฐ |
|
|
262
|
+
| `cop doctor` | worktree ํฌ์ค ์ฒดํฌ |
|
|
263
|
+
| `cop config` | ์ค์ ๊ด๋ฆฌ |
|
|
264
|
+
| `cop exec <command>` | ๊ฐ worktree์์ ๋ช
๋ น ์คํ |
|
|
265
|
+
| `cop diff <ref1> [ref2]` | worktree/๋ธ๋์น ๊ฐ diff |
|
|
266
|
+
| `cop pin <branch>` | worktree ํ/์ธํ (์ ๋ฆฌ์์ ๋ณดํธ) |
|
|
267
|
+
| `cop log` | worktree ํ๋ ๋ก๊ทธ ๋ณด๊ธฐ |
|
|
268
|
+
| `cop archive <branch>` | ๋ณ๊ฒฝ์ฌํญ ์์นด์ด๋ธ ํ ์ ํ์ ์ ๊ฑฐ |
|
|
269
|
+
| `cop rename <old> <new>` | worktree ๋ธ๋์น ๋ฆฌ๋ค์ |
|
|
270
|
+
| `cop clone <url>` | ๋ ํฌ ํด๋ก ๋ฐ cop ์ด๊ธฐํ |
|
|
271
|
+
| `cop import <path>` | cop ๋ฉํ๋ฐ์ดํฐ๋ก worktree ์ฑํ |
|
|
272
|
+
| `cop session [branch]` | worktree์ tmux ์ธ์
๊ด๋ฆฌ |
|
|
273
|
+
| `cop open [branch]` | worktree๋ฅผ ์๋ํฐ๋ก ์ด๊ธฐ (focus ์ธ์) |
|
|
274
|
+
| `cop init` | ์ค์ ์ด๊ธฐํ ๋๋ AI ์์ด์ ํธ ์คํฌ ์ค์น |
|
|
275
|
+
|
|
276
|
+
### `cop add`
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
cop add feature/login # ํ์ํ๋ฉด ๋ธ๋์น๋ฅผ ๋ง๋ค๊ณ worktree ์์ฑ
|
|
280
|
+
cop add feature/login --base main # ์ ๋ธ๋์น๋ main์์ ์์
|
|
281
|
+
cop add existing-branch # ๊ธฐ์กด ๋ธ๋์น๋ก worktree ์์ฑ
|
|
282
|
+
|
|
283
|
+
# ๋ชจ๋
ธ๋ ํฌ: ํฌ์ปค์ค ํจํค์ง์ ํจ๊ป ์์ฑ
|
|
284
|
+
cop add feature/login --focus apps/web,apps/api
|
|
285
|
+
cop add feature/login --focus apps/web --focus apps/api
|
|
286
|
+
|
|
287
|
+
# ํ
ํ๋ฆฟ ์ฌ์ฉ
|
|
288
|
+
cop add feature/login --template review
|
|
289
|
+
|
|
290
|
+
# GitHub PR์์ ์์ฑ (gh CLI ํ์)
|
|
291
|
+
cop add --pr 123
|
|
292
|
+
cop add --pr 456 --template review
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### `cop doctor`
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
cop doctor # ์ฌ๋์ด ์ฝ๊ธฐ ์ฌ์ด ์ถ๋ ฅ
|
|
299
|
+
cop doctor --json # ์คํฌ๋ฆฝํ
์ฉ JSON ์ถ๋ ฅ
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
์ข
๋ฃ ์ฝ๋: ์ ์์ด๋ฉด `0`, ๊ฒฝ๊ณ ๋๋ ์๋ฌ๊ฐ ์์ผ๋ฉด `1`.
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
copse doctor
|
|
306
|
+
|
|
307
|
+
โ Git version: 2.39.0 (>= 2.17 required)
|
|
308
|
+
โ Configuration: valid
|
|
309
|
+
โ Stale worktrees: none
|
|
310
|
+
โ Orphaned directories: none
|
|
311
|
+
โ Worktree locks: all clear
|
|
312
|
+
โ Dirty worktrees: none
|
|
313
|
+
|
|
314
|
+
All checks passed.
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### `cop list`
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
cop list # Focus ์ปฌ๋ผ์ด ํฌํจ๋ ํ
์ด๋ธ
|
|
321
|
+
cop list --json # ํฌ์ปค์ค ๋ฐฐ์ด์ด ํฌํจ๋ JSON
|
|
322
|
+
cop list --porcelain # ๋จธ์ ํ๋
๊ฐ๋ฅ ํ์
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
๋ชจ๋
ธ๋ ํฌ worktree๋ณ ํฌ์ปค์ค ๊ฒฝ๋ก๋ฅผ `Focus` ์ปฌ๋ผ์ ํ์ํฉ๋๋ค.
|
|
326
|
+
|
|
327
|
+
### `cop remove`
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
cop remove feature/login # ๋ธ๋์น๋ช
์ผ๋ก ์ ๊ฑฐ
|
|
331
|
+
cop remove feature/login --force # ๊ฐ์ ์ ๊ฑฐ (๋ํฐ worktree)
|
|
332
|
+
cop remove feature/login --yes # ํ์ธ ๊ฑด๋๋ฐ๊ธฐ
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### `cop clean`
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
cop clean --dry-run # ์ ๊ฑฐ๋ ํญ๋ชฉ ๋ฏธ๋ฆฌ๋ณด๊ธฐ
|
|
339
|
+
cop clean # ๋จธ์ง๋ worktree ๋ชจ๋ ์ ๊ฑฐ
|
|
340
|
+
cop clean --stale # ๋นํ์ฑ worktree๋ ํ์ (lifecycle ์ค์ ์ฌ์ฉ)
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### `cop exec`
|
|
344
|
+
|
|
345
|
+
๋ชจ๋ ๋น-๋ฉ์ธ worktree์์ ์
ธ ์ปค๋งจ๋๋ฅผ ์คํํฉ๋๋ค.
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
cop exec "bun test" # ๋ชจ๋ worktree์์ ์คํ (์์ฐจ)
|
|
349
|
+
cop exec "bun test" --parallel # ๋ณ๋ ฌ ์คํ
|
|
350
|
+
cop exec "git pull" --all # ๋ชจ๋ ์ค์ ๋ ๋ ํฌ์์ ์คํ
|
|
351
|
+
cop exec "bun install" --dirty # ๋ํฐ worktree๋ง
|
|
352
|
+
cop exec "git rebase main" --behind # upstream๋ณด๋ค ๋ค์ฒ์ง ๊ฒ๋ง
|
|
353
|
+
cop exec "bun test" --json # JSON ์ถ๋ ฅ
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
| ํ๋๊ทธ | ์ค๋ช
|
|
|
357
|
+
|--------|------|
|
|
358
|
+
| `--parallel` / `-p` | ๋ณ๋ ฌ ์คํ |
|
|
359
|
+
| `--all` / `-a` | ๋ชจ๋ ์ค์ ๋ ๋ ํฌ ํฌํจ |
|
|
360
|
+
| `--dirty` | ๋ํฐ worktree์์๋ง ์คํ |
|
|
361
|
+
| `--clean` | ํด๋ฆฐ worktree์์๋ง ์คํ |
|
|
362
|
+
| `--behind` | upstream๋ณด๋ค ๋ค์ฒ์ง worktree์์๋ง ์คํ |
|
|
363
|
+
| `--json` / `-j` | ๊ฒฐ๊ณผ๋ฅผ JSON์ผ๋ก ์ถ๋ ฅ |
|
|
364
|
+
|
|
365
|
+
์ปค๋งจ๋์์ ์ฌ์ฉ ๊ฐ๋ฅํ ํ๊ฒฝ๋ณ์: `COP_BRANCH`, `COP_WORKTREE_PATH`, `COP_REPO_PATH`.
|
|
366
|
+
|
|
367
|
+
### `cop diff`
|
|
368
|
+
|
|
369
|
+
๋ worktree ๋ธ๋์น ๊ฐ diff๋ฅผ ๋ณด์ฌ์ค๋๋ค.
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
cop diff feature/a feature/b # ์ ์ฒด diff
|
|
373
|
+
cop diff feature/a feature/b --stat # diffstat ์์ฝ
|
|
374
|
+
cop diff feature/a --name-only # ๋ณ๊ฒฝ๋ ํ์ผ๋ช
๋ง
|
|
375
|
+
cop diff feature/a # ํ์ฌ HEAD์ ๋น๊ต
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### `cop pin`
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
cop pin feature/auth --reason "active sprint" # ์ฌ์ ์ ํจ๊ป ํ
|
|
382
|
+
cop pin --list # ํ๋ worktree ๋ชฉ๋ก
|
|
383
|
+
cop pin --list --json # JSON ์ถ๋ ฅ
|
|
384
|
+
cop unpin feature/auth # ์ธํ
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
ํ๋ worktree๋ `cop clean` ๋ฐ ๋ผ์ดํ์ฌ์ดํด ์๋ ์ ๋ฆฌ์์ ์ ์ธ๋ฉ๋๋ค.
|
|
388
|
+
|
|
389
|
+
### `cop log`
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
cop log # ์ต๊ทผ 20๊ฐ ์ด๋ฒคํธ ํ์
|
|
393
|
+
cop log --limit 50 # ์ต๊ทผ 50๊ฐ ์ด๋ฒคํธ ํ์
|
|
394
|
+
cop log --json # JSON ์ถ๋ ฅ
|
|
395
|
+
cop log --clear # ํ๋ ๋ก๊ทธ ์ด๊ธฐํ
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
์ด๋ฒคํธ๋ ์์์ผ๋ก ๊ตฌ๋ถ: ์์ฑ(์ด๋ก), ์ญ์ (๋นจ๊ฐ), ์ ํ(ํ๋), ๋ฆฌ๋ค์(๋
ธ๋), ์์นด์ด๋ธ(์ํ), ์ํฌํธ(์์).
|
|
399
|
+
|
|
400
|
+
### `cop archive`
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
cop archive feature/done --yes # ์์นด์ด๋ธ ํ ์ ๊ฑฐ
|
|
404
|
+
cop archive feature/wip --keep # ์ ๊ฑฐ ์์ด ์์นด์ด๋ธ๋ง
|
|
405
|
+
cop archive --list # ๋ชจ๋ ์์นด์ด๋ธ ๋ชฉ๋ก
|
|
406
|
+
cop archive --list --json # JSON ์ถ๋ ฅ
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
์์นด์ด๋ธ๋ `~/.copse/archives/`์ ํจ์น ํ์ผ๋ก ์ ์ฅ๋ฉ๋๋ค.
|
|
410
|
+
|
|
411
|
+
### `cop rename`
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
cop rename old-branch new-branch # ๋ธ๋์น ๋ฆฌ๋ค์
|
|
415
|
+
cop rename old-branch new-branch --move-path # worktree ๋๋ ํ ๋ฆฌ๋ ์ด๋
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### `cop clone`
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
cop clone https://github.com/user/repo.git # ํด๋ก ๋ฐ ์ด๊ธฐํ
|
|
422
|
+
cop clone https://github.com/user/repo.git ./my-dir # ์ปค์คํ
๋์ ๊ฒฝ๋ก
|
|
423
|
+
cop clone https://github.com/user/repo.git --template review # ํ
ํ๋ฆฟ ์ ์ฉ
|
|
424
|
+
cop clone https://github.com/user/repo.git --no-init-config # ์ค์ ์ด๊ธฐํ ๊ฑด๋๋ฐ๊ธฐ
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### `cop import`
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
cop import /path/to/worktree # worktree ์ฑํ
|
|
431
|
+
cop import /path/to/worktree --focus apps/web,apps/api # ํฌ์ปค์ค์ ํจ๊ป
|
|
432
|
+
cop import /path/to/worktree --pin # ์ฆ์ ํ ์ค์
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### `cop session`
|
|
436
|
+
|
|
437
|
+
worktree์ tmux ์ธ์
์ ๊ด๋ฆฌํฉ๋๋ค. tmux๊ฐ ํ์ํฉ๋๋ค.
|
|
438
|
+
|
|
439
|
+
```bash
|
|
440
|
+
cop session feature/auth # ์ธ์
์ด๊ธฐ/์ฐ๊ฒฐ (์์ผ๋ฉด ์์ฑ)
|
|
441
|
+
cop session feature/auth --layout api # ์ค์ ์ ๋ ์ด์์ ์ฌ์ฉ
|
|
442
|
+
cop session --list # ํ์ฑ cop ์ธ์
๋ชฉ๋ก
|
|
443
|
+
cop session --list --json # JSON ์ถ๋ ฅ
|
|
444
|
+
cop session feature/auth --kill # worktree ์ธ์
์ข
๋ฃ
|
|
445
|
+
cop session --kill-all # ๋ชจ๋ cop ์ธ์
์ข
๋ฃ
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
์ค์ ์์ `sessions.autoCreate` / `sessions.autoKill`์ ํ์ฑํํ๋ฉด ์ธ์
์ด ์๋ ์์ฑ/์ข
๋ฃ๋ฉ๋๋ค.
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
# tmux ์ธ์
๊ณผ ํจ๊ป worktree ์์ฑ
|
|
452
|
+
cop add feature/login --session
|
|
453
|
+
cop add feature/login --session --layout api
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
`sessions.enabled`๊ฐ `true`์ด๊ณ tmux ์์ ์์ผ๋ฉด, `cop switch`๊ฐ ๋์ worktree์ tmux ์ธ์
์ผ๋ก ์๋ ์ ํํฉ๋๋ค.
|
|
457
|
+
|
|
458
|
+
### `cop open`
|
|
459
|
+
|
|
460
|
+
worktree๋ฅผ ์๋ํฐ/IDE๋ก ์ฝ๋๋ค. `$VISUAL` / `$EDITOR`๋ฅผ ์๋ ๊ฐ์งํ๊ณ , ์์ผ๋ฉด ์๋ ค์ง ์๋ํฐ ๋ชฉ๋ก(`code`, `cursor`, `vim`, `nvim`, `emacs`, `nano`, `subl`, `zed`, `idea`, `webstorm`)์์ ์ฐพ์ต๋๋ค.
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
cop open # ํ์ฌ worktree ์ด๊ธฐ
|
|
464
|
+
cop open feature/auth # ํน์ worktree ์ด๊ธฐ
|
|
465
|
+
cop open feature/auth -e nvim # ์๋ํฐ ๊ฐ์ ์ง์
|
|
466
|
+
|
|
467
|
+
# Focus ์ธ์ ๋์ (--focus๋ก ์์ฑ๋ worktree์์)
|
|
468
|
+
cop open feature/auth # focus 1๊ฐ โ ํด๋น focus ๊ฒฝ๋ก๋ก ์ด๋ฆผ
|
|
469
|
+
# focus 2๊ฐ+ โ ์๋ฌ + ํํธ ์ถ๋ ฅ
|
|
470
|
+
cop open feature/auth --focus apps/web # ํน์ focus ๊ฒฝ๋ก ์ ํ
|
|
471
|
+
cop open feature/auth -f apps/api # ์งง์ ๋ณ์นญ
|
|
472
|
+
cop open feature/auth --root # focus ๋ฌด์ํ๊ณ worktree ๋ฃจํธ ๊ฐ์
|
|
473
|
+
|
|
474
|
+
cop open --list-editors # ๊ฐ์ง๋ ์๋ํฐ ๋ชฉ๋ก
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
| ํ๋๊ทธ | ๋ณ์นญ | ์ค๋ช
|
|
|
478
|
+
| ------ | ---- | ---- |
|
|
479
|
+
| `--editor` | `-e` | ์ฌ์ฉํ ์๋ํฐ (`$VISUAL`/`$EDITOR` ๋ฌด์) |
|
|
480
|
+
| `--focus` | `-f` | ํน์ focus ๊ฒฝ๋ก ์ด๊ธฐ (worktree์ ์ค์ ๋ focus ํญ๋ชฉ๊ณผ ์ผ์นํด์ผ ํจ) |
|
|
481
|
+
| `--root` | | focus๋ฅผ ๋ฌด์ํ๊ณ worktree ๋ฃจํธ ๊ฐ์ ์ด๊ธฐ |
|
|
482
|
+
| `--list-editors` | | ๊ฐ์ง๋ ์๋ํฐ ๋ชฉ๋ก |
|
|
483
|
+
|
|
484
|
+
**Focus ํด์ ๊ท์น:**
|
|
485
|
+
|
|
486
|
+
- focus ๊ฒฝ๋ก ์์ โ worktree ๋ฃจํธ๋ฅผ ์ฝ๋๋ค.
|
|
487
|
+
- focus ๊ฒฝ๋ก 1๊ฐ โ `<worktree>/<focus>`๋ฅผ ์๋์ผ๋ก ์ฝ๋๋ค.
|
|
488
|
+
- focus ๊ฒฝ๋ก 2๊ฐ ์ด์ โ ์๋ฌ๋ฅผ ๋ด๊ณ `--focus <path>` ๋๋ `--root`๋ฅผ ์๊ตฌํฉ๋๋ค (TUI์์๋ ๋์ ์ธํฐ๋ํฐ๋ธ ํผ์ปค๋ฅผ ๋์๋๋ค).
|
|
489
|
+
|
|
490
|
+
### `cop init`
|
|
491
|
+
|
|
492
|
+
๊ธฐ๋ณธ์ ์ผ๋ก cop ์ค์ ํ์ผ์ ์ด๊ธฐํํ๊ณ , ํ์ํ๋ฉด AI ์ฝ๋ฉ ์์ด์ ํธ์ฉ ์คํฌ๋ ์ค์นํฉ๋๋ค.
|
|
493
|
+
|
|
494
|
+
```bash
|
|
495
|
+
cop init # โ ~/.config/copse/config.json
|
|
496
|
+
cop init --skill claude-code # โ ~/.claude/skills/cop/
|
|
497
|
+
cop init --skill codex # โ ~/.agents/skills/cop/
|
|
498
|
+
cop init --skill opencode # โ ~/.config/opencode/skill/cop/
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
| ํ๋ซํผ | ์คํฌ ๊ฒฝ๋ก |
|
|
502
|
+
|--------|----------|
|
|
503
|
+
| `claude-code` | `~/.claude/skills/cop/` |
|
|
504
|
+
| `codex` | `~/.agents/skills/cop/` |
|
|
505
|
+
| `opencode` | `~/.config/opencode/skill/cop/` |
|
|
506
|
+
|
|
507
|
+
๊ฐ ์คํฌ ๋๋ ํ ๋ฆฌ์๋ ๋ค์์ด ํฌํจ๋ฉ๋๋ค:
|
|
508
|
+
- `SKILL.md` โ ๊ฐ์์ ๊ณตํต ์ํฌํ๋ก์ฐ
|
|
509
|
+
- `references/` โ ๋ช
๋ น๋ณ ์์ธ ๋ฌธ์ (21๊ฐ ํ์ผ)
|
|
510
|
+
|
|
511
|
+
`--skill` ์์ด ์คํํ๋ฉด ๊ธฐ์กด ์ค์ ์ด๊ธฐํ ๋ก์ง์ ์ฌ์ฌ์ฉํ์ฌ `config.json`๋ง ์์ฑํฉ๋๋ค.
|
|
512
|
+
๋ฉฑ๋ฑ์ฑ โ ๋ค์ ์คํํ๋ฉด ์คํฌ ๋๋ ํ ๋ฆฌ๋ฅผ ์
๋ฐ์ดํธํฉ๋๋ค.
|
|
513
|
+
|
|
514
|
+
#### ์ฒซ ์คํ ์ ์๋ ์ด๊ธฐํ
|
|
515
|
+
|
|
516
|
+
`cop init`์ ์ง์ ์คํํ ํ์๊ฐ ์์ต๋๋ค. ์ฒ์์ผ๋ก `cop` ๋ช
๋ น์ด(๋๋ TUI)๋ฅผ ์คํํ ๋ `~/.config/copse/config.json`์ด ์์ผ๋ฉด, cop๊ฐ ๊ธฐ๋ณธ ์ค์ ์ผ๋ก ์๋ ์์ฑํ๊ณ stderr์ ํ ์ค์ง๋ฆฌ ์๋ฆผ์ ์ถ๋ ฅํฉ๋๋ค:
|
|
517
|
+
|
|
518
|
+
```
|
|
519
|
+
cop: created default config at /Users/you/.config/copse/config.json
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
์ด ์๋ฆผ์ stdout์ด TTY๊ฐ ์๋ ๋(ํ์ดํ, ์คํฌ๋ฆฝํธ, CI ํ๊ฒฝ)์ `cop init`์ ๋ช
์์ ์ผ๋ก ์คํํ ๋(์ค๋ณต ๋ฉ์์ง ๋ฐฉ์ง)๋ ํ์๋์ง ์์ต๋๋ค. ์๋ ์ด๊ธฐํ๋ ๋ฉฑ๋ฑ์ฑ์ ๊ฐ์ง๋ฏ๋ก ์ดํ ์คํ์์๋ ์๋ฌด ๋์๋ ํ์ง ์์ต๋๋ค.
|
|
523
|
+
|
|
524
|
+
## ์ค์
|
|
525
|
+
|
|
526
|
+
์ค์ ํ์ผ: `~/.config/copse/config.json`
|
|
527
|
+
|
|
528
|
+
์ด๊ธฐํ: `cop config --init` (๋๋ ์๋ฌด `cop` ๋ช
๋ น์ด ์คํ โ [์ฒซ ์คํ ์ ์๋ ์ด๊ธฐํ](#์ฒซ-์คํ-์-์๋-์ด๊ธฐํ) ์ฐธ์กฐ)
|
|
529
|
+
|
|
530
|
+
### ์ ์ฒด ์์
|
|
531
|
+
|
|
532
|
+
```json
|
|
533
|
+
{
|
|
534
|
+
"$schema": "https://raw.githubusercontent.com/getsolaris/copse/main/schema.json",
|
|
535
|
+
"version": 1,
|
|
536
|
+
"theme": "dracula",
|
|
537
|
+
"defaults": {
|
|
538
|
+
"worktreeDir": "~/.copse/worktrees/{repo}-{branch}",
|
|
539
|
+
"copyFiles": [".env"],
|
|
540
|
+
"linkFiles": ["node_modules"],
|
|
541
|
+
"postCreate": ["bun install"],
|
|
542
|
+
"postRemove": [],
|
|
543
|
+
"sharedDeps": {
|
|
544
|
+
"strategy": "hardlink",
|
|
545
|
+
"paths": ["node_modules"],
|
|
546
|
+
"invalidateOn": ["package.json", "bun.lockb"]
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
"templates": {
|
|
550
|
+
"review": {
|
|
551
|
+
"copyFiles": [".env.local"],
|
|
552
|
+
"postCreate": ["bun install", "bun run build"],
|
|
553
|
+
"autoUpstream": true
|
|
554
|
+
},
|
|
555
|
+
"hotfix": {
|
|
556
|
+
"base": "main",
|
|
557
|
+
"copyFiles": [".env.production"],
|
|
558
|
+
"postCreate": ["bun install"]
|
|
559
|
+
},
|
|
560
|
+
"experiment": {
|
|
561
|
+
"worktreeDir": "~/tmp/experiments/{branch}",
|
|
562
|
+
"postRemove": []
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
"lifecycle": {
|
|
566
|
+
"autoCleanMerged": true,
|
|
567
|
+
"staleAfterDays": 14,
|
|
568
|
+
"maxWorktrees": 10
|
|
569
|
+
},
|
|
570
|
+
"sessions": {
|
|
571
|
+
"enabled": true,
|
|
572
|
+
"autoCreate": false,
|
|
573
|
+
"autoKill": true,
|
|
574
|
+
"prefix": "cop",
|
|
575
|
+
"defaultLayout": "dev",
|
|
576
|
+
"layouts": {
|
|
577
|
+
"dev": {
|
|
578
|
+
"windows": [
|
|
579
|
+
{ "name": "editor", "command": "$EDITOR ." },
|
|
580
|
+
{ "name": "dev", "command": "bun dev" },
|
|
581
|
+
{ "name": "test", "command": "bun test --watch" }
|
|
582
|
+
]
|
|
583
|
+
},
|
|
584
|
+
"minimal": {
|
|
585
|
+
"windows": [
|
|
586
|
+
{ "name": "shell" }
|
|
587
|
+
]
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
"workspaces": [
|
|
592
|
+
{
|
|
593
|
+
"path": "~/Desktop/work",
|
|
594
|
+
"depth": 1,
|
|
595
|
+
"exclude": ["node_modules", ".cache", "archived"],
|
|
596
|
+
"defaults": {
|
|
597
|
+
"copyFiles": [".env", ".env.local"],
|
|
598
|
+
"linkFiles": ["node_modules"],
|
|
599
|
+
"postCreate": ["bun install"],
|
|
600
|
+
"autoUpstream": true
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
],
|
|
604
|
+
"repos": [
|
|
605
|
+
{
|
|
606
|
+
"path": "/Users/me/dev/frontend",
|
|
607
|
+
"copyFiles": [".env", ".env.local"],
|
|
608
|
+
"linkFiles": ["node_modules", ".next"],
|
|
609
|
+
"postCreate": ["bun install", "bun run build"]
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"path": "/Users/me/dev/backend",
|
|
613
|
+
"copyFiles": [".env"],
|
|
614
|
+
"postCreate": ["pip install -r requirements.txt"]
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"path": "/Users/me/dev/monorepo",
|
|
618
|
+
"copyFiles": [".env"],
|
|
619
|
+
"postCreate": ["pnpm install"],
|
|
620
|
+
"monorepo": {
|
|
621
|
+
"autoDetect": true,
|
|
622
|
+
"extraPatterns": ["apps/*/*"],
|
|
623
|
+
"hooks": [
|
|
624
|
+
{
|
|
625
|
+
"glob": "apps/web",
|
|
626
|
+
"copyFiles": [".env"],
|
|
627
|
+
"postCreate": ["cd {packagePath} && pnpm install"]
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"glob": "apps/api",
|
|
631
|
+
"copyFiles": [".env"],
|
|
632
|
+
"linkFiles": ["node_modules"],
|
|
633
|
+
"postCreate": ["cd {packagePath} && pnpm install && pnpm build"]
|
|
634
|
+
}
|
|
635
|
+
]
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
}
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### ์ค์ ํ๋
|
|
643
|
+
|
|
644
|
+
#### `defaults`
|
|
645
|
+
|
|
646
|
+
๋ชจ๋ ๋ ํฌ๊ฐ ์ด ์ค์ ์ ์์ํฉ๋๋ค (๋ ํฌ๋ณ ์ค๋ฒ๋ผ์ด๋ ๊ฐ๋ฅ).
|
|
647
|
+
|
|
648
|
+
| ํ๋ | ํ์
| ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|
|
649
|
+
|------|------|--------|------|
|
|
650
|
+
| `worktreeDir` | `string` | `~/.copse/worktrees/{repo}-{branch}` | worktree ๋๋ ํ ๋ฆฌ ํจํด |
|
|
651
|
+
| `copyFiles` | `string[]` | `[]` | ๋ฉ์ธ ๋ ํฌ์์ ๋ณต์ฌํ ํ์ผ |
|
|
652
|
+
| `linkFiles` | `string[]` | `[]` | ์ฌ๋ณผ๋ฆญ ๋งํฌํ ํ์ผ/๋๋ ํ ๋ฆฌ (๋์คํฌ ์ ์ฝ) |
|
|
653
|
+
| `postCreate` | `string[]` | `[]` | worktree ์์ฑ ํ ์คํํ ์ปค๋งจ๋ |
|
|
654
|
+
| `postRemove` | `string[]` | `[]` | worktree ์ ๊ฑฐ ์ ์คํํ ์ปค๋งจ๋ |
|
|
655
|
+
|
|
656
|
+
#### `repos[]`
|
|
657
|
+
|
|
658
|
+
๋ ํฌ๋ณ ์ค๋ฒ๋ผ์ด๋. ๊ฐ ํญ๋ชฉ์ `path`๊ฐ ํ์์
๋๋ค.
|
|
659
|
+
|
|
660
|
+
| ํ๋ | ํ์
| ํ์ | ์ค๋ช
|
|
|
661
|
+
|------|------|------|------|
|
|
662
|
+
| `path` | `string` | ์ | ๋ ํฌ์ ์ ๋ ๊ฒฝ๋ก |
|
|
663
|
+
| `worktreeDir` | `string` | ์๋์ค | ๊ธฐ๋ณธ worktree ๋๋ ํ ๋ฆฌ ์ค๋ฒ๋ผ์ด๋ |
|
|
664
|
+
| `copyFiles` | `string[]` | ์๋์ค | ๊ธฐ๋ณธ ๋ณต์ฌ ํ์ผ ์ค๋ฒ๋ผ์ด๋ |
|
|
665
|
+
| `linkFiles` | `string[]` | ์๋์ค | ๊ธฐ๋ณธ ๋งํฌ ํ์ผ ์ค๋ฒ๋ผ์ด๋ |
|
|
666
|
+
| `postCreate` | `string[]` | ์๋์ค | ๊ธฐ๋ณธ postCreate ํ
์ค๋ฒ๋ผ์ด๋ |
|
|
667
|
+
| `postRemove` | `string[]` | ์๋์ค | ๊ธฐ๋ณธ postRemove ํ
์ค๋ฒ๋ผ์ด๋ |
|
|
668
|
+
| `monorepo` | `object` | ์๋์ค | ๋ชจ๋
ธ๋ ํฌ ์ง์ ์ค์ |
|
|
669
|
+
|
|
670
|
+
#### `workspaces[]`
|
|
671
|
+
|
|
672
|
+
๋ถ๋ชจ ๋๋ ํ ๋ฆฌ ์๋์ git ๋ ํฌ๋ฅผ ์๋์ผ๋ก ๋ฐ๊ฒฌํฉ๋๋ค. ๋ฐ๊ฒฌ๋ ๊ฐ ๋ ํฌ๋ ๋ก๋ ์์ ์ `repos[]`์ ๋ณํฉ๋๋ฉฐ, ์ํฌ์คํ์ด์ค์ `defaults`๊ฐ ๋ ํฌ ์ค๋ฒ๋ผ์ด๋ ๋ ์ด์ด๋ก ์ ์ฉ๋ฉ๋๋ค.
|
|
673
|
+
|
|
674
|
+
```json
|
|
675
|
+
{
|
|
676
|
+
"workspaces": [
|
|
677
|
+
{
|
|
678
|
+
"path": "~/Desktop/work",
|
|
679
|
+
"depth": 1,
|
|
680
|
+
"exclude": ["node_modules", ".cache", "archived"],
|
|
681
|
+
"defaults": {
|
|
682
|
+
"copyFiles": [".env", ".env.local"],
|
|
683
|
+
"linkFiles": ["node_modules"],
|
|
684
|
+
"postCreate": ["bun install"],
|
|
685
|
+
"autoUpstream": true
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
]
|
|
689
|
+
}
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
| ํ๋ | ํ์
| ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|
|
693
|
+
|------|------|------|--------|------|
|
|
694
|
+
| `path` | `string` | ์ | โ | ์ค์บํ ๋ถ๋ชจ ๋๋ ํ ๋ฆฌ. `~` ํ์ฅ ์ง์. |
|
|
695
|
+
| `depth` | `integer` | ์๋์ค | `1` | ์ค์บ ๊น์ด (1โ3). `1`์ ์ง๊ณ ์์๋ง ์ค์บ. |
|
|
696
|
+
| `exclude` | `string[]` | ์๋์ค | `[]` | ๋๋ ํ ๋ฆฌ ์ด๋ฆ์ ๋งค์นญ๋๋ ๊ธ๋กญ ํจํด์ผ๋ก ์ ์ธ (์: `node_modules`). |
|
|
697
|
+
| `defaults` | `object` | ์๋์ค | โ | ๋ฐ๊ฒฌ๋ ๋ชจ๋ ๋ ํฌ์ ์ ์ฉํ ๊ธฐ๋ณธ๊ฐ. `defaults`์ ๋์ผํ ํ๋. |
|
|
698
|
+
|
|
699
|
+
**๋ฐ๊ฒฌ ๊ท์น:**
|
|
700
|
+
|
|
701
|
+
- `.git`์ด **๋๋ ํ ๋ฆฌ**์ธ ๊ฒฝ์ฐ์๋ง ๋ ํฌ๋ก ๊ฐ์ฃผ๋ฉ๋๋ค. `.git`์ด ํ์ผ์ด๋ฉด (linked worktree ๋๋ submodule) ์ ์ธ๋ฉ๋๋ค.
|
|
702
|
+
- ๋ฐ๊ฒฌ๋ ๋ ํฌ์ ํ์๋ ๋ ์ด์ ์ค์บํ์ง ์์ต๋๋ค (๋ ํฌ ์์ผ๋ก ์ฌ๊ทํ์ง ์์).
|
|
703
|
+
- ์ฌ๋ณผ๋ฆญ ๋งํฌ๋ ๋ฐ๋ผ๊ฐ์ง ์์ต๋๋ค.
|
|
704
|
+
- ๋ฐ๊ฒฌ์ `loadConfig()` ํธ์ถ๋ง๋ค ์คํ๋ฉ๋๋ค. ์บ์๊ฐ ์์ต๋๋ค.
|
|
705
|
+
|
|
706
|
+
**์ฐ์ ์์ (๋์ โ ๋ฎ์):**
|
|
707
|
+
|
|
708
|
+
1. ๋์ผํ resolved path๋ฅผ ๊ฐ์ง ๋ช
์์ `repos[]` ์ํธ๋ฆฌ โ ์ ์ฒด ์น๋ฆฌ.
|
|
709
|
+
2. `workspaces[].defaults` โ ๋ ํฌ ๋ ๋ฒจ ์ค๋ฒ๋ผ์ด๋ ๋ ์ด์ด.
|
|
710
|
+
3. ์ ์ญ `defaults`.
|
|
711
|
+
4. ๋ด์ฅ ๊ธฐ๋ณธ๊ฐ.
|
|
712
|
+
|
|
713
|
+
**`workspaces[].defaults`๋ `monorepo` ํ๋๋ฅผ ์ง์ํ์ง ์์ต๋๋ค.** ๋ฐ๊ฒฌ๋ ๋ ํฌ์ monorepo ํ
์ด ํ์ํ๋ฉด ๋ช
์์ `repos[]` ์ํธ๋ฆฌ๋ฅผ ์ถ๊ฐํ์ธ์.
|
|
714
|
+
|
|
715
|
+
**TUI ํ์:** Config ๋ทฐ(Ctrl+P โ Open Config)๋ ํ์ผ์ *์์ฑ๋ ๊ทธ๋๋ก* ๋ณด์ฌ์ค๋๋ค. ์ํฌ์คํ์ด์ค์์ ์๋ ๋ฐ๊ฒฌ๋ ๋ ํฌ๋ `Repos (N)`๊ฐ ์๋ ๋ณ๋์ `Workspaces (N)` ์น์
์ ํ์๋ฉ๋๋ค. ๋ฐ๋ผ์ `Repos` ์นด์ดํธ๋ ์ํฌ์คํ์ด์ค ์๋ ๋ฐ๊ฒฌ๊ณผ ๋ฌด๊ดํ๊ฒ ๋ช
์์ ์ธ `repos[]` ์ํธ๋ฆฌ๋ง ๋ฐ์ํฉ๋๋ค. Config ๋ทฐ์์ ์ด๋ค ํ๋๋ฅผ ํธ์งํ๋ ์ฌ์ฉ์๊ฐ ์์ฑํ ์๋ณธ ํํ๊ฐ ๋์คํฌ์ ์ ์ฅ๋๋ฏ๋ก, ์๋ ๋ฐ๊ฒฌ๋ ๋ ํฌ๊ฐ `repos[]`๋ก ์๊ตฌํ๋๋ ์ผ์ ์์ต๋๋ค.
|
|
716
|
+
|
|
717
|
+
#### `monorepo`
|
|
718
|
+
|
|
719
|
+
๋ฒ์ฉ ๋ชจ๋
ธ๋ ํฌ ์ง์. ์ํฌ์คํ์ด์ค ์ค์ ํ์ผ์์ ํจํค์ง๋ฅผ ์๋ ๊ฐ์งํ๊ณ ํจํค์ง๋ณ ํ
์ ์ง์ํฉ๋๋ค.
|
|
720
|
+
|
|
721
|
+
```json
|
|
722
|
+
{
|
|
723
|
+
"monorepo": {
|
|
724
|
+
"autoDetect": true,
|
|
725
|
+
"extraPatterns": ["apps/*/*"],
|
|
726
|
+
"hooks": [
|
|
727
|
+
{
|
|
728
|
+
"glob": "apps/mobile/*",
|
|
729
|
+
"copyFiles": [".env"],
|
|
730
|
+
"linkFiles": ["node_modules"],
|
|
731
|
+
"postCreate": ["cd {packagePath} && pnpm install"]
|
|
732
|
+
}
|
|
733
|
+
]
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
| ํ๋ | ํ์
| ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|
|
739
|
+
|------|------|--------|------|
|
|
740
|
+
| `autoDetect` | `boolean` | `true` | ๋ชจ๋
ธ๋ ํฌ ๋๊ตฌ ์๋ ๊ฐ์ง |
|
|
741
|
+
| `extraPatterns` | `string[]` | `[]` | ํจํค์ง ํ์์ฉ ์ถ๊ฐ glob ํจํด |
|
|
742
|
+
| `hooks` | `array` | `[]` | ํจํค์ง๋ณ ํ
์ ์ |
|
|
743
|
+
|
|
744
|
+
**์๋ ๊ฐ์ง** ์ง์: pnpm workspaces, Turborepo, Nx, Lerna, npm/yarn workspaces.
|
|
745
|
+
|
|
746
|
+
**`extraPatterns`**๋ ์๋ ๊ฐ์ง์์ ๋๋ฝ๋ ํจํค์ง๋ฅผ ์ก์ต๋๋ค. ์๋ฅผ ๋ค์ด, `pnpm-workspace.yaml`์ด `packages/*`๋ง ์ปค๋ฒํ๋๋ฐ `apps/frontend/dashboard`์๋ ์ฑ์ด ์๋ค๋ฉด `extraPatterns: ["apps/*/*"]`๋ฅผ ์ฌ์ฉํ์ธ์.
|
|
747
|
+
|
|
748
|
+
#### `monorepo.hooks[]`
|
|
749
|
+
|
|
750
|
+
ํฌ์ปค์ค ๊ฒฝ๋ก์ ๋ํด glob ํจํด์ผ๋ก ๋งค์นญ๋๋ ํจํค์ง๋ณ ํ
.
|
|
751
|
+
|
|
752
|
+
| ํ๋ | ํ์
| ํ์ | ์ค๋ช
|
|
|
753
|
+
|------|------|------|------|
|
|
754
|
+
| `glob` | `string` | ์ | ํฌ์ปค์ค ๊ฒฝ๋ก ๋งค์นญ์ฉ glob (์: `apps/*`, `apps/mobile/*`) |
|
|
755
|
+
| `copyFiles` | `string[]` | ์๋์ค | ๋งค์นญ๋ ํจํค์ง ๋๋ ํ ๋ฆฌ ๋ด์์ ๋ณต์ฌํ ํ์ผ |
|
|
756
|
+
| `linkFiles` | `string[]` | ์๋์ค | ๋งค์นญ๋ ํจํค์ง ๋๋ ํ ๋ฆฌ ๋ด์์ ์ฌ๋ณผ๋ฆญ ๋งํฌํ ํ์ผ/๋๋ ํ ๋ฆฌ |
|
|
757
|
+
| `postCreate` | `string[]` | ์๋์ค | ์์ฑ ํ ์คํํ ์ปค๋งจ๋. `{packagePath}`, `{repo}`, `{branch}` ์ง์ |
|
|
758
|
+
| `postRemove` | `string[]` | ์๋์ค | ์ ๊ฑฐ ์ ์คํํ ์ปค๋งจ๋ |
|
|
759
|
+
|
|
760
|
+
ํ
์ ์ ์ธ ์์๋๋ก ์คํ๋๋ฉฐ, ๋ ํฌ ๋ ๋ฒจ `postCreate`/`postRemove` ์ดํ์ ์คํ๋ฉ๋๋ค.
|
|
761
|
+
|
|
762
|
+
**ํ
๋ด `copyFiles`/`linkFiles`**๋ ๋ ํฌ ๋ฃจํธ๊ฐ ์๋ **ํจํค์ง ์๋ธ๋๋ ํ ๋ฆฌ**์์ ๋์ํฉ๋๋ค. ์๋ฅผ ๋ค์ด, `glob: "apps/mobile/*"`์ด๊ณ `copyFiles: [".env"]`์ด๋ฉด, `.env` ํ์ผ์ `<๋ฉ์ธ-๋ ํฌ>/apps/mobile/ios/.env`์์ `<worktree>/apps/mobile/ios/.env`๋ก ๋ณต์ฌ๋ฉ๋๋ค.
|
|
763
|
+
|
|
764
|
+
#### `templates`
|
|
765
|
+
|
|
766
|
+
worktree ์์ฑ์ ์ํ ์ด๋ฆ์ด ๋ถ์ ํ๋ฆฌ์
. ๊ฐ ํ
ํ๋ฆฟ์ ๊ธฐ๋ณธ๊ฐ ํ๋๋ฅผ ์ค๋ฒ๋ผ์ด๋ํ ์ ์์ต๋๋ค.
|
|
767
|
+
|
|
768
|
+
```json
|
|
769
|
+
{
|
|
770
|
+
"templates": {
|
|
771
|
+
"review": {
|
|
772
|
+
"copyFiles": [".env.local"],
|
|
773
|
+
"postCreate": ["bun install", "bun run build"],
|
|
774
|
+
"autoUpstream": true
|
|
775
|
+
},
|
|
776
|
+
"hotfix": {
|
|
777
|
+
"base": "main",
|
|
778
|
+
"copyFiles": [".env.production"],
|
|
779
|
+
"postCreate": ["bun install"]
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
```
|
|
784
|
+
|
|
785
|
+
| ํ๋ | ํ์
| ์ค๋ช
|
|
|
786
|
+
|------|------|------|
|
|
787
|
+
| `worktreeDir` | `string` | worktree ๋๋ ํ ๋ฆฌ ์ค๋ฒ๋ผ์ด๋ |
|
|
788
|
+
| `copyFiles` | `string[]` | ๋ณต์ฌํ ํ์ผ ์ค๋ฒ๋ผ์ด๋ |
|
|
789
|
+
| `linkFiles` | `string[]` | ์ฌ๋ณผ๋ฆญ ๋งํฌํ ํ์ผ ์ค๋ฒ๋ผ์ด๋ |
|
|
790
|
+
| `postCreate` | `string[]` | postCreate ํ
์ค๋ฒ๋ผ์ด๋ |
|
|
791
|
+
| `postRemove` | `string[]` | postRemove ํ
์ค๋ฒ๋ผ์ด๋ |
|
|
792
|
+
| `autoUpstream` | `boolean` | upstream ์ถ์ ์ค๋ฒ๋ผ์ด๋ |
|
|
793
|
+
| `base` | `string` | ์๋ก ์์ฑ๋๋ ๋ธ๋์น์ ๊ธฐ๋ณธ ๋ฒ ์ด์ค ๋ธ๋์น |
|
|
794
|
+
|
|
795
|
+
์ฌ์ฉ๋ฒ: `cop add feature/login --template review`
|
|
796
|
+
|
|
797
|
+
ํ
ํ๋ฆฟ ๊ฐ์ ๋ฆฌ์กธ๋ธ๋ ๋ ํฌ ์ค์ ์ ์ค๋ฒ๋ผ์ด๋ํฉ๋๋ค. `base` ํ๋๋ `--base`๊ฐ ๋ช
์์ ์ผ๋ก ์ ๊ณต๋์ง ์์ ๊ฒฝ์ฐ ๊ธฐ๋ณธ๊ฐ์ ์ค์ ํฉ๋๋ค.
|
|
798
|
+
|
|
799
|
+
#### `lifecycle`
|
|
800
|
+
|
|
801
|
+
์๋ worktree ๋ผ์ดํ์ฌ์ดํด ๊ด๋ฆฌ. `cop clean --stale`์์ ์ฌ์ฉ๋ฉ๋๋ค.
|
|
802
|
+
|
|
803
|
+
```json
|
|
804
|
+
{
|
|
805
|
+
"lifecycle": {
|
|
806
|
+
"autoCleanMerged": true,
|
|
807
|
+
"staleAfterDays": 14,
|
|
808
|
+
"maxWorktrees": 10
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
| ํ๋ | ํ์
| ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|
|
814
|
+
|------|------|--------|------|
|
|
815
|
+
| `autoCleanMerged` | `boolean` | `false` | ๋จธ์ง๋ worktree๋ฅผ ์ ๋ฆฌ ๋์์ผ๋ก ํ์ |
|
|
816
|
+
| `staleAfterDays` | `number` | โ | ๋นํ์ฑ์ผ๋ก ํ์ํ๊ธฐ๊น์ง ์ผ์ |
|
|
817
|
+
| `maxWorktrees` | `number` | โ | ์ด ์๋ฅผ ์ด๊ณผํ๋ฉด ๊ฒฝ๊ณ |
|
|
818
|
+
|
|
819
|
+
#### `sessions`
|
|
820
|
+
|
|
821
|
+
worktree๋ณ tmux ์ธ์
๊ด๋ฆฌ.
|
|
822
|
+
|
|
823
|
+
```json
|
|
824
|
+
{
|
|
825
|
+
"sessions": {
|
|
826
|
+
"enabled": true,
|
|
827
|
+
"autoCreate": true,
|
|
828
|
+
"autoKill": true,
|
|
829
|
+
"prefix": "cop",
|
|
830
|
+
"defaultLayout": "dev",
|
|
831
|
+
"layouts": {
|
|
832
|
+
"dev": {
|
|
833
|
+
"windows": [
|
|
834
|
+
{ "name": "editor", "command": "$EDITOR ." },
|
|
835
|
+
{ "name": "dev", "command": "bun dev" },
|
|
836
|
+
{ "name": "test", "command": "bun test --watch" }
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
| ํ๋ | ํ์
| ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|
|
845
|
+
|------|------|--------|------|
|
|
846
|
+
| `enabled` | `boolean` | `false` | ์ธ์
์ฐ๋ ํ์ฑํ (tmux ๋ด ์๋ ์ ํ) |
|
|
847
|
+
| `autoCreate` | `boolean` | `false` | `cop add` ์ tmux ์ธ์
์๋ ์์ฑ |
|
|
848
|
+
| `autoKill` | `boolean` | `false` | `cop remove` ์ tmux ์ธ์
์๋ ์ข
๋ฃ |
|
|
849
|
+
| `prefix` | `string` | `"cop"` | tmux ์ธ์
์ด๋ฆ ์ ๋์ฌ |
|
|
850
|
+
| `defaultLayout` | `string` | โ | ์ ์ธ์
์ ๊ธฐ๋ณธ ๋ ์ด์์ ์ด๋ฆ |
|
|
851
|
+
| `layouts` | `object` | `{}` | ์๋์ฐ ์ ์๊ฐ ํฌํจ๋ ์ด๋ฆ ์๋ ๋ ์ด์์ |
|
|
852
|
+
|
|
853
|
+
**๋ ์ด์์ ์๋์ฐ:**
|
|
854
|
+
|
|
855
|
+
| ํ๋ | ํ์
| ํ์ | ์ค๋ช
|
|
|
856
|
+
|------|------|------|------|
|
|
857
|
+
| `name` | `string` | ์ | ์๋์ฐ ์ด๋ฆ |
|
|
858
|
+
| `command` | `string` | ์๋์ค | ์๋์ฐ์์ ์คํํ ์ปค๋งจ๋ |
|
|
859
|
+
|
|
860
|
+
์ธ์
์ด๋ฆ ๊ท์น: ๋ธ๋์น `feat/auth-token` โ tmux ์ธ์
`cop_feat-auth-token`.
|
|
861
|
+
|
|
862
|
+
#### `sharedDeps`
|
|
863
|
+
|
|
864
|
+
๋ฉ์ธ ๋ ํฌ์ worktree ๊ฐ ์์กด์ฑ์ ๊ณต์ ํ์ฌ ๋์คํฌ ๊ณต๊ฐ์ ์ ์ฝํฉ๋๋ค. `defaults` ๋๋ ๋ ํฌ๋ณ๋ก ์ค์ ๊ฐ๋ฅํฉ๋๋ค.
|
|
865
|
+
|
|
866
|
+
```json
|
|
867
|
+
{
|
|
868
|
+
"defaults": {
|
|
869
|
+
"sharedDeps": {
|
|
870
|
+
"strategy": "hardlink",
|
|
871
|
+
"paths": ["node_modules"],
|
|
872
|
+
"invalidateOn": ["package.json", "bun.lockb"]
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
| ํ๋ | ํ์
| ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|
|
879
|
+
|------|------|--------|------|
|
|
880
|
+
| `strategy` | `string` | `"symlink"` | `"hardlink"`, `"symlink"`, ๋๋ `"copy"` |
|
|
881
|
+
| `paths` | `string[]` | `[]` | ๊ณต์ ํ ๋๋ ํ ๋ฆฌ/ํ์ผ |
|
|
882
|
+
| `invalidateOn` | `string[]` | `[]` | ๋ณ๊ฒฝ ์ ์ฌ๊ณต์ ๋ฅผ ํธ๋ฆฌ๊ฑฐํ๋ ํ์ผ |
|
|
883
|
+
|
|
884
|
+
**์ ๋ต:**
|
|
885
|
+
- `hardlink` โ ๊ฐ ํ์ผ์ ํ๋ ๋งํฌ ์์ฑ (๋์คํฌ ์ ์ฝ, ๋ค์ ์ฐ์ฌ์ง๋ ํ์ผ์ worktree๋ง๋ค ๋
๋ฆฝ์ ์ผ๋ก ์์ ๊ฐ๋ฅ)
|
|
886
|
+
- `symlink` โ ์์ค ๋๋ ํ ๋ฆฌ์ ์ฌ๋ณผ๋ฆญ ๋งํฌ ์์ฑ (์ต๋ ๋์คํฌ ์ ์ฝ, ์ํ ๊ณต์ )
|
|
887
|
+
- `copy` โ ์ผ๋ฐ ๋ณต์ฌ๋ก ํด๋ฐฑ
|
|
888
|
+
|
|
889
|
+
### `--focus` ํ๋๊ทธ
|
|
890
|
+
|
|
891
|
+
worktree๊ฐ ์์
์ค์ธ ๋ชจ๋
ธ๋ ํฌ ํจํค์ง๋ฅผ ์ถ์ ํฉ๋๋ค.
|
|
892
|
+
|
|
893
|
+
```bash
|
|
894
|
+
cop add feature/login --focus apps/web,apps/api
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
- ์ผํ, ๊ณต๋ฐฑ, ๋๋ ์ฌ๋ฌ `--focus` ํ๋๊ทธ ์ง์
|
|
898
|
+
- ํฌ์ปค์ค ๋ฉํ๋ฐ์ดํฐ๋ git ๋ด๋ถ์ ์ ์ฅ (worktree ๋ฃจํธ๊ฐ ์๋)
|
|
899
|
+
- `cop list`์์ worktree๋ณ ํฌ์ปค์ค ๊ฒฝ๋ก ํ์
|
|
900
|
+
- ๋ชจ๋
ธ๋ ํฌ ํ
์ ๋งค์นญ๋๋ ํฌ์ปค์ค ๊ฒฝ๋ก์ ๋ํด์๋ง ์คํ
|
|
901
|
+
- ํฌ์ปค์ค๋ ์ ํ์ฌํญ โ ์๋ตํ๋ฉด ์ผ๋ฐ worktree ์์ฑ
|
|
902
|
+
|
|
903
|
+
### ํ
ํ๋ฆฟ ๋ณ์
|
|
904
|
+
|
|
905
|
+
`worktreeDir` ๋ฐ ๋ชจ๋
ธ๋ ํฌ ํ
์ปค๋งจ๋์์ ์ฌ์ฉ ๊ฐ๋ฅ:
|
|
906
|
+
|
|
907
|
+
| ๋ณ์ | ์ค๋ช
| ์์ |
|
|
908
|
+
|------|------|------|
|
|
909
|
+
| `{repo}` | ๋ ํฌ ๋๋ ํ ๋ฆฌ ์ด๋ฆ | `my-app` |
|
|
910
|
+
| `{branch}` | ๋ธ๋์น ์ด๋ฆ (`/`๋ `-`๋ก ๋์ฒด) | `feature-auth` |
|
|
911
|
+
| `{packagePath}` | ๋งค์นญ๋ ํจํค์ง ๊ฒฝ๋ก (๋ชจ๋
ธ๋ ํฌ ํ
์ ์ฉ) | `apps/web` |
|
|
912
|
+
| `~` | ํ ๋๋ ํ ๋ฆฌ (๊ฒฝ๋ก ์์ ์์น์์๋ง) | `/Users/me` |
|
|
913
|
+
|
|
914
|
+
### ์ฐ์ ์์
|
|
915
|
+
|
|
916
|
+
๋ ํฌ๋ณ ์ค์ ์ ๊ธฐ๋ณธ๊ฐ์ ์์ ํ ๋์ฒดํฉ๋๋ค (๋จธ์ง ์์):
|
|
917
|
+
|
|
918
|
+
```
|
|
919
|
+
repos[].copyFiles ์กด์ฌ? โ repos[].copyFiles ์ฌ์ฉ
|
|
920
|
+
repos[].copyFiles ์์? โ defaults.copyFiles ์ฌ์ฉ
|
|
921
|
+
defaults.copyFiles ์์? โ [] (๋น ๋ฐฐ์ด) ์ฌ์ฉ
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
### ํ
๋ง
|
|
925
|
+
|
|
926
|
+
์ค์ ํ์ผ ๋๋ ์ปค๋งจ๋ ํ๋ ํธ (`Ctrl+P`)์์ ์ค์ :
|
|
927
|
+
|
|
928
|
+
```json
|
|
929
|
+
{ "theme": "tokyo-night" }
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
์ฌ์ฉ ๊ฐ๋ฅ: `opencode`, `tokyo-night`, `dracula`, `nord`, `catppuccin`, `github-dark`, `one-dark`, `monokai`, `github-light`
|
|
933
|
+
|
|
934
|
+
## ์
ธ ํตํฉ
|
|
935
|
+
|
|
936
|
+
`cop shell-init`์ผ๋ก `cop switch`์ฉ ์
ธ ํตํฉ์ ์ค์นํ์ธ์.
|
|
937
|
+
|
|
938
|
+
### ์
ธ ์๋์์ฑ
|
|
939
|
+
|
|
940
|
+
```bash
|
|
941
|
+
# ์๋์์ฑ ์ถ๊ฐ (bash)
|
|
942
|
+
eval "$(cop shell-init --completions bash)"
|
|
943
|
+
|
|
944
|
+
# ์๋์์ฑ ์ถ๊ฐ (zsh)
|
|
945
|
+
eval "$(cop shell-init --completions zsh)"
|
|
946
|
+
|
|
947
|
+
# ์๋์์ฑ ์ถ๊ฐ (fish)
|
|
948
|
+
cop shell-init --completions fish | source
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
### ์์
|
|
952
|
+
|
|
953
|
+
```bash
|
|
954
|
+
# zsh
|
|
955
|
+
echo 'eval "$(cop shell-init zsh)"' >> ~/.zshrc
|
|
956
|
+
source ~/.zshrc
|
|
957
|
+
|
|
958
|
+
# bash
|
|
959
|
+
echo 'eval "$(cop shell-init bash)"' >> ~/.bashrc
|
|
960
|
+
source ~/.bashrc
|
|
961
|
+
|
|
962
|
+
# fish
|
|
963
|
+
cop shell-init fish >> ~/.config/fish/config.fish
|
|
964
|
+
source ~/.config/fish/config.fish
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
์ค์ ์ ์ฅ ์ ์์ฑ๋ ๋ํผ๋ฅผ ๋ฏธ๋ฆฌ ๋ณผ ์๋ ์์ต๋๋ค:
|
|
968
|
+
|
|
969
|
+
```bash
|
|
970
|
+
cop shell-init zsh
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
## ์ค์ ํ๋กํ
|
|
974
|
+
|
|
975
|
+
์๋ก ๋ค๋ฅธ ์ค์ ์ธํธ ๊ฐ ์ ํํฉ๋๋ค.
|
|
976
|
+
|
|
977
|
+
```bash
|
|
978
|
+
cop config --profiles # ํ๋กํ ๋ชฉ๋ก
|
|
979
|
+
cop config --profile work --activate # ํ๋กํ ํ์ฑํ
|
|
980
|
+
cop config --profile personal --delete # ํ๋กํ ์ญ์
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
## ๋ผ์ด์ ์ค
|
|
984
|
+
|
|
985
|
+
MIT ยฉ getsolaris
|