Add three tools for managing pull requests via the tea CLI: - tea-pulls: list pull requests filtered by state - tea-pr-get: get PR details with comments - tea-pr-create: create a PR with title, branch, assignees, and labels
14 lines
417 B
TypeScript
14 lines
417 B
TypeScript
import { tool } from "@opencode-ai/plugin"
|
|
import { $ } from "bun"
|
|
|
|
export default tool({
|
|
description: "Get a specific pull request with all details and comments using tea CLI",
|
|
args: {
|
|
pullNumber: tool.schema.number().describe("Pull request number/index"),
|
|
},
|
|
async execute(args) {
|
|
const result = await $`tea pulls ${args.pullNumber} --comments --output json`.text()
|
|
return result.trim()
|
|
},
|
|
})
|