Utility
AI
Terminal
Installation
pnpm dlx shadcn@latest add https://termcn.dev/r/tool-approval.json
Usage
import { ToolApproval } from "@/components/ui/tool-approval";<ToolApproval
name="execute_shell"
description="Run a shell command on the host machine"
args={{ command: "rm -rf ./dist" }}
risk="high"
onApprove={() => console.log("approved")}
onDeny={() => console.log("denied")}
timeout={30}
/>API Reference
ToolApproval
| Prop | Type | Default |
|---|---|---|
name | string | required |
description | string | undefined |
args | Record<string, unknown> | undefined |
risk | "low" | "medium" | "high" | "low" |
onApprove | () => void | required |
onDeny | () => void | required |
onAlwaysAllow | () => void | undefined |
timeout | number | undefined |