opencode-gitwt 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -11
- package/package.json +3 -3
- package/src/index.js +17 -14
package/README.md
CHANGED
|
@@ -37,17 +37,9 @@ change the session directory. Use `gitwt_list` to inspect copies and
|
|
|
37
37
|
|
|
38
38
|
## Configuration
|
|
39
39
|
|
|
40
|
-
The plugin uses
|
|
41
|
-
and `~/.config/gitwt/config.
|
|
40
|
+
The plugin uses plain JSON: `.gitwt.json` in the project
|
|
41
|
+
and `~/.config/gitwt/config.json` globally. Options include `remote`, `base`,
|
|
42
42
|
`prefix`, `worktreeDir`, and `hooks`. See the core repository for details.
|
|
43
43
|
|
|
44
44
|
For the standalone `gitwt` command, run `npm install -g @voischev/gitwt`.
|
|
45
|
-
|
|
46
|
-
settings from `~/.config/opencode/gitwt.jsonc` to `~/.config/gitwt/config.jsonc`.
|
|
47
|
-
|
|
48
|
-
## Development
|
|
49
|
-
|
|
50
|
-
GitHub is the primary repository; SourceCraft is a mirror. Releases publish to
|
|
51
|
-
npm from GitHub with `NPM_TOKEN`.
|
|
52
|
-
|
|
53
|
-
Run `npm ci --ignore-scripts`, `npm run check`, and `npm test`.
|
|
45
|
+
Move existing settings to these paths and remove comments and trailing commas.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-gitwt",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Git worktree
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Git worktree tools for OpenCode, powered by gitwt",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"release": "node scripts/release.js"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@voischev/gitwt": "^0.1.
|
|
26
|
+
"@voischev/gitwt": "^0.1.4",
|
|
27
27
|
"zod": "4.1.8"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/src/index.js
CHANGED
|
@@ -6,16 +6,16 @@ export async function GitwtPlugin({ directory }, config = {}) {
|
|
|
6
6
|
tool: {
|
|
7
7
|
gitwt_create: {
|
|
8
8
|
description:
|
|
9
|
-
"
|
|
9
|
+
"Create and verify a new worktree. Use worktreePath for commands and files in the current session. Keep the worktree when pausing or handing off a task.",
|
|
10
10
|
args: {
|
|
11
|
-
branch: z.string().describe("
|
|
12
|
-
base: z.string().optional().describe("
|
|
11
|
+
branch: z.string().describe("New branch name"),
|
|
12
|
+
base: z.string().optional().describe("Remote base branch"),
|
|
13
13
|
from: z
|
|
14
14
|
.string()
|
|
15
15
|
.optional()
|
|
16
|
-
.describe("
|
|
17
|
-
path: z.string().optional().describe("
|
|
18
|
-
noHooks: z.boolean().optional().describe("
|
|
16
|
+
.describe("Local ref or verified commit instead of a remote base"),
|
|
17
|
+
path: z.string().optional().describe("Destination path"),
|
|
18
|
+
noHooks: z.boolean().optional().describe("Disable hooks for this worktree"),
|
|
19
19
|
},
|
|
20
20
|
execute: async (args, ctx) =>
|
|
21
21
|
JSON.stringify(
|
|
@@ -28,15 +28,15 @@ export async function GitwtPlugin({ directory }, config = {}) {
|
|
|
28
28
|
},
|
|
29
29
|
gitwt_list: {
|
|
30
30
|
description:
|
|
31
|
-
"
|
|
32
|
-
args: { status: z.boolean().optional() },
|
|
31
|
+
"List Git worktrees. With status, check dirty and available ahead/behind counts; null means unknown.",
|
|
32
|
+
args: { status: z.boolean().optional().describe("Check live worktree status") },
|
|
33
33
|
execute: async (args, ctx) =>
|
|
34
34
|
JSON.stringify(await listWorktrees(ctx.directory ?? directory, args)),
|
|
35
35
|
},
|
|
36
36
|
gitwt_cd: {
|
|
37
37
|
description:
|
|
38
|
-
"
|
|
39
|
-
args: { target: z.string() },
|
|
38
|
+
"Resolve a branch or full path to a worktree with HEAD and status. Use worktreePath explicitly; this does not change the session directory.",
|
|
39
|
+
args: { target: z.string().describe("Exact branch name or full worktree path") },
|
|
40
40
|
execute: async ({ target }, ctx) =>
|
|
41
41
|
JSON.stringify(
|
|
42
42
|
await resolveWorktree(ctx.directory ?? directory, target, { status: true }),
|
|
@@ -44,11 +44,14 @@ export async function GitwtPlugin({ directory }, config = {}) {
|
|
|
44
44
|
},
|
|
45
45
|
gitwt_remove: {
|
|
46
46
|
description:
|
|
47
|
-
"
|
|
47
|
+
"Remove a worktree only when explicitly requested and no longer in use. Force discards local changes but does not bypass a failing preRemove hook.",
|
|
48
48
|
args: {
|
|
49
|
-
target: z.string(),
|
|
50
|
-
force: z.boolean().optional(),
|
|
51
|
-
keepBranch: z
|
|
49
|
+
target: z.string().describe("Exact branch name or full worktree path"),
|
|
50
|
+
force: z.boolean().optional().describe("Allow discarding local changes"),
|
|
51
|
+
keepBranch: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("Keep the branch after removing the worktree"),
|
|
52
55
|
},
|
|
53
56
|
execute: async ({ target, force, keepBranch }, ctx) =>
|
|
54
57
|
JSON.stringify(
|