Compare commits
3 Commits
28d7622956
...
c3f8f9c611
| Author | SHA1 | Date | |
|---|---|---|---|
|
c3f8f9c611
|
|||
|
5b4ab46471
|
|||
|
75daf31e1b
|
15
.opencode/tools/git-worktree-create.ts
Normal file
15
.opencode/tools/git-worktree-create.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { tool } from "@opencode-ai/plugin"
|
||||||
|
import { $ } from "bun"
|
||||||
|
|
||||||
|
export default tool({
|
||||||
|
description: "Create a git worktree for a branch or PR",
|
||||||
|
args: {
|
||||||
|
branch: tool.schema.string().describe("Branch name or PR number"),
|
||||||
|
directory: tool.schema.string().describe("Worktree directory name (optional)"),
|
||||||
|
},
|
||||||
|
async execute(args) {
|
||||||
|
const worktreeDir = args.directory || args.branch
|
||||||
|
const result = await $`git worktree add ../worktrees/${worktreeDir} ${args.branch}`.text()
|
||||||
|
return result.trim()
|
||||||
|
},
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user