Files
architecture/.opencode/tools/git-worktree-create.ts

13 lines
371 B
TypeScript

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"),
},
async execute(args) {
const result = await $`git worktree add ../worktrees/${args.branch}`.text()
return result.trim()
},
})