@cestoliv/wt 0.3.0-pr13.g878c337 → 0.3.0-pr14.g2b25fef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -18
- package/SKILL.md +25 -19
- package/dist/{agent-52M5VZNS.js → agent-OJLJFW64.js} +30 -40
- package/dist/cli.js +12 -6
- package/dist/skill-CODYQJWN.js +9 -0
- package/package.json +1 -1
- package/dist/skill-XCOCBZB3.js +0 -9
package/README.md
CHANGED
|
@@ -34,30 +34,42 @@ infer from this project. Write the result to the config file (find its path with
|
|
|
34
34
|
## Quick start
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
wt
|
|
38
|
-
wt create my-feat
|
|
39
|
-
wt agent my-feat "Plan the feature"
|
|
40
|
-
wt
|
|
41
|
-
wt
|
|
37
|
+
wt # Browse worktrees (interactive TUI)
|
|
38
|
+
wt create my-feat # New worktree, opens your IDE
|
|
39
|
+
wt agent my-feat "Plan the feature" # New worktree + AI agent in Zed (macOS)
|
|
40
|
+
wt agent fix-bug "Fix bug" --mode auto # Use auto mode instead of plan
|
|
41
|
+
wt config # Edit config in $EDITOR
|
|
42
|
+
wt skill # Print the skill file (for AI agents)
|
|
42
43
|
```
|
|
43
44
|
|
|
44
|
-
## `wt agent <branch> <plan_prompt
|
|
45
|
+
## `wt agent <branch> <plan_prompt> [--mode <mode>]` — the standout
|
|
45
46
|
|
|
46
47
|
```bash
|
|
47
48
|
wt agent feat/login "Read the codebase, then propose a plan for login."
|
|
49
|
+
wt agent fix-bug "Fix the auth bug" --mode auto
|
|
50
|
+
wt agent refactor "Refactor API layer" --mode default
|
|
48
51
|
```
|
|
49
52
|
|
|
50
53
|
Creates a worktree exactly like `wt create`, then auto-starts your agent
|
|
51
54
|
(default `claude --permission-mode plan`) in Zed's integrated terminal —
|
|
52
55
|
pre-filled with your prompt and left interactive for you to take over.
|
|
53
56
|
|
|
57
|
+
**Available modes** (`--mode`, defaults to `plan`):
|
|
58
|
+
|
|
59
|
+
- `default` — Standard interactive mode with approval for each action
|
|
60
|
+
- `acceptEdits` — Allow file changes but keep command execution controlled
|
|
61
|
+
- `plan` — Architecture-first mode with no surprise mutations (default)
|
|
62
|
+
- `auto` — Claude's safety model makes decisions instead of prompting
|
|
63
|
+
- `dontAsk` — Minimal interruptions in trusted environments
|
|
64
|
+
- `bypassPermissions` — Skip all permission checks (dangerous, CI/sandbox only)
|
|
65
|
+
|
|
54
66
|
Under the hood it writes a temporary `.zed/tasks.json`, installs a global Zed
|
|
55
67
|
keymap chord, opens Zed and fires the chord via `osascript`, then removes the
|
|
56
68
|
temp task so the repo stays clean.
|
|
57
69
|
|
|
58
70
|
**Requires** macOS, Zed, and Accessibility permission for the app running `wt`.
|
|
59
|
-
Not granted yet? `wt agent` opens
|
|
60
|
-
|
|
71
|
+
Not granted yet? `wt agent` opens _System Settings → Privacy & Security →
|
|
72
|
+
Accessibility_, waits while you grant it (you may need to quit and reopen the
|
|
61
73
|
app), then retries automatically. On other platforms — or when `ide` isn't
|
|
62
74
|
`zed` — the worktree is still created and opened, just without the agent.
|
|
63
75
|
|
|
@@ -104,16 +116,16 @@ erroring (in a non-interactive shell it exits non-zero).
|
|
|
104
116
|
Edit with `wt config` (`wt config --path` prints the file location —
|
|
105
117
|
`~/Library/Preferences/wt-nodejs/config.json` on macOS).
|
|
106
118
|
|
|
107
|
-
| Key | Default | Description
|
|
108
|
-
| --------------------- | --------------------------------- |
|
|
109
|
-
| `ide` | `"zed"` | Editor to open worktrees with
|
|
110
|
-
| `ide_open_args` | `["-n"]` | Extra args passed to the IDE command
|
|
111
|
-
| `base_branch` | `"origin/main"` | Branch new worktrees are created from
|
|
112
|
-
| `worktree_path` | `"../"` | Where worktrees are placed (relative to repo)
|
|
113
|
-
| `setup_commands` | `[]` | Commands to run in new worktrees
|
|
114
|
-
| `agent_command` | `"claude --permission-mode plan"` |
|
|
115
|
-
| `agent_trigger_chord` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs and presses
|
|
116
|
-
| `repo_overrides` | `{}` | Per-repo overrides for any key above
|
|
119
|
+
| Key | Default | Description |
|
|
120
|
+
| --------------------- | --------------------------------- | ----------------------------------------------------------------------------------- |
|
|
121
|
+
| `ide` | `"zed"` | Editor to open worktrees with |
|
|
122
|
+
| `ide_open_args` | `["-n"]` | Extra args passed to the IDE command |
|
|
123
|
+
| `base_branch` | `"origin/main"` | Branch new worktrees are created from |
|
|
124
|
+
| `worktree_path` | `"../"` | Where worktrees are placed (relative to repo) |
|
|
125
|
+
| `setup_commands` | `[]` | Commands to run in new worktrees |
|
|
126
|
+
| `agent_command` | `"claude --permission-mode plan"` | Base command; `--permission-mode` replaced by `--mode` option, then prompt appended |
|
|
127
|
+
| `agent_trigger_chord` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs and presses |
|
|
128
|
+
| `repo_overrides` | `{}` | Per-repo overrides for any key above |
|
|
117
129
|
|
|
118
130
|
Override any key per repo:
|
|
119
131
|
|
package/SKILL.md
CHANGED
|
@@ -34,7 +34,7 @@ If the worktree path already exists, `wt create` doesn't error — it prompts yo
|
|
|
34
34
|
to **open it in the IDE** or **quit**. (In a non-interactive shell it errors
|
|
35
35
|
with a non-zero exit instead of prompting.)
|
|
36
36
|
|
|
37
|
-
### `wt agent <branch> <plan_prompt
|
|
37
|
+
### `wt agent <branch> <plan_prompt> [--mode <mode>]`
|
|
38
38
|
|
|
39
39
|
Create a worktree (same as `wt create`) **and** auto-start an AI agent in Zed's
|
|
40
40
|
integrated terminal, pre-filled with `<plan_prompt>` and left interactive for
|
|
@@ -42,25 +42,31 @@ you to take over.
|
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
wt agent feature/login 'Read the codebase, then propose a plan for login.'
|
|
45
|
+
wt agent feature/fix 'Fix the bug in payment processing' --mode auto
|
|
46
|
+
wt agent refactor/api 'Refactor the API layer' --mode default
|
|
45
47
|
```
|
|
46
48
|
|
|
49
|
+
The `--mode` flag sets Claude Code's permission mode (defaults to `plan`):
|
|
50
|
+
|
|
51
|
+
- `default` — Standard interactive mode with approval for each action
|
|
52
|
+
- `acceptEdits` — Allow file changes but keep command execution controlled
|
|
53
|
+
- `plan` — Architecture-first mode with no surprise mutations (default)
|
|
54
|
+
- `auto` — Claude's safety model makes decisions instead of prompting
|
|
55
|
+
- `dontAsk` — Minimal interruptions in trusted environments
|
|
56
|
+
- `bypassPermissions` — Skip all permission checks (dangerous, CI/sandbox only)
|
|
57
|
+
|
|
47
58
|
It writes a temporary `.zed/tasks.json` running
|
|
48
|
-
`<agent_command> '<plan_prompt>'`, ensures a global Zed keymap chord
|
|
59
|
+
`<agent_command> --permission-mode <mode> '<plan_prompt>'`, ensures a global Zed keymap chord
|
|
49
60
|
(`agent_trigger_chord`) spawns that task, opens Zed, presses the chord via
|
|
50
61
|
`osascript`, then removes the temporary task so the repo is left clean.
|
|
51
62
|
|
|
52
63
|
**macOS + Zed only.** Requires Accessibility permission for the app that runs
|
|
53
64
|
`wt` (Zed itself, when run from its integrated terminal). If it isn't granted,
|
|
54
|
-
`wt agent` opens the
|
|
65
|
+
`wt agent` opens the _Privacy & Security → Accessibility_ settings pane and waits
|
|
55
66
|
for you to grant it and confirm, then retries automatically. On other platforms
|
|
56
67
|
(or when `ide` is not `zed`) the worktree is still created and opened, but the
|
|
57
68
|
agent is not auto-started.
|
|
58
69
|
|
|
59
|
-
Over SSH it still works, provided the same user has an active graphical login on
|
|
60
|
-
the Mac: the keystroke is sent via `launchctl asuser` so it reaches that GUI
|
|
61
|
-
session. With no one logged in graphically there is nothing to drive, so it
|
|
62
|
-
falls back to the manual "press the chord in Zed" message.
|
|
63
|
-
|
|
64
70
|
If the worktree path already exists, `wt agent` prompts you to **open it in the
|
|
65
71
|
IDE**, **open it and start the agent**, or **quit** — instead of erroring. (In a
|
|
66
72
|
non-interactive shell it errors with a non-zero exit instead of prompting.)
|
|
@@ -84,17 +90,17 @@ Config is stored as JSON. Get the path with `wt config --path`.
|
|
|
84
90
|
|
|
85
91
|
### Schema
|
|
86
92
|
|
|
87
|
-
| Key
|
|
88
|
-
|
|
|
89
|
-
| `worktree_path`
|
|
90
|
-
| `base_branch`
|
|
91
|
-
| `setup_commands`
|
|
92
|
-
| `ide`
|
|
93
|
-
| `ide_open_args`
|
|
94
|
-
| `agent_command`
|
|
95
|
-
| `agent_trigger_chord` | `string`
|
|
96
|
-
| `repos`
|
|
97
|
-
| `repo_overrides`
|
|
93
|
+
| Key | Type | Default | Description |
|
|
94
|
+
| --------------------- | ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `worktree_path` | `string` | `"../"` | Where to place new worktrees, relative to the repo root |
|
|
96
|
+
| `base_branch` | `string` | `"origin/main"` | Branch to base new worktrees on |
|
|
97
|
+
| `setup_commands` | `string[]` | `[]` | Commands to run in a new worktree after creation (e.g. `["npm install"]`) |
|
|
98
|
+
| `ide` | `string` | `"zed"` | IDE command to open worktrees with |
|
|
99
|
+
| `ide_open_args` | `string[]` | `["-n"]` | Arguments passed to the IDE command |
|
|
100
|
+
| `agent_command` | `string` | `"claude --permission-mode plan"` | Base command `wt agent` runs in Zed; any `--permission-mode` flag is replaced by the `--mode` option (defaults to `plan`), then `<plan_prompt>` is appended single-quoted |
|
|
101
|
+
| `agent_trigger_chord` | `string` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs/presses to spawn the agent task |
|
|
102
|
+
| `repos` | `string[]` | `[]` | Registered repo paths (auto-populated on first use) |
|
|
103
|
+
| `repo_overrides` | `object` | `{}` | Per-repo config overrides (see below) |
|
|
98
104
|
|
|
99
105
|
### Per-repo overrides
|
|
100
106
|
|
|
@@ -25,11 +25,16 @@ import { homedir } from "os";
|
|
|
25
25
|
import { dirname, join } from "path";
|
|
26
26
|
import { applyEdits, modify, parse } from "jsonc-parser";
|
|
27
27
|
var AGENT_TASK_LABEL = "wt: agent";
|
|
28
|
-
function buildAgentTask(agentCommand, prompt, label) {
|
|
28
|
+
function buildAgentTask(agentCommand, prompt, label, mode) {
|
|
29
|
+
let finalCommand = agentCommand;
|
|
30
|
+
if (mode) {
|
|
31
|
+
const baseCommand = agentCommand.replace(/--permission-mode\s+\S+/g, "").replace(/\s+/g, " ").trim();
|
|
32
|
+
finalCommand = `${baseCommand} --permission-mode ${mode}`.trim();
|
|
33
|
+
}
|
|
29
34
|
const escaped = prompt.replace(/'/g, "'\\''");
|
|
30
35
|
return {
|
|
31
36
|
label,
|
|
32
|
-
command: `${
|
|
37
|
+
command: `${finalCommand} '${escaped}'`,
|
|
33
38
|
cwd: "$ZED_WORKTREE_ROOT",
|
|
34
39
|
use_new_terminal: true,
|
|
35
40
|
allow_concurrent_runs: false,
|
|
@@ -273,48 +278,17 @@ Note: "${chord}" is already bound in ${keymapPath}; wt's agent binding will take
|
|
|
273
278
|
return true;
|
|
274
279
|
}
|
|
275
280
|
var ACCESSIBILITY_SETTINGS_URL = "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility";
|
|
276
|
-
function isHeadlessSession(env = process.env) {
|
|
277
|
-
return Boolean(env.SSH_CONNECTION || env.SSH_TTY || env.SSH_CLIENT);
|
|
278
|
-
}
|
|
279
|
-
function buildOsascriptCommand(script, opts = {}) {
|
|
280
|
-
const { env = process.env, uid } = opts;
|
|
281
|
-
if (isHeadlessSession(env) && typeof uid === "number") {
|
|
282
|
-
return {
|
|
283
|
-
command: "launchctl",
|
|
284
|
-
args: ["asuser", String(uid), "osascript", "-e", script]
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
return { command: "osascript", args: ["-e", script] };
|
|
288
|
-
}
|
|
289
|
-
var OSASCRIPT_TIMEOUT_MS = 3e4;
|
|
290
281
|
function defaultRunner(script) {
|
|
291
282
|
return new Promise((resolve) => {
|
|
292
|
-
const
|
|
293
|
-
uid: process.getuid?.()
|
|
294
|
-
});
|
|
295
|
-
const child = spawn(command, args, {
|
|
283
|
+
const child = spawn("osascript", ["-e", script], {
|
|
296
284
|
stdio: ["ignore", "ignore", "pipe"]
|
|
297
285
|
});
|
|
298
286
|
let stderr = "";
|
|
299
|
-
let settled = false;
|
|
300
|
-
const finish = (result) => {
|
|
301
|
-
if (settled) return;
|
|
302
|
-
settled = true;
|
|
303
|
-
clearTimeout(timer);
|
|
304
|
-
resolve(result);
|
|
305
|
-
};
|
|
306
|
-
const timer = setTimeout(() => {
|
|
307
|
-
child.kill();
|
|
308
|
-
finish({
|
|
309
|
-
code: null,
|
|
310
|
-
stderr: "osascript timed out \u2014 is a user logged into the Mac's graphical session?"
|
|
311
|
-
});
|
|
312
|
-
}, OSASCRIPT_TIMEOUT_MS);
|
|
313
287
|
child.stderr?.on("data", (d) => {
|
|
314
288
|
stderr += d.toString();
|
|
315
289
|
});
|
|
316
|
-
child.on("error", (err) =>
|
|
317
|
-
child.on("close", (code) =>
|
|
290
|
+
child.on("error", (err) => resolve({ code: null, stderr: err.message }));
|
|
291
|
+
child.on("close", (code) => resolve({ code, stderr }));
|
|
318
292
|
});
|
|
319
293
|
}
|
|
320
294
|
function isAccessibilityError(stderr) {
|
|
@@ -350,9 +324,24 @@ function openAccessibilitySettings(open = defaultOpen) {
|
|
|
350
324
|
}
|
|
351
325
|
|
|
352
326
|
// src/commands/agent.ts
|
|
327
|
+
var VALID_MODES = [
|
|
328
|
+
"default",
|
|
329
|
+
"acceptEdits",
|
|
330
|
+
"plan",
|
|
331
|
+
"auto",
|
|
332
|
+
"dontAsk",
|
|
333
|
+
"bypassPermissions"
|
|
334
|
+
];
|
|
353
335
|
var CLEANUP_DELAY_MS = 2e4;
|
|
354
336
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
355
337
|
async function createAgentWorktree(branch, planPrompt, options = {}) {
|
|
338
|
+
const mode = options.mode ?? "plan";
|
|
339
|
+
if (!VALID_MODES.includes(mode)) {
|
|
340
|
+
console.error(
|
|
341
|
+
pc.red(`Invalid mode "${mode}". Valid modes: ${VALID_MODES.join(", ")}`)
|
|
342
|
+
);
|
|
343
|
+
process.exit(1);
|
|
344
|
+
}
|
|
356
345
|
const prepared = await prepareWorktree(branch, options);
|
|
357
346
|
if (!prepared) return;
|
|
358
347
|
const { status, config, worktreePath } = prepared;
|
|
@@ -365,9 +354,9 @@ async function createAgentWorktree(branch, planPrompt, options = {}) {
|
|
|
365
354
|
return;
|
|
366
355
|
}
|
|
367
356
|
}
|
|
368
|
-
await startAgentInWorktree(config, worktreePath, planPrompt);
|
|
357
|
+
await startAgentInWorktree(config, worktreePath, planPrompt, mode);
|
|
369
358
|
}
|
|
370
|
-
async function startAgentInWorktree(config, worktreePath, planPrompt) {
|
|
359
|
+
async function startAgentInWorktree(config, worktreePath, planPrompt, mode) {
|
|
371
360
|
if (config.ide !== "zed") {
|
|
372
361
|
console.warn(
|
|
373
362
|
pc.yellow(
|
|
@@ -387,7 +376,8 @@ async function startAgentInWorktree(config, worktreePath, planPrompt) {
|
|
|
387
376
|
const task = buildAgentTask(
|
|
388
377
|
config.agent_command,
|
|
389
378
|
planPrompt,
|
|
390
|
-
AGENT_TASK_LABEL
|
|
379
|
+
AGENT_TASK_LABEL,
|
|
380
|
+
mode
|
|
391
381
|
);
|
|
392
382
|
const created = writeAgentTask(worktreePath, task);
|
|
393
383
|
const keymapOk = ensureKeymap(config.agent_trigger_chord, AGENT_TASK_LABEL);
|
|
@@ -450,7 +440,7 @@ function reportTriggerFailure(result, chord) {
|
|
|
450
440
|
}
|
|
451
441
|
console.warn(
|
|
452
442
|
pc.yellow(
|
|
453
|
-
`\u26A0 Could not auto-start the agent${result.message ? `: ${result.message}` : ""}. In Zed, press ${chord} to start it manually
|
|
443
|
+
`\u26A0 Could not auto-start the agent${result.message ? `: ${result.message}` : ""}. In Zed, press ${chord} to start it manually.`
|
|
454
444
|
)
|
|
455
445
|
);
|
|
456
446
|
}
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/cli.ts
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
var program = new Command();
|
|
6
|
-
program.name("wt").description("Git worktree manager").version("0.3.0-
|
|
6
|
+
program.name("wt").description("Git worktree manager").version("0.3.0-pr14.g2b25fef").action(async () => {
|
|
7
7
|
const { runList } = await import("./list-VPPPO26E.js");
|
|
8
8
|
await runList();
|
|
9
9
|
});
|
|
@@ -11,10 +11,16 @@ program.command("create [branch]").description("Create a new worktree").action(a
|
|
|
11
11
|
const { createWorktree } = await import("./create-RWGSJRM5.js");
|
|
12
12
|
await createWorktree(branch);
|
|
13
13
|
});
|
|
14
|
-
program.command("agent <branch> <plan_prompt>").description("Create a worktree and auto-start an AI agent in Zed (macOS)").
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
program.command("agent <branch> <plan_prompt>").description("Create a worktree and auto-start an AI agent in Zed (macOS)").option(
|
|
15
|
+
"--mode <mode>",
|
|
16
|
+
"Claude Code permission mode (default, plan, auto, etc.)",
|
|
17
|
+
"plan"
|
|
18
|
+
).action(
|
|
19
|
+
async (branch, planPrompt, options) => {
|
|
20
|
+
const { createAgentWorktree } = await import("./agent-OJLJFW64.js");
|
|
21
|
+
await createAgentWorktree(branch, planPrompt, { mode: options.mode });
|
|
22
|
+
}
|
|
23
|
+
);
|
|
18
24
|
program.command("config").description("Open the config file in $EDITOR").option("--path", "Print the config file path and exit").action(async (options) => {
|
|
19
25
|
if (options.path) {
|
|
20
26
|
const { printConfigPath } = await import("./config-7QMKGWCX.js");
|
|
@@ -25,7 +31,7 @@ program.command("config").description("Open the config file in $EDITOR").option(
|
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
33
|
program.command("skill").description("Print the wt skill file to stdout").action(async () => {
|
|
28
|
-
const { printSkill } = await import("./skill-
|
|
34
|
+
const { printSkill } = await import("./skill-CODYQJWN.js");
|
|
29
35
|
printSkill();
|
|
30
36
|
});
|
|
31
37
|
await program.parseAsync(process.argv);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/commands/skill.ts
|
|
4
|
+
function printSkill() {
|
|
5
|
+
console.log('---\nname: wt-worktree-manager\ndescription: Use the wt CLI to create, browse, open, and delete git worktrees across repos. Use when the user asks to manage worktrees, create isolated branches, or configure worktree defaults.\n---\n\n# wt \u2014 Git Worktree Manager\n\n`wt` is a CLI for managing git worktrees. It provides an interactive TUI to browse, create, open in your IDE, and delete worktrees across multiple repos.\n\n## Commands\n\n### `wt` (no subcommand)\n\nLaunch the interactive TUI. Shows worktrees for the current repo (repo mode) or all registered repos (global mode, when run outside a repo).\n\n**Keybindings in the TUI:**\n\n- Arrow keys / `j`/`k` \u2014 navigate\n- `Enter` \u2014 open worktree in IDE\n- `d` \u2014 delete worktree\n- `c` \u2014 create new worktree (repo mode only)\n- `/` \u2014 search\n- `q` / `Esc` \u2014 quit\n\n### `wt create [branch]`\n\nCreate a new worktree. If `branch` is omitted, prompts interactively.\n\nThe worktree is created as a sibling directory to the repo: `<parent>/<repo-name>-<branch-name>`.\n\nAfter creation, `wt` runs any configured `setup_commands` and opens the worktree in your IDE.\n\nIf the worktree path already exists, `wt create` doesn\'t error \u2014 it prompts you\nto **open it in the IDE** or **quit**. (In a non-interactive shell it errors\nwith a non-zero exit instead of prompting.)\n\n### `wt agent <branch> <plan_prompt> [--mode <mode>]`\n\nCreate a worktree (same as `wt create`) **and** auto-start an AI agent in Zed\'s\nintegrated terminal, pre-filled with `<plan_prompt>` and left interactive for\nyou to take over.\n\n```bash\nwt agent feature/login \'Read the codebase, then propose a plan for login.\'\nwt agent feature/fix \'Fix the bug in payment processing\' --mode auto\nwt agent refactor/api \'Refactor the API layer\' --mode default\n```\n\nThe `--mode` flag sets Claude Code\'s permission mode (defaults to `plan`):\n\n- `default` \u2014 Standard interactive mode with approval for each action\n- `acceptEdits` \u2014 Allow file changes but keep command execution controlled\n- `plan` \u2014 Architecture-first mode with no surprise mutations (default)\n- `auto` \u2014 Claude\'s safety model makes decisions instead of prompting\n- `dontAsk` \u2014 Minimal interruptions in trusted environments\n- `bypassPermissions` \u2014 Skip all permission checks (dangerous, CI/sandbox only)\n\nIt writes a temporary `.zed/tasks.json` running\n`<agent_command> --permission-mode <mode> \'<plan_prompt>\'`, ensures a global Zed keymap chord\n(`agent_trigger_chord`) spawns that task, opens Zed, presses the chord via\n`osascript`, then removes the temporary task so the repo is left clean.\n\n**macOS + Zed only.** Requires Accessibility permission for the app that runs\n`wt` (Zed itself, when run from its integrated terminal). If it isn\'t granted,\n`wt agent` opens the _Privacy & Security \u2192 Accessibility_ settings pane and waits\nfor you to grant it and confirm, then retries automatically. On other platforms\n(or when `ide` is not `zed`) the worktree is still created and opened, but the\nagent is not auto-started.\n\nIf the worktree path already exists, `wt agent` prompts you to **open it in the\nIDE**, **open it and start the agent**, or **quit** \u2014 instead of erroring. (In a\nnon-interactive shell it errors with a non-zero exit instead of prompting.)\n\n### `wt config`\n\nOpen the global config file in `$EDITOR` (defaults to `nano`).\n\n```bash\nwt config # open in editor\nwt config --path # print config file path only\n```\n\n### `wt skill`\n\nPrint this skill file to stdout. Useful for piping to agents or copying to a project.\n\n## Configuration\n\nConfig is stored as JSON. Get the path with `wt config --path`.\n\n### Schema\n\n| Key | Type | Default | Description |\n| --------------------- | ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `worktree_path` | `string` | `"../"` | Where to place new worktrees, relative to the repo root |\n| `base_branch` | `string` | `"origin/main"` | Branch to base new worktrees on |\n| `setup_commands` | `string[]` | `[]` | Commands to run in a new worktree after creation (e.g. `["npm install"]`) |\n| `ide` | `string` | `"zed"` | IDE command to open worktrees with |\n| `ide_open_args` | `string[]` | `["-n"]` | Arguments passed to the IDE command |\n| `agent_command` | `string` | `"claude --permission-mode plan"` | Base command `wt agent` runs in Zed; any `--permission-mode` flag is replaced by the `--mode` option (defaults to `plan`), then `<plan_prompt>` is appended single-quoted |\n| `agent_trigger_chord` | `string` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs/presses to spawn the agent task |\n| `repos` | `string[]` | `[]` | Registered repo paths (auto-populated on first use) |\n| `repo_overrides` | `object` | `{}` | Per-repo config overrides (see below) |\n\n### Per-repo overrides\n\nOverride any field (`worktree_path`, `base_branch`, `setup_commands`, `ide`, `ide_open_args`, `agent_command`, `agent_trigger_chord`) for a specific repo:\n\n```json\n{\n "base_branch": "origin/main",\n "ide": "zed",\n "repo_overrides": {\n "/path/to/my-repo": {\n "base_branch": "origin/develop",\n "setup_commands": ["npm install", "npm run build"]\n }\n }\n}\n```\n\n## Common workflows\n\n### Create a worktree for a new feature\n\n```bash\ncd /path/to/repo\nwt create feature/my-branch\n```\n\n### Configure setup commands for a repo\n\n```bash\nwt config\n# Then add to the JSON:\n# "repo_overrides": {\n# "/path/to/repo": {\n# "setup_commands": ["npm install"]\n# }\n# }\n```\n\n### Browse all worktrees across repos\n\nRun `wt` from any directory outside a git repo to see worktrees from all registered repos.\n');
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
printSkill
|
|
9
|
+
};
|
package/package.json
CHANGED
package/dist/skill-XCOCBZB3.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/commands/skill.ts
|
|
4
|
-
function printSkill() {
|
|
5
|
-
console.log('---\nname: wt-worktree-manager\ndescription: Use the wt CLI to create, browse, open, and delete git worktrees across repos. Use when the user asks to manage worktrees, create isolated branches, or configure worktree defaults.\n---\n\n# wt \u2014 Git Worktree Manager\n\n`wt` is a CLI for managing git worktrees. It provides an interactive TUI to browse, create, open in your IDE, and delete worktrees across multiple repos.\n\n## Commands\n\n### `wt` (no subcommand)\n\nLaunch the interactive TUI. Shows worktrees for the current repo (repo mode) or all registered repos (global mode, when run outside a repo).\n\n**Keybindings in the TUI:**\n\n- Arrow keys / `j`/`k` \u2014 navigate\n- `Enter` \u2014 open worktree in IDE\n- `d` \u2014 delete worktree\n- `c` \u2014 create new worktree (repo mode only)\n- `/` \u2014 search\n- `q` / `Esc` \u2014 quit\n\n### `wt create [branch]`\n\nCreate a new worktree. If `branch` is omitted, prompts interactively.\n\nThe worktree is created as a sibling directory to the repo: `<parent>/<repo-name>-<branch-name>`.\n\nAfter creation, `wt` runs any configured `setup_commands` and opens the worktree in your IDE.\n\nIf the worktree path already exists, `wt create` doesn\'t error \u2014 it prompts you\nto **open it in the IDE** or **quit**. (In a non-interactive shell it errors\nwith a non-zero exit instead of prompting.)\n\n### `wt agent <branch> <plan_prompt>`\n\nCreate a worktree (same as `wt create`) **and** auto-start an AI agent in Zed\'s\nintegrated terminal, pre-filled with `<plan_prompt>` and left interactive for\nyou to take over.\n\n```bash\nwt agent feature/login \'Read the codebase, then propose a plan for login.\'\n```\n\nIt writes a temporary `.zed/tasks.json` running\n`<agent_command> \'<plan_prompt>\'`, ensures a global Zed keymap chord\n(`agent_trigger_chord`) spawns that task, opens Zed, presses the chord via\n`osascript`, then removes the temporary task so the repo is left clean.\n\n**macOS + Zed only.** Requires Accessibility permission for the app that runs\n`wt` (Zed itself, when run from its integrated terminal). If it isn\'t granted,\n`wt agent` opens the *Privacy & Security \u2192 Accessibility* settings pane and waits\nfor you to grant it and confirm, then retries automatically. On other platforms\n(or when `ide` is not `zed`) the worktree is still created and opened, but the\nagent is not auto-started.\n\nOver SSH it still works, provided the same user has an active graphical login on\nthe Mac: the keystroke is sent via `launchctl asuser` so it reaches that GUI\nsession. With no one logged in graphically there is nothing to drive, so it\nfalls back to the manual "press the chord in Zed" message.\n\nIf the worktree path already exists, `wt agent` prompts you to **open it in the\nIDE**, **open it and start the agent**, or **quit** \u2014 instead of erroring. (In a\nnon-interactive shell it errors with a non-zero exit instead of prompting.)\n\n### `wt config`\n\nOpen the global config file in `$EDITOR` (defaults to `nano`).\n\n```bash\nwt config # open in editor\nwt config --path # print config file path only\n```\n\n### `wt skill`\n\nPrint this skill file to stdout. Useful for piping to agents or copying to a project.\n\n## Configuration\n\nConfig is stored as JSON. Get the path with `wt config --path`.\n\n### Schema\n\n| Key | Type | Default | Description |\n| ---------------- | ---------- | --------------- | ------------------------------------------------------------------------- |\n| `worktree_path` | `string` | `"../"` | Where to place new worktrees, relative to the repo root |\n| `base_branch` | `string` | `"origin/main"` | Branch to base new worktrees on |\n| `setup_commands` | `string[]` | `[]` | Commands to run in a new worktree after creation (e.g. `["npm install"]`) |\n| `ide` | `string` | `"zed"` | IDE command to open worktrees with |\n| `ide_open_args` | `string[]` | `["-n"]` | Arguments passed to the IDE command |\n| `agent_command` | `string` | `"claude --permission-mode plan"` | Command `wt agent` runs in Zed; `<plan_prompt>` is appended single-quoted |\n| `agent_trigger_chord` | `string` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs/presses to spawn the agent task |\n| `repos` | `string[]` | `[]` | Registered repo paths (auto-populated on first use) |\n| `repo_overrides` | `object` | `{}` | Per-repo config overrides (see below) |\n\n### Per-repo overrides\n\nOverride any field (`worktree_path`, `base_branch`, `setup_commands`, `ide`, `ide_open_args`, `agent_command`, `agent_trigger_chord`) for a specific repo:\n\n```json\n{\n "base_branch": "origin/main",\n "ide": "zed",\n "repo_overrides": {\n "/path/to/my-repo": {\n "base_branch": "origin/develop",\n "setup_commands": ["npm install", "npm run build"]\n }\n }\n}\n```\n\n## Common workflows\n\n### Create a worktree for a new feature\n\n```bash\ncd /path/to/repo\nwt create feature/my-branch\n```\n\n### Configure setup commands for a repo\n\n```bash\nwt config\n# Then add to the JSON:\n# "repo_overrides": {\n# "/path/to/repo": {\n# "setup_commands": ["npm install"]\n# }\n# }\n```\n\n### Browse all worktrees across repos\n\nRun `wt` from any directory outside a git repo to see worktrees from all registered repos.\n');
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
printSkill
|
|
9
|
-
};
|