Documentation
JSON Output
Displays a tool definition as a collapsible JSON tree with search, copy, and diff functionality.
Structured JSON output for this tool.
root7 keys
$schema:"https://commandly.divyeshio.in/specification/tool.json"
binaryName:"curl"
displayName:"curl"
info:1 key
description:"Transfer data to or from a server"
installation:1 key
sources:[…]4 items
parameters:7 items
0:{ key, displayName, parameterType, … }8 keys
1:{ key, displayName, parameterType, … }8 keys
2:{ key, displayName, parameterType, … }8 keys
3:{ key, displayName, parameterType, … }8 keys
4:{ key, displayName, parameterType, … }8 keys
5:{ key, displayName, parameterType, … }8 keys
6:{ key, displayName, parameterType, … }8 keys
commands:1 item
0:{ key, displayName, description, … }5 keys
rootobject, 7 keysInstallation
pnpm dlx shadcn@latest add https://commandly.divyeshio.in/r/json-output.jsonUsage
import { JsonOutput } from "@/components/commandly/json-output";Basic Usage
const tool: Tool = {
binaryName: "curl",
displayName: "curl",
parameters: [
{
key: "--url",
displayName: "URL",
parameterType: "Option",
dataType: "String",
isRequired: true,
},
],
commands: [],
};
<JsonOutput tool={tool} />;API Reference
JsonOutput
| Prop | Type | Default | Description |
|---|---|---|---|
tool | Tool | - | The tool definition to serialize as JSON |
Notes
- Parameters are nested under the command that accepts them, matching the tool definition
- Branches unfold one row at a time and long arrays and objects load in pages
- The tree follows the WAI-ARIA tree pattern: arrow keys move and open, Home and End jump, Enter toggles, and the modifier key with C copies the focused value
- Search highlights every match and opens the branches that hold them
- Each row copies its own value or path from the row actions, and the path of the current row is shown under the tree
- The copy button in the header copies the whole JSON string to the clipboard
- Passing
originalTooladds a diff view of the two serialized tools, andonApplyadds an editor for the raw JSON