cluttry 1.0.3 → 1.5.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/CHANGELOG.md +71 -0
- package/README.md +203 -300
- package/dist/commands/completions.d.ts +16 -0
- package/dist/commands/completions.d.ts.map +1 -0
- package/dist/commands/completions.js +46 -0
- package/dist/commands/completions.js.map +1 -0
- package/dist/commands/explain-copy.d.ts +11 -0
- package/dist/commands/explain-copy.d.ts.map +1 -0
- package/dist/commands/explain-copy.js +34 -0
- package/dist/commands/explain-copy.js.map +1 -0
- package/dist/commands/finish.d.ts +20 -0
- package/dist/commands/finish.d.ts.map +1 -0
- package/dist/commands/finish.js +817 -0
- package/dist/commands/finish.js.map +1 -0
- package/dist/commands/gc.d.ts +22 -0
- package/dist/commands/gc.d.ts.map +1 -0
- package/dist/commands/gc.js +163 -0
- package/dist/commands/gc.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/open.d.ts +15 -1
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +96 -17
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/resume.d.ts +21 -0
- package/dist/commands/resume.d.ts.map +1 -0
- package/dist/commands/resume.js +106 -0
- package/dist/commands/resume.js.map +1 -0
- package/dist/commands/rm.d.ts.map +1 -1
- package/dist/commands/rm.js +6 -14
- package/dist/commands/rm.js.map +1 -1
- package/dist/commands/spawn.d.ts +3 -0
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +182 -19
- package/dist/commands/spawn.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +198 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/completions.d.ts +35 -0
- package/dist/lib/completions.d.ts.map +1 -0
- package/dist/lib/completions.js +368 -0
- package/dist/lib/completions.js.map +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +2 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +43 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +251 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/git.d.ts +17 -0
- package/dist/lib/git.d.ts.map +1 -1
- package/dist/lib/git.js +78 -10
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/safety.d.ts +79 -0
- package/dist/lib/safety.d.ts.map +1 -0
- package/dist/lib/safety.js +133 -0
- package/dist/lib/safety.js.map +1 -0
- package/dist/lib/secrets.d.ts +29 -0
- package/dist/lib/secrets.d.ts.map +1 -1
- package/dist/lib/secrets.js +115 -0
- package/dist/lib/secrets.js.map +1 -1
- package/dist/lib/session.d.ts +93 -0
- package/dist/lib/session.d.ts.map +1 -0
- package/dist/lib/session.js +254 -0
- package/dist/lib/session.js.map +1 -0
- package/dist/lib/types.d.ts +6 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/.claude/settings.local.json +0 -7
- package/src/commands/doctor.ts +0 -222
- package/src/commands/init.ts +0 -120
- package/src/commands/list.ts +0 -133
- package/src/commands/open.ts +0 -78
- package/src/commands/prune.ts +0 -36
- package/src/commands/rm.ts +0 -125
- package/src/commands/shell.ts +0 -99
- package/src/commands/spawn.ts +0 -169
- package/src/index.ts +0 -123
- package/src/lib/config.ts +0 -120
- package/src/lib/git.ts +0 -243
- package/src/lib/output.ts +0 -102
- package/src/lib/paths.ts +0 -108
- package/src/lib/secrets.ts +0 -193
- package/src/lib/types.ts +0 -69
- package/tests/config.test.ts +0 -102
- package/tests/paths.test.ts +0 -155
- package/tests/secrets.test.ts +0 -150
- package/tsconfig.json +0 -20
- package/vitest.config.ts +0 -15
package/README.md
CHANGED
|
@@ -1,444 +1,347 @@
|
|
|
1
1
|
# cluttry
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AI session lifecycle in git worktrees.
|
|
4
4
|
|
|
5
5
|
**CLI command:** `cry`
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
When working with AI coding assistants like Claude, you often want to run multiple parallel sessions on different branches. Git worktrees are perfect for this—each worktree is a separate checkout where an agent can work independently.
|
|
10
|
-
|
|
11
|
-
But managing worktrees manually is tedious:
|
|
12
|
-
- You have to remember the `git worktree` commands
|
|
13
|
-
- You need to copy your `.env` files and secrets to each worktree
|
|
14
|
-
- You want to run setup commands like `npm install` automatically
|
|
15
|
-
- You want to launch your AI agent in the new worktree
|
|
16
|
-
|
|
17
|
-
**cry** solves all of this with one command.
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
### Using Bun (recommended)
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
# Install globally with Bun
|
|
25
|
-
bun add -g cluttry
|
|
26
|
-
|
|
27
|
-
# Or clone and link
|
|
28
|
-
git clone https://github.com/your-username/cluttry.git
|
|
29
|
-
cd cluttry
|
|
30
|
-
bun install
|
|
31
|
-
bun link
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Using npm
|
|
7
|
+
## 60-Second Quickstart
|
|
35
8
|
|
|
36
9
|
```bash
|
|
37
|
-
# Install
|
|
10
|
+
# Install
|
|
38
11
|
npm install -g cluttry
|
|
39
12
|
|
|
40
|
-
#
|
|
41
|
-
git clone https://github.com/your-username/cluttry.git
|
|
42
|
-
cd cluttry
|
|
43
|
-
npm install
|
|
44
|
-
npm link
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Requirements:** Bun 1.0+ or Node.js 18+, Git 2.5+
|
|
48
|
-
|
|
49
|
-
## Quick Start
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# Initialize cry in your repository
|
|
13
|
+
# Initialize in your repo
|
|
53
14
|
cd your-repo
|
|
54
15
|
cry init
|
|
55
16
|
|
|
56
|
-
#
|
|
57
|
-
cry
|
|
58
|
-
|
|
59
|
-
# List all worktrees
|
|
60
|
-
cry list
|
|
61
|
-
|
|
62
|
-
# Remove a worktree when done
|
|
63
|
-
cry rm feature-auth --with-branch
|
|
17
|
+
# One command: create worktree → launch Claude → finish when done
|
|
18
|
+
cry feat-login claude --finish-on-exit
|
|
64
19
|
```
|
|
65
20
|
|
|
66
|
-
|
|
21
|
+
That's it. When Claude exits, you'll see a menu to commit, create a PR, and clean up.
|
|
67
22
|
|
|
68
|
-
|
|
23
|
+
## The Lifecycle
|
|
69
24
|
|
|
70
|
-
|
|
25
|
+
Every AI coding session follows four phases:
|
|
71
26
|
|
|
72
|
-
```bash
|
|
73
|
-
cry init [--force]
|
|
74
27
|
```
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- Updates `.gitignore` to ignore local config and `.worktrees/`
|
|
80
|
-
|
|
81
|
-
### `cry spawn <branch>`
|
|
82
|
-
|
|
83
|
-
Create a worktree for a branch with automatic secrets handling.
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
cry spawn <branch> [options]
|
|
87
|
-
|
|
88
|
-
Options:
|
|
89
|
-
-n, --new Create a new branch
|
|
90
|
-
-p, --path <dir> Explicit worktree path
|
|
91
|
-
-b, --base <dir> Base directory for worktrees
|
|
92
|
-
-m, --mode <mode> Secret handling: copy, symlink, or none (default: copy)
|
|
93
|
-
-r, --run <cmd> Command to run after creation
|
|
94
|
-
-a, --agent <agent> Launch agent: claude or none (default: none)
|
|
28
|
+
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
|
|
29
|
+
│ START │ → │ WORK │ → │ FINISH │ → │ CLEANUP │
|
|
30
|
+
└─────────┘ └─────────┘ └─────────┘ └─────────┘
|
|
31
|
+
cry spawn (agent works) cry finish (automatic)
|
|
95
32
|
```
|
|
96
33
|
|
|
97
|
-
|
|
34
|
+
### 1. Start
|
|
98
35
|
|
|
99
|
-
|
|
100
|
-
# Create worktree for existing branch
|
|
101
|
-
cry spawn feature-auth
|
|
102
|
-
|
|
103
|
-
# Create new branch and worktree
|
|
104
|
-
cry spawn feature-oauth --new
|
|
36
|
+
Create an isolated worktree with secrets copied:
|
|
105
37
|
|
|
106
|
-
|
|
107
|
-
|
|
38
|
+
```bash
|
|
39
|
+
# Shorthand (recommended)
|
|
40
|
+
cry feat-auth claude
|
|
108
41
|
|
|
109
|
-
#
|
|
110
|
-
cry spawn
|
|
42
|
+
# Explicit
|
|
43
|
+
cry spawn feat-auth --new --agent claude
|
|
111
44
|
|
|
112
|
-
#
|
|
113
|
-
cry
|
|
45
|
+
# Full lifecycle in one command
|
|
46
|
+
cry feat-auth claude --finish-on-exit
|
|
114
47
|
```
|
|
115
48
|
|
|
116
|
-
###
|
|
49
|
+
### 2. Work
|
|
117
50
|
|
|
118
|
-
|
|
51
|
+
Your AI agent works in the isolated worktree. Each worktree has:
|
|
52
|
+
- Its own branch
|
|
53
|
+
- Copy of your `.env` and secret files
|
|
54
|
+
- Independent git state
|
|
119
55
|
|
|
120
|
-
|
|
121
|
-
cry list [--json]
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Shows: branch name, commit SHA, dirty status, last modified time, and path.
|
|
56
|
+
Run multiple sessions in parallel—each in its own terminal.
|
|
125
57
|
|
|
126
|
-
###
|
|
58
|
+
### 3. Finish (PR-first)
|
|
127
59
|
|
|
128
|
-
|
|
60
|
+
From inside the worktree:
|
|
129
61
|
|
|
130
62
|
```bash
|
|
131
|
-
cry
|
|
63
|
+
cry finish
|
|
132
64
|
```
|
|
133
65
|
|
|
134
|
-
|
|
66
|
+
Interactive flow:
|
|
67
|
+
1. Shows session summary (branch, commits, diff stats)
|
|
68
|
+
2. If dirty: offers to commit (with suggested message from branch name)
|
|
69
|
+
3. Pushes branch and creates PR via `gh` CLI
|
|
70
|
+
4. Offers cleanup prompt
|
|
135
71
|
|
|
72
|
+
Non-interactive:
|
|
136
73
|
```bash
|
|
137
|
-
|
|
138
|
-
cry open feature-auth
|
|
139
|
-
|
|
140
|
-
# Run a command in the worktree
|
|
141
|
-
cry open feature-auth --cmd "npm test"
|
|
142
|
-
|
|
143
|
-
# Open in VS Code
|
|
144
|
-
cry open feature-auth --cmd "code ."
|
|
74
|
+
cry finish -m "Add user authentication" --cleanup
|
|
145
75
|
```
|
|
146
76
|
|
|
147
|
-
###
|
|
77
|
+
### 4. Cleanup
|
|
148
78
|
|
|
149
|
-
|
|
79
|
+
Handled automatically by `cry finish`, or manually:
|
|
150
80
|
|
|
151
81
|
```bash
|
|
152
|
-
cry rm
|
|
153
|
-
|
|
154
|
-
Options:
|
|
155
|
-
-b, --with-branch Also delete the branch
|
|
156
|
-
-f, --force Force removal even if dirty
|
|
157
|
-
-y, --yes Skip confirmation prompts
|
|
82
|
+
cry rm feat-auth --with-branch
|
|
158
83
|
```
|
|
159
84
|
|
|
160
|
-
|
|
85
|
+
## Installation
|
|
161
86
|
|
|
162
87
|
```bash
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
# Remove worktree and delete branch
|
|
167
|
-
cry rm feature-auth --with-branch
|
|
168
|
-
|
|
169
|
-
# Force remove dirty worktree
|
|
170
|
-
cry rm feature-auth --force --yes
|
|
88
|
+
npm install -g cluttry
|
|
89
|
+
# or
|
|
90
|
+
bun add -g cluttry
|
|
171
91
|
```
|
|
172
92
|
|
|
173
|
-
|
|
93
|
+
**Requirements:** Node.js 18+ or Bun 1.0+, Git 2.5+
|
|
174
94
|
|
|
175
|
-
|
|
95
|
+
### Shell Completions
|
|
176
96
|
|
|
177
97
|
```bash
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Runs `git worktree prune` and shows what was cleaned.
|
|
182
|
-
|
|
183
|
-
### `cry doctor`
|
|
98
|
+
# Fish
|
|
99
|
+
cry completions fish > ~/.config/fish/completions/cry.fish
|
|
184
100
|
|
|
185
|
-
|
|
101
|
+
# Bash
|
|
102
|
+
cry completions bash >> ~/.bashrc
|
|
186
103
|
|
|
187
|
-
|
|
188
|
-
cry
|
|
104
|
+
# Zsh
|
|
105
|
+
cry completions zsh > ~/.zsh/completions/_cry
|
|
189
106
|
```
|
|
190
107
|
|
|
191
|
-
Checks:
|
|
192
|
-
- Config file exists
|
|
193
|
-
- Local config is gitignored
|
|
194
|
-
- `.worktrees/` is gitignored
|
|
195
|
-
- Include files are safely gitignored
|
|
196
|
-
- Agent command is available
|
|
197
|
-
|
|
198
108
|
## Configuration
|
|
199
109
|
|
|
200
|
-
|
|
110
|
+
After `cry init`, edit `.cry.json`:
|
|
201
111
|
|
|
202
112
|
```json
|
|
203
113
|
{
|
|
114
|
+
"include": [".env", ".env.*", "config/secrets.json"],
|
|
204
115
|
"defaultMode": "copy",
|
|
205
|
-
"
|
|
206
|
-
"worktreeBaseDir": null,
|
|
207
|
-
"hooks": {
|
|
208
|
-
"postCreate": ["npm install"]
|
|
209
|
-
},
|
|
116
|
+
"hooks": { "postCreate": ["npm install"] },
|
|
210
117
|
"agentCommand": "claude"
|
|
211
118
|
}
|
|
212
119
|
```
|
|
213
120
|
|
|
214
|
-
|
|
|
215
|
-
|
|
216
|
-
| `
|
|
217
|
-
| `
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
220
|
-
| `
|
|
221
|
-
|
|
222
|
-
### `.cry.local.json` (gitignored)
|
|
223
|
-
|
|
224
|
-
Machine-specific overrides:
|
|
225
|
-
|
|
226
|
-
```json
|
|
227
|
-
{
|
|
228
|
-
"worktreeBaseDir": "/home/user/worktrees",
|
|
229
|
-
"include": ["config/local-secrets.json"],
|
|
230
|
-
"hooks": {
|
|
231
|
-
"postCreate": ["npm install", "./setup-dev.sh"]
|
|
232
|
-
},
|
|
233
|
-
"agentCommand": "cursor"
|
|
234
|
-
}
|
|
235
|
-
```
|
|
121
|
+
| Key | Description |
|
|
122
|
+
|-----|-------------|
|
|
123
|
+
| `include` | Glob patterns for files to copy to worktrees |
|
|
124
|
+
| `defaultMode` | `copy`, `symlink`, or `none` |
|
|
125
|
+
| `hooks.postCreate` | Commands to run after spawn |
|
|
126
|
+
| `agentCommand` | Agent CLI command (default: `claude`) |
|
|
127
|
+
| `editorCommand` | Editor command (default: `code`) |
|
|
236
128
|
|
|
237
|
-
|
|
238
|
-
- `include` arrays are concatenated
|
|
239
|
-
- `hooks.postCreate` arrays are concatenated
|
|
240
|
-
- Other values override
|
|
129
|
+
Machine-specific overrides go in `.cry.local.json` (gitignored).
|
|
241
130
|
|
|
242
131
|
## Security Model
|
|
243
132
|
|
|
244
|
-
**
|
|
133
|
+
**Tracked files are never copied.** This is enforced, not optional.
|
|
245
134
|
|
|
246
|
-
|
|
135
|
+
For a file to be copied to a worktree, it must pass both checks:
|
|
136
|
+
1. **Not tracked** by git (`git ls-files` returns nothing)
|
|
137
|
+
2. **Ignored** by git (listed in `.gitignore`)
|
|
247
138
|
|
|
248
|
-
|
|
139
|
+
This means:
|
|
140
|
+
- Your `.env` files copy automatically (they're gitignored)
|
|
141
|
+
- Your source code stays in git (tracked files can't be copied)
|
|
142
|
+
- Accidentally tracked secrets won't propagate
|
|
143
|
+
|
|
144
|
+
### Verify before spawning
|
|
249
145
|
|
|
250
146
|
```bash
|
|
251
|
-
#
|
|
252
|
-
|
|
147
|
+
# See exactly what will be copied
|
|
148
|
+
cry explain-copy
|
|
149
|
+
|
|
150
|
+
# Preview spawn without changes
|
|
151
|
+
cry spawn feat-test --new --dry-run
|
|
253
152
|
```
|
|
254
153
|
|
|
255
|
-
###
|
|
154
|
+
### Copy vs Symlink
|
|
256
155
|
|
|
257
|
-
|
|
156
|
+
| Mode | Behavior |
|
|
157
|
+
|------|----------|
|
|
158
|
+
| `copy` | Independent copies. Safe default. |
|
|
159
|
+
| `symlink` | Linked to original. Changes sync everywhere. |
|
|
160
|
+
| `none` | Nothing copied. Set up secrets manually. |
|
|
258
161
|
|
|
259
|
-
|
|
260
|
-
# Checked with: git check-ignore -q <file>
|
|
261
|
-
# If file is NOT ignored → REFUSED
|
|
262
|
-
```
|
|
162
|
+
## Commands
|
|
263
163
|
|
|
264
|
-
###
|
|
164
|
+
### Session Lifecycle
|
|
265
165
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
166
|
+
| Command | Purpose |
|
|
167
|
+
|---------|---------|
|
|
168
|
+
| `cry spawn <branch>` | Create worktree |
|
|
169
|
+
| `cry finish` | Commit → PR → cleanup |
|
|
170
|
+
| `cry rm <branch>` | Remove worktree |
|
|
269
171
|
|
|
270
|
-
###
|
|
172
|
+
### Navigation
|
|
271
173
|
|
|
272
|
-
|
|
|
273
|
-
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
174
|
+
| Command | Purpose |
|
|
175
|
+
|---------|---------|
|
|
176
|
+
| `cry list` | List all worktrees |
|
|
177
|
+
| `cry open <branch>` | Open in agent/editor |
|
|
178
|
+
| `cry resume <branch>` | Resume session |
|
|
277
179
|
|
|
278
|
-
|
|
180
|
+
### Maintenance
|
|
279
181
|
|
|
280
|
-
|
|
182
|
+
| Command | Purpose |
|
|
183
|
+
|---------|---------|
|
|
184
|
+
| `cry gc` | Clean stale sessions |
|
|
185
|
+
| `cry prune` | Clean git worktree refs |
|
|
186
|
+
| `cry doctor` | Check configuration |
|
|
281
187
|
|
|
282
|
-
|
|
188
|
+
## Key Flags
|
|
283
189
|
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
cry init
|
|
287
|
-
```
|
|
190
|
+
### `cry spawn`
|
|
288
191
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
192
|
+
```
|
|
193
|
+
-n, --new Create new branch
|
|
194
|
+
-a, --agent <agent> Launch agent (claude, cursor, none)
|
|
195
|
+
--finish-on-exit Show finish menu when agent exits
|
|
196
|
+
--base-branch <branch> PR target branch
|
|
197
|
+
-m, --mode <mode> Secret handling (copy, symlink, none)
|
|
198
|
+
-r, --run <cmd> Run command after spawn
|
|
199
|
+
--dry-run Preview without creating
|
|
200
|
+
```
|
|
296
201
|
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
cry spawn fix-auth-bug --new --run "npm install" --agent claude
|
|
300
|
-
```
|
|
202
|
+
### `cry finish`
|
|
301
203
|
|
|
302
|
-
|
|
204
|
+
```
|
|
205
|
+
-m, --message <msg> Commit with message (non-interactive)
|
|
206
|
+
--cleanup Auto-cleanup after PR
|
|
207
|
+
--skip-commit Skip commit step
|
|
208
|
+
--non-interactive Never prompt
|
|
209
|
+
--dry-run Preview without executing
|
|
210
|
+
```
|
|
303
211
|
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
cry rm fix-auth-bug --with-branch
|
|
307
|
-
```
|
|
212
|
+
### `cry rm`
|
|
308
213
|
|
|
309
|
-
|
|
214
|
+
```
|
|
215
|
+
-b, --with-branch Also delete the branch
|
|
216
|
+
-f, --force Force remove dirty worktree
|
|
217
|
+
-y, --yes Skip confirmation
|
|
218
|
+
```
|
|
310
219
|
|
|
311
|
-
|
|
220
|
+
## FAQ
|
|
312
221
|
|
|
313
|
-
|
|
314
|
-
```json
|
|
315
|
-
{
|
|
316
|
-
"deny": [".env", ".env.*", "config/secrets/**"]
|
|
317
|
-
}
|
|
318
|
-
```
|
|
222
|
+
### Why not just `git worktree`?
|
|
319
223
|
|
|
320
|
-
|
|
224
|
+
| Task | git worktree | cry |
|
|
225
|
+
|------|--------------|-----|
|
|
226
|
+
| Create worktree | `git worktree add -b feat ../feat` | `cry feat` |
|
|
227
|
+
| Copy secrets | Manual copy | Automatic |
|
|
228
|
+
| Run setup | `cd ../feat && npm install` | `--run "npm install"` |
|
|
229
|
+
| Launch agent | `cd ../feat && claude` | `--agent claude` |
|
|
230
|
+
| Create PR | Switch context, push, open browser | `cry finish` |
|
|
231
|
+
| Cleanup | `git worktree remove`, `git branch -d` | `cry rm --with-branch` |
|
|
321
232
|
|
|
322
|
-
|
|
233
|
+
cry handles the lifecycle. git worktree is just step 1.
|
|
323
234
|
|
|
324
|
-
|
|
235
|
+
### Can I use this without AI agents?
|
|
236
|
+
|
|
237
|
+
Yes. Skip `--agent` and use worktrees for any parallel work:
|
|
325
238
|
|
|
326
239
|
```bash
|
|
327
|
-
|
|
328
|
-
|
|
240
|
+
cry hotfix-123
|
|
241
|
+
# ... work manually ...
|
|
242
|
+
cry finish
|
|
243
|
+
```
|
|
329
244
|
|
|
330
|
-
|
|
331
|
-
cry spawn feature-payments --new --agent claude
|
|
245
|
+
### What if `gh` isn't installed?
|
|
332
246
|
|
|
333
|
-
|
|
334
|
-
cry spawn bugfix-123 --agent claude
|
|
335
|
-
```
|
|
247
|
+
`cry finish` prints manual PR instructions and exits cleanly (exit 0). Install `gh` for automatic PR creation:
|
|
336
248
|
|
|
337
|
-
|
|
249
|
+
```bash
|
|
250
|
+
brew install gh && gh auth login
|
|
251
|
+
```
|
|
338
252
|
|
|
339
|
-
|
|
253
|
+
### How do I prevent AI from reading secrets?
|
|
340
254
|
|
|
255
|
+
For Claude Code, add to `.clauderc`:
|
|
256
|
+
```json
|
|
257
|
+
{ "deny": [".env", ".env.*"] }
|
|
341
258
|
```
|
|
342
|
-
.worktrees/ # Default worktree location (gitignored)
|
|
343
|
-
├── feature-auth/ # Worktree for feature-auth branch
|
|
344
|
-
├── feature-payments/ # Worktree for feature-payments branch
|
|
345
|
-
└── bugfix-123/ # Worktree for bugfix-123 branch
|
|
346
259
|
|
|
347
|
-
|
|
348
|
-
|
|
260
|
+
### Can I change the worktree location?
|
|
261
|
+
|
|
262
|
+
Default is `.worktrees/` in your repo. Override:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Per-spawn
|
|
266
|
+
cry spawn feat --path ~/worktrees/myrepo-feat
|
|
267
|
+
|
|
268
|
+
# Globally in .cry.local.json
|
|
269
|
+
{ "worktreeBaseDir": "/home/user/worktrees" }
|
|
349
270
|
```
|
|
350
271
|
|
|
351
272
|
## Troubleshooting
|
|
352
273
|
|
|
353
274
|
### "Not a git repository"
|
|
354
275
|
|
|
355
|
-
Run cry
|
|
276
|
+
Run cry from inside a git repo.
|
|
277
|
+
|
|
278
|
+
### "Destination already exists"
|
|
356
279
|
|
|
357
|
-
|
|
280
|
+
The worktree path exists. Remove it or use `--path`:
|
|
358
281
|
|
|
359
|
-
A worktree already exists for that branch. Remove it first:
|
|
360
282
|
```bash
|
|
361
|
-
|
|
283
|
+
rm -rf .worktrees/feat-auth
|
|
284
|
+
# or
|
|
285
|
+
cry spawn feat-auth --path .worktrees/feat-auth-v2
|
|
362
286
|
```
|
|
363
287
|
|
|
364
|
-
### "
|
|
288
|
+
### "A worktree already exists for branch"
|
|
289
|
+
|
|
290
|
+
Remove the existing worktree first:
|
|
365
291
|
|
|
366
|
-
The target directory exists. Either remove it or specify a different path:
|
|
367
292
|
```bash
|
|
368
|
-
cry
|
|
293
|
+
cry rm feat-auth
|
|
369
294
|
```
|
|
370
295
|
|
|
371
|
-
### "File is tracked by git"
|
|
296
|
+
### "File is tracked by git" / "File is not ignored"
|
|
297
|
+
|
|
298
|
+
Files in `include` must be gitignored and untracked:
|
|
372
299
|
|
|
373
|
-
A file in your `include` patterns is tracked by git. Remove it from tracking:
|
|
374
300
|
```bash
|
|
375
|
-
|
|
376
|
-
echo "
|
|
301
|
+
# Add to .gitignore
|
|
302
|
+
echo "secrets.json" >> .gitignore
|
|
303
|
+
|
|
304
|
+
# If already tracked, untrack it
|
|
305
|
+
git rm --cached secrets.json
|
|
377
306
|
```
|
|
378
307
|
|
|
379
|
-
### "
|
|
308
|
+
### "Worktree has uncommitted changes"
|
|
309
|
+
|
|
310
|
+
Commit or discard changes before removing:
|
|
380
311
|
|
|
381
|
-
A file in your `include` patterns isn't in `.gitignore`. Add it:
|
|
382
312
|
```bash
|
|
383
|
-
|
|
313
|
+
cry rm feat-auth --force # discards changes
|
|
384
314
|
```
|
|
385
315
|
|
|
386
316
|
### Agent command not found
|
|
387
317
|
|
|
388
|
-
Install the
|
|
318
|
+
Install the agent CLI:
|
|
319
|
+
|
|
389
320
|
```bash
|
|
390
|
-
#
|
|
321
|
+
# Claude
|
|
391
322
|
npm install -g @anthropic-ai/claude-code
|
|
392
323
|
|
|
393
|
-
# Or
|
|
394
|
-
{
|
|
395
|
-
|
|
396
|
-
|
|
324
|
+
# Or set custom command
|
|
325
|
+
echo '{"agentCommand": "your-agent"}' > .cry.local.json
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### PR creation failed
|
|
329
|
+
|
|
330
|
+
Check GitHub CLI auth:
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
gh auth status
|
|
334
|
+
gh auth login # if needed
|
|
397
335
|
```
|
|
398
336
|
|
|
399
337
|
## Development
|
|
400
338
|
|
|
401
339
|
```bash
|
|
402
|
-
# Install dependencies
|
|
403
340
|
npm install
|
|
404
|
-
|
|
405
|
-
# Build
|
|
406
341
|
npm run build
|
|
407
|
-
|
|
408
|
-
# Run tests
|
|
409
342
|
npm test
|
|
410
|
-
|
|
411
|
-
# Watch mode
|
|
412
|
-
npm run dev
|
|
413
343
|
```
|
|
414
344
|
|
|
415
|
-
## Tech Stack
|
|
416
|
-
|
|
417
|
-
- **Language:** TypeScript (Node.js)
|
|
418
|
-
- **CLI Framework:** Commander.js
|
|
419
|
-
- **Testing:** Vitest
|
|
420
|
-
- **Dependencies:** Minimal (commander, glob)
|
|
421
|
-
|
|
422
|
-
### Why TypeScript/Node.js?
|
|
423
|
-
|
|
424
|
-
1. **Accessible:** Most developers working with web projects have Node.js installed
|
|
425
|
-
2. **Cross-platform:** Works on macOS, Linux, and Windows
|
|
426
|
-
3. **Contribution-friendly:** TypeScript is widely known and well-typed
|
|
427
|
-
4. **Rich ecosystem:** Excellent CLI tooling available
|
|
428
|
-
|
|
429
345
|
## License
|
|
430
346
|
|
|
431
347
|
MIT
|
|
432
|
-
|
|
433
|
-
## Contributing
|
|
434
|
-
|
|
435
|
-
Contributions welcome! Please:
|
|
436
|
-
|
|
437
|
-
1. Fork the repository
|
|
438
|
-
2. Create a feature branch
|
|
439
|
-
3. Write tests for new functionality
|
|
440
|
-
4. Submit a pull request
|
|
441
|
-
|
|
442
|
-
## Acknowledgments
|
|
443
|
-
|
|
444
|
-
Inspired by the need to run parallel AI coding sessions efficiently. Built for vibecoders everywhere.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry completions command
|
|
3
|
+
*
|
|
4
|
+
* Generate shell completions for bash, zsh, and fish.
|
|
5
|
+
*/
|
|
6
|
+
type ShellType = 'bash' | 'zsh' | 'fish';
|
|
7
|
+
interface CompletionsOptions {
|
|
8
|
+
shell?: ShellType;
|
|
9
|
+
}
|
|
10
|
+
export declare function completions(shell: string | undefined, options: CompletionsOptions): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Get list of subcommands (for testing)
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSubcommands(): string[];
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=completions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/commands/completions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,KAAK,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAEzC,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAQD,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCvG;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC"}
|