diff --git a/.opencode/tools/git-worktree-create.ts b/.opencode/tools/git-worktree-create.ts new file mode 100644 index 0000000..a566539 --- /dev/null +++ b/.opencode/tools/git-worktree-create.ts @@ -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() + }, +}) \ No newline at end of file