Add tea_issue_create tool for creating GitHub issues
This commit is contained in:
20
.opencode/tools/tea-issue-create.ts
Normal file
20
.opencode/tools/tea-issue-create.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { tool } from "@opencode-ai/plugin"
|
||||
import { exec } from "child_process"
|
||||
import { promisify } from "util"
|
||||
|
||||
const execAsync = promisify(exec)
|
||||
|
||||
export default tool({
|
||||
description: "Create a new issue in the GitHub repository using tea CLI",
|
||||
args: {
|
||||
title: tool.schema.string().describe("Issue title"),
|
||||
description: tool.schema.string().optional().describe("Issue description (supports markdown)"),
|
||||
labels: tool.schema.string().optional().describe("Comma-separated list of labels"),
|
||||
milestone: tool.schema.string().optional().describe("Milestone name"),
|
||||
},
|
||||
async execute(args) {
|
||||
const cmd = `tea issues create -t "${args.title}"`
|
||||
const { stdout, stderr } = await execAsync(cmd)
|
||||
return stdout.trim()
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user