@cestoliv/wt 0.5.0-pr22.gbb5b3fa → 0.5.0-pr23.g58c078b
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 +9 -7
- package/SKILL.md +7 -5
- package/dist/{agent-575QKWIG.js → agent-D5XFA5Q6.js} +16 -6
- package/dist/{chunk-QHNOUX63.js → chunk-37JQF4PI.js} +7 -7
- package/dist/{chunk-Q6NNNYDJ.js → chunk-AXP52BNV.js} +2 -2
- package/dist/{chunk-YXA6CZ2L.js → chunk-BY3O2QUG.js} +1 -1
- package/dist/{chunk-QVYSEMSL.js → chunk-OUWQ6NIV.js} +2 -1
- package/dist/cli.js +9 -10
- package/dist/{config-QLWPW2UZ.js → config-QSYG3JDC.js} +1 -1
- package/dist/{create-DYM7QWI5.js → create-ECNYOWOT.js} +3 -3
- package/dist/{list-XRECVEUI.js → list-2AC636OB.js} +3 -3
- package/dist/{prune-LOO5KMBU.js → prune-YYCUDNI5.js} +3 -3
- package/dist/skill-OMSPELIY.js +9 -0
- package/package.json +1 -1
- package/dist/skill-5JFC6Q33.js +0 -9
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ infer from this project. Write the result to the config file (find its path with
|
|
|
37
37
|
wt # Browse worktrees (interactive TUI)
|
|
38
38
|
wt create my-feat # New worktree, opens your IDE
|
|
39
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
|
|
40
|
+
wt agent fix-bug "Fix bug" --mode auto # Use auto mode instead of the default
|
|
41
41
|
wt prune # Remove merged worktrees (per-branch confirm)
|
|
42
42
|
wt config # Edit config in $EDITOR
|
|
43
43
|
wt skill # Print the skill file (for AI agents)
|
|
@@ -52,14 +52,15 @@ wt agent refactor "Refactor API layer" --mode default
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Creates a worktree exactly like `wt create`, then auto-starts your agent
|
|
55
|
-
(default `claude
|
|
56
|
-
pre-filled with your prompt and left interactive for you to take over.
|
|
55
|
+
(default `claude`, run with `--permission-mode default`) in Zed's integrated
|
|
56
|
+
terminal — pre-filled with your prompt and left interactive for you to take over.
|
|
57
57
|
|
|
58
|
-
**Available modes** (`--mode`, defaults to `
|
|
58
|
+
**Available modes** (`--mode`, defaults to `default`; change the default with
|
|
59
|
+
the `agent_mode` config key):
|
|
59
60
|
|
|
60
|
-
- `default` — Standard interactive mode with approval for each action
|
|
61
|
+
- `default` — Standard interactive mode with approval for each action (default)
|
|
61
62
|
- `acceptEdits` — Allow file changes but keep command execution controlled
|
|
62
|
-
- `plan` — Architecture-first mode with no surprise mutations
|
|
63
|
+
- `plan` — Architecture-first mode with no surprise mutations
|
|
63
64
|
- `auto` — Claude's safety model makes decisions instead of prompting
|
|
64
65
|
- `dontAsk` — Minimal interruptions in trusted environments
|
|
65
66
|
- `bypassPermissions` — Skip all permission checks (dangerous, CI/sandbox only)
|
|
@@ -159,7 +160,8 @@ Edit with `wt config` (`wt config --path` prints the file location —
|
|
|
159
160
|
| `worktree_path` | `"../"` | Where worktrees are placed (relative to repo) |
|
|
160
161
|
| `setup_commands` | `[]` | Commands to run in new worktrees |
|
|
161
162
|
| `teardown_commands` | `[]` | Commands to run in a worktree just before it is deleted (e.g. `["docker compose down -v"]`) |
|
|
162
|
-
| `agent_command` | `"claude
|
|
163
|
+
| `agent_command` | `"claude"` | Base command; `--permission-mode <mode>` injected, then prompt appended |
|
|
164
|
+
| `agent_mode` | `"default"` | Default permission mode for `wt agent` (overridden by `--mode`) |
|
|
163
165
|
| `agent_trigger_chord` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs and presses |
|
|
164
166
|
| `auto_refresh_minutes`| `5` | How often the interactive list re-fetches worktrees (shows a "last refreshed" header); `0` disables it |
|
|
165
167
|
| `repo_overrides` | `{}` | Per-repo overrides for any key above |
|
package/SKILL.md
CHANGED
|
@@ -66,11 +66,12 @@ wt agent feature/fix 'Fix the bug in payment processing' --mode auto
|
|
|
66
66
|
wt agent refactor/api 'Refactor the API layer' --mode default
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
The `--mode` flag sets Claude Code's permission mode (defaults to `
|
|
69
|
+
The `--mode` flag sets Claude Code's permission mode (defaults to `default`;
|
|
70
|
+
change the default with the `agent_mode` config key):
|
|
70
71
|
|
|
71
|
-
- `default` — Standard interactive mode with approval for each action
|
|
72
|
+
- `default` — Standard interactive mode with approval for each action (default)
|
|
72
73
|
- `acceptEdits` — Allow file changes but keep command execution controlled
|
|
73
|
-
- `plan` — Architecture-first mode with no surprise mutations
|
|
74
|
+
- `plan` — Architecture-first mode with no surprise mutations
|
|
74
75
|
- `auto` — Claude's safety model makes decisions instead of prompting
|
|
75
76
|
- `dontAsk` — Minimal interruptions in trusted environments
|
|
76
77
|
- `bypassPermissions` — Skip all permission checks (dangerous, CI/sandbox only)
|
|
@@ -144,7 +145,8 @@ Config is stored as JSON. Get the path with `wt config --path`.
|
|
|
144
145
|
| `teardown_commands` | `string[]` | `[]` | Commands to run in a worktree just before it is deleted (e.g. `["docker compose down -v"]`); on failure you are prompted whether to delete anyway |
|
|
145
146
|
| `ide` | `string` | `"zed"` | IDE command to open worktrees with |
|
|
146
147
|
| `ide_open_args` | `string[]` | `["-n"]` | Arguments passed to the IDE command |
|
|
147
|
-
| `agent_command` | `string` | `"claude
|
|
148
|
+
| `agent_command` | `string` | `"claude"` | Base command `wt agent` runs in Zed; `--permission-mode <mode>` is injected (any existing one replaced), then `<plan_prompt>` is appended single-quoted |
|
|
149
|
+
| `agent_mode` | `string` | `"default"` | Default Claude Code permission mode for `wt agent`; the `--mode` flag overrides it. One of `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions` |
|
|
148
150
|
| `agent_trigger_chord` | `string` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs/presses to spawn the agent task |
|
|
149
151
|
| `auto_refresh_minutes`| `number` | `5` | How often the interactive list (`wt`) re-fetches worktrees and updates the "last refreshed" header; `0` disables auto-refresh |
|
|
150
152
|
| `repos` | `string[]` | `[]` | Registered repo paths (auto-populated on first use) |
|
|
@@ -152,7 +154,7 @@ Config is stored as JSON. Get the path with `wt config --path`.
|
|
|
152
154
|
|
|
153
155
|
### Per-repo overrides
|
|
154
156
|
|
|
155
|
-
Override any field (`worktree_path`, `base_branch`, `setup_commands`, `teardown_commands`, `ide`, `ide_open_args`, `agent_command`, `agent_trigger_chord`, `auto_refresh_minutes`) for a specific repo:
|
|
157
|
+
Override any field (`worktree_path`, `base_branch`, `setup_commands`, `teardown_commands`, `ide`, `ide_open_args`, `agent_command`, `agent_mode`, `agent_trigger_chord`, `auto_refresh_minutes`) for a specific repo:
|
|
156
158
|
|
|
157
159
|
```json
|
|
158
160
|
{
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
openConfiguredIde,
|
|
4
4
|
prepareWorktree,
|
|
5
5
|
promptExistingWorktree
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-AXP52BNV.js";
|
|
7
|
+
import "./chunk-BY3O2QUG.js";
|
|
8
|
+
import "./chunk-OUWQ6NIV.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/agent.ts
|
|
11
11
|
import * as clack from "@clack/prompts";
|
|
@@ -427,16 +427,26 @@ var VALID_MODES = [
|
|
|
427
427
|
var CLEANUP_DELAY_MS = 2e4;
|
|
428
428
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
429
429
|
async function createAgentWorktree(branch, planPrompt, options = {}) {
|
|
430
|
-
|
|
431
|
-
if (!VALID_MODES.includes(mode)) {
|
|
430
|
+
if (options.mode && !VALID_MODES.includes(options.mode)) {
|
|
432
431
|
console.error(
|
|
433
|
-
pc.red(
|
|
432
|
+
pc.red(
|
|
433
|
+
`Invalid mode "${options.mode}". Valid modes: ${VALID_MODES.join(", ")}`
|
|
434
|
+
)
|
|
434
435
|
);
|
|
435
436
|
process.exit(1);
|
|
436
437
|
}
|
|
437
438
|
const prepared = await prepareWorktree(branch, options);
|
|
438
439
|
if (!prepared) return;
|
|
439
440
|
const { status, config, worktreePath } = prepared;
|
|
441
|
+
const mode = options.mode ?? config.agent_mode ?? "default";
|
|
442
|
+
if (!VALID_MODES.includes(mode)) {
|
|
443
|
+
console.error(
|
|
444
|
+
pc.red(
|
|
445
|
+
`Invalid agent_mode "${mode}" in config. Valid modes: ${VALID_MODES.join(", ")}`
|
|
446
|
+
)
|
|
447
|
+
);
|
|
448
|
+
process.exit(1);
|
|
449
|
+
}
|
|
440
450
|
if (status === "exists") {
|
|
441
451
|
const prompt = options.existingWorktreePrompt ?? promptExistingWorktree;
|
|
442
452
|
const action = await prompt(worktreePath, { allowAgent: true });
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
runInteractiveList,
|
|
15
15
|
runRepoPicker,
|
|
16
16
|
runWizard
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BY3O2QUG.js";
|
|
18
18
|
import {
|
|
19
19
|
createStore,
|
|
20
20
|
getEffectiveConfig,
|
|
21
21
|
getGlobalConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OUWQ6NIV.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/list.ts
|
|
25
25
|
import * as clack from "@clack/prompts";
|
|
@@ -96,14 +96,13 @@ async function runList(options = {}) {
|
|
|
96
96
|
if (!await runWizard(steps)) return;
|
|
97
97
|
if (state.pickedRepo === void 0 || state.branch === void 0)
|
|
98
98
|
return;
|
|
99
|
-
const { createWorktree } = await import("./create-
|
|
99
|
+
const { createWorktree } = await import("./create-ECNYOWOT.js");
|
|
100
100
|
await createWorktree(state.branch, { cwd: state.pickedRepo, store });
|
|
101
101
|
},
|
|
102
102
|
onAgent: async () => {
|
|
103
|
-
const { createAgentWorktree, VALID_MODES } = await import("./agent-
|
|
103
|
+
const { createAgentWorktree, VALID_MODES } = await import("./agent-D5XFA5Q6.js");
|
|
104
104
|
const state = {
|
|
105
|
-
pickedRepo: repoRoot ?? void 0
|
|
106
|
-
mode: "plan"
|
|
105
|
+
pickedRepo: repoRoot ?? void 0
|
|
107
106
|
};
|
|
108
107
|
const steps = buildWorktreeSteps(repoRoot, store, state);
|
|
109
108
|
steps.push(async () => {
|
|
@@ -117,9 +116,10 @@ async function runList(options = {}) {
|
|
|
117
116
|
return true;
|
|
118
117
|
});
|
|
119
118
|
steps.push(async () => {
|
|
119
|
+
const configuredMode = state.pickedRepo ? getEffectiveConfig(state.pickedRepo, store).agent_mode : void 0;
|
|
120
120
|
const chosen = await clack.select({
|
|
121
121
|
message: "Permission mode:",
|
|
122
|
-
initialValue: state.mode,
|
|
122
|
+
initialValue: state.mode ?? configuredMode,
|
|
123
123
|
options: VALID_MODES.map((m) => ({ value: String(m), label: m }))
|
|
124
124
|
});
|
|
125
125
|
if (clack.isCancel(chosen)) return false;
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
runCommands,
|
|
14
14
|
runRepoPicker,
|
|
15
15
|
setUpstreamTracking
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BY3O2QUG.js";
|
|
17
17
|
import {
|
|
18
18
|
createStore,
|
|
19
19
|
getEffectiveConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OUWQ6NIV.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/create.ts
|
|
23
23
|
import { existsSync } from "fs";
|
|
@@ -68,9 +68,10 @@ var DEFAULT_CONFIG = {
|
|
|
68
68
|
teardown_commands: [],
|
|
69
69
|
ide: "zed",
|
|
70
70
|
ide_open_args: ["-n"],
|
|
71
|
-
agent_command: "claude
|
|
71
|
+
agent_command: "claude",
|
|
72
72
|
agent_trigger_chord: "ctrl-shift-cmd-c",
|
|
73
73
|
auto_refresh_minutes: 5,
|
|
74
|
+
agent_mode: "default",
|
|
74
75
|
repos: [],
|
|
75
76
|
repo_overrides: {}
|
|
76
77
|
};
|
package/dist/cli.js
CHANGED
|
@@ -3,41 +3,40 @@
|
|
|
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.5.0-
|
|
7
|
-
const { runList } = await import("./list-
|
|
6
|
+
program.name("wt").description("Git worktree manager").version("0.5.0-pr23.g58c078b").action(async () => {
|
|
7
|
+
const { runList } = await import("./list-2AC636OB.js");
|
|
8
8
|
await runList();
|
|
9
9
|
});
|
|
10
10
|
program.command("create [branch]").description("Create a new worktree").action(async (branch) => {
|
|
11
|
-
const { createWorktree } = await import("./create-
|
|
11
|
+
const { createWorktree } = await import("./create-ECNYOWOT.js");
|
|
12
12
|
await createWorktree(branch);
|
|
13
13
|
});
|
|
14
14
|
program.command("agent <branch> <plan_prompt>").description("Create a worktree and auto-start an AI agent in Zed (macOS)").option(
|
|
15
15
|
"--mode <mode>",
|
|
16
|
-
"Claude Code permission mode (default, plan, auto, etc.)"
|
|
17
|
-
"plan"
|
|
16
|
+
"Claude Code permission mode (default, plan, auto, etc.); overrides the configured agent_mode"
|
|
18
17
|
).action(
|
|
19
18
|
async (branch, planPrompt, options) => {
|
|
20
|
-
const { createAgentWorktree } = await import("./agent-
|
|
19
|
+
const { createAgentWorktree } = await import("./agent-D5XFA5Q6.js");
|
|
21
20
|
await createAgentWorktree(branch, planPrompt, { mode: options.mode });
|
|
22
21
|
}
|
|
23
22
|
);
|
|
24
23
|
program.command("prune").description(
|
|
25
24
|
"Remove worktrees whose branch has been merged into the base branch"
|
|
26
25
|
).action(async () => {
|
|
27
|
-
const { runPrune } = await import("./prune-
|
|
26
|
+
const { runPrune } = await import("./prune-YYCUDNI5.js");
|
|
28
27
|
await runPrune();
|
|
29
28
|
});
|
|
30
29
|
program.command("config").description("Open the config file in $EDITOR").option("--path", "Print the config file path and exit").action(async (options) => {
|
|
31
30
|
if (options.path) {
|
|
32
|
-
const { printConfigPath } = await import("./config-
|
|
31
|
+
const { printConfigPath } = await import("./config-QSYG3JDC.js");
|
|
33
32
|
printConfigPath();
|
|
34
33
|
} else {
|
|
35
|
-
const { openConfig } = await import("./config-
|
|
34
|
+
const { openConfig } = await import("./config-QSYG3JDC.js");
|
|
36
35
|
openConfig();
|
|
37
36
|
}
|
|
38
37
|
});
|
|
39
38
|
program.command("skill").description("Print the wt skill file to stdout").action(async () => {
|
|
40
|
-
const { printSkill } = await import("./skill-
|
|
39
|
+
const { printSkill } = await import("./skill-OMSPELIY.js");
|
|
41
40
|
printSkill();
|
|
42
41
|
});
|
|
43
42
|
await program.parseAsync(process.argv);
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
openConfiguredIde,
|
|
5
5
|
prepareWorktree,
|
|
6
6
|
promptExistingWorktree
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-AXP52BNV.js";
|
|
8
|
+
import "./chunk-BY3O2QUG.js";
|
|
9
|
+
import "./chunk-OUWQ6NIV.js";
|
|
10
10
|
export {
|
|
11
11
|
createWorktree,
|
|
12
12
|
openConfiguredIde,
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
runList,
|
|
7
7
|
selectWipeCandidates,
|
|
8
8
|
wipeWorktrees
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-37JQF4PI.js";
|
|
10
|
+
import "./chunk-BY3O2QUG.js";
|
|
11
|
+
import "./chunk-OUWQ6NIV.js";
|
|
12
12
|
export {
|
|
13
13
|
buildMergedPredicate,
|
|
14
14
|
deleteWorktree,
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
prepareListItems,
|
|
4
4
|
wipeWorktrees
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-37JQF4PI.js";
|
|
6
|
+
import "./chunk-BY3O2QUG.js";
|
|
7
7
|
import {
|
|
8
8
|
createStore
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OUWQ6NIV.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/prune.ts
|
|
12
12
|
import pc from "picocolors";
|
|
@@ -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 \u2014 navigate\n- `Enter` \u2014 open worktree in IDE (exits the TUI)\n- `D` \u2014 delete worktree (the main worktree is tagged `(main)` and cannot be deleted \u2014 only linked worktrees can)\n- `P` \u2014 prune all merged worktrees (per-branch confirmation)\n- `C` \u2014 create a new worktree (works in both repo and global mode)\n- `A` \u2014 create a worktree and start an AI agent in it (works in both modes)\n- type to search \xB7 `Backspace` \u2014 edit search\n- `Q` / `Esc` \u2014 quit\n\n`C` and `A` are step-by-step wizards. In global mode (run from outside a repo /\n"home") they start by prompting for the repo (picker), then the branch; in repo\nmode the repo is fixed so they start at the branch. `A` then adds two more\nsteps:\n\n- `C` \u2014 **worktree (repo \u2192 branch)**\n- `A` \u2014 **worktree (repo \u2192 branch) \u2192 plan prompt \u2192 permission mode**\n\nPressing `Esc` at any step goes back to the previous step (your earlier answers\nare preserved); pressing `Esc` on the first step returns to the list.\n\nAfter a create or agent action the TUI **refreshes and stays open** on the list\n(your search and cursor are preserved) rather than exiting \u2014 only `Enter` (open)\nand `Q`/`Esc` exit.\n\nBecause `a`/`A`, `c`/`C`, `d`/`D`, and `p`/`P` are reserved as command keys,\nthose letters can\'t be typed into the search box.\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 `default`;\nchange the default with the `agent_mode` config key):\n\n- `default` \u2014 Standard interactive mode with approval for each action (default)\n- `acceptEdits` \u2014 Allow file changes but keep command execution controlled\n- `plan` \u2014 Architecture-first mode with no surprise mutations\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\nOver SSH it still works, provided the same user has an active graphical login on\nthe Mac: the keystroke is run inside the GUI session via Launch Services\n(`open -a Terminal` briefly flashes a Terminal window). Grant Accessibility to\nTerminal (not Zed) the first time. With no one logged in graphically there is\nnothing to drive, so it falls back to the manual "press the chord in Zed"\nmessage.\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 prune`\n\nRemove every worktree whose branch has already been merged into the base\nbranch (`base_branch`, default `origin/main`). Each candidate is confirmed\nindividually \u2014 and force-confirmed when git refuses (submodules / uncommitted\nchanges), exactly like a manual `d` delete. The branch itself is left intact;\nonly the worktree is removed.\n\n```bash\nwt prune # review and remove merged worktrees, one prompt per branch\n```\n\nMerge detection is patch-id based (via `git cherry`), so a single-commit branch\nthat was **squash-merged** through a PR is still recognized as merged. It also\nbest-effort fetches the remote first so detection sees up-to-date refs; if the\nbase ref can\'t be resolved (e.g. offline), nothing is removed. Works in repo\nmode (current repo) and global mode (all registered repos, each against its own\n`base_branch`). The TUI exposes the same action under the `p` key.\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| `teardown_commands` | `string[]` | `[]` | Commands to run in a worktree just before it is deleted (e.g. `["docker compose down -v"]`); on failure you are prompted whether to delete anyway |\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"` | Base command `wt agent` runs in Zed; `--permission-mode <mode>` is injected (any existing one replaced), then `<plan_prompt>` is appended single-quoted |\n| `agent_mode` | `string` | `"default"` | Default Claude Code permission mode for `wt agent`; the `--mode` flag overrides it. One of `default`, `acceptEdits`, `plan`, `auto`, `dontAsk`, `bypassPermissions` |\n| `agent_trigger_chord` | `string` | `"ctrl-shift-cmd-c"` | Zed keymap chord `wt agent` installs/presses to spawn the agent task |\n| `auto_refresh_minutes`| `number` | `5` | How often the interactive list (`wt`) re-fetches worktrees and updates the "last refreshed" header; `0` disables auto-refresh |\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`, `teardown_commands`, `ide`, `ide_open_args`, `agent_command`, `agent_mode`, `agent_trigger_chord`, `auto_refresh_minutes`) 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-5JFC6Q33.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 \u2014 navigate\n- `Enter` \u2014 open worktree in IDE (exits the TUI)\n- `D` \u2014 delete worktree (the main worktree is tagged `(main)` and cannot be deleted \u2014 only linked worktrees can)\n- `P` \u2014 prune all merged worktrees (per-branch confirmation)\n- `C` \u2014 create a new worktree (works in both repo and global mode)\n- `A` \u2014 create a worktree and start an AI agent in it (works in both modes)\n- type to search \xB7 `Backspace` \u2014 edit search\n- `Q` / `Esc` \u2014 quit\n\n`C` and `A` are step-by-step wizards. In global mode (run from outside a repo /\n"home") they start by prompting for the repo (picker), then the branch; in repo\nmode the repo is fixed so they start at the branch. `A` then adds two more\nsteps:\n\n- `C` \u2014 **worktree (repo \u2192 branch)**\n- `A` \u2014 **worktree (repo \u2192 branch) \u2192 plan prompt \u2192 permission mode**\n\nPressing `Esc` at any step goes back to the previous step (your earlier answers\nare preserved); pressing `Esc` on the first step returns to the list.\n\nAfter a create or agent action the TUI **refreshes and stays open** on the list\n(your search and cursor are preserved) rather than exiting \u2014 only `Enter` (open)\nand `Q`/`Esc` exit.\n\nBecause `a`/`A`, `c`/`C`, `d`/`D`, and `p`/`P` are reserved as command keys,\nthose letters can\'t be typed into the search box.\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\nOver SSH it still works, provided the same user has an active graphical login on\nthe Mac: the keystroke is run inside the GUI session via Launch Services\n(`open -a Terminal` briefly flashes a Terminal window). Grant Accessibility to\nTerminal (not Zed) the first time. With no one logged in graphically there is\nnothing to drive, so it falls back to the manual "press the chord in Zed"\nmessage.\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 prune`\n\nRemove every worktree whose branch has already been merged into the base\nbranch (`base_branch`, default `origin/main`). Each candidate is confirmed\nindividually \u2014 and force-confirmed when git refuses (submodules / uncommitted\nchanges), exactly like a manual `d` delete. The branch itself is left intact;\nonly the worktree is removed.\n\n```bash\nwt prune # review and remove merged worktrees, one prompt per branch\n```\n\nMerge detection is patch-id based (via `git cherry`), so a single-commit branch\nthat was **squash-merged** through a PR is still recognized as merged. It also\nbest-effort fetches the remote first so detection sees up-to-date refs; if the\nbase ref can\'t be resolved (e.g. offline), nothing is removed. Works in repo\nmode (current repo) and global mode (all registered repos, each against its own\n`base_branch`). The TUI exposes the same action under the `p` key.\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| `teardown_commands` | `string[]` | `[]` | Commands to run in a worktree just before it is deleted (e.g. `["docker compose down -v"]`); on failure you are prompted whether to delete anyway |\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| `auto_refresh_minutes`| `number` | `5` | How often the interactive list (`wt`) re-fetches worktrees and updates the "last refreshed" header; `0` disables auto-refresh |\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`, `teardown_commands`, `ide`, `ide_open_args`, `agent_command`, `agent_trigger_chord`, `auto_refresh_minutes`) 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
|
-
};
|