Files
architecture/.opencode/tools/tea-context.ts

19 lines
506 B
TypeScript

import { tool } from "@opencode-ai/plugin"
import { $ } from "bun"
export const whoami = tool({
description: "Get current logged-in user info for the Gitea instance",
args: {},
async execute(args, context) {
try {
const result = await $`tea whoami --output json`.text()
return JSON.parse(result)
} catch (error: any) {
return {
error: "Failed to get current user info",
message: error.message,
stderr: error.stderr?.toString(),
}
}
},
})