feat: add tea-label.ts tool for label management (labelList)
This commit is contained in:
19
.opencode/tools/tea-label.ts
Normal file
19
.opencode/tools/tea-label.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { tool } from "@opencode-ai/plugin"
|
||||||
|
import { $ } from "bun"
|
||||||
|
|
||||||
|
export const labelList = tool({
|
||||||
|
description: "List available labels with their colors and descriptions",
|
||||||
|
args: {},
|
||||||
|
async execute(args, context) {
|
||||||
|
try {
|
||||||
|
const result = await $`tea label list --output json`.text()
|
||||||
|
return JSON.parse(result)
|
||||||
|
} catch (error: any) {
|
||||||
|
return {
|
||||||
|
error: "Failed to list labels",
|
||||||
|
message: error.message,
|
||||||
|
stderr: error.stderr?.toString(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user