Documentation

Basic UI

The foundational block containing GeneratedCommand, JsonOutput, and ToolRenderer along with shared types and utilities.

Installation

pnpm dlx shadcn@latest add https://commandly.divyeshio.in/r/ui.json

Included Files

Installing this block copies the following into your project:

FileTarget
generated-command.tsxcomponents/commandly/generated-command.tsx
json-output.tsxcomponents/commandly/json-output.tsx
json-tree.tsxcomponents/commandly/json-tree.tsx
tool-renderer.tsxcomponents/commandly/tool-renderer.tsx
command-tree.tsxcomponents/commandly/command-tree.tsx
installation.tsxcomponents/commandly/installation.tsx
types/tool.tscomponents/commandly/types/tool.ts
types/renderer.tscomponents/commandly/types/renderer.ts
utils/tool.tscomponents/commandly/utils/tool.ts
utils/generate-command.tscomponents/commandly/utils/generate-command.ts
utils/tool-file.tscomponents/commandly/utils/tool-file.ts
utils/diff.tscomponents/commandly/utils/diff.ts
utils/clipboard.tscomponents/commandly/utils/clipboard.ts
utils/json-tree.tscomponents/commandly/utils/json-tree.ts
multi-select.tsxcomponents/ui/multi-select.tsx

Usage

import { GeneratedCommand } from "@/components/commandly/generated-command";
import { JsonOutput } from "@/components/commandly/json-output";
import { ToolRenderer } from "@/components/commandly/tool-renderer";
import type { Tool, Parameter, ParameterValue } from "@/components/commandly/types/tool";
import { Card, CardContent } from "@/components/ui/card";

Using All Three Together

const [values, setValues] = useState<Record<string, ParameterValue>>({})
 
<div className="grid grid-cols-2 gap-4">
  <ToolRenderer
    tool={tool}
    parameterValues={values}
    updateParameterValue={(key, val) =>
      setValues((prev) => ({ ...prev, [key]: val }))
    }
  />
  <div className="flex flex-col gap-4">
    <Card>
      <GeneratedCommand tool={tool} parameterValues={values}>
        <GeneratedCommand.Header>
          <GeneratedCommand.FlagFormPreference />
        </GeneratedCommand.Header>
        <CardContent className="space-y-4">
          <GeneratedCommand.Output />
          <GeneratedCommand.Actions />
        </CardContent>
      </GeneratedCommand>
    </Card>
    <JsonOutput tool={tool} />
  </div>
</div>

Notes

  • All three components share the same Tool type from types/tool.ts
  • The utils/ helpers resolve flag forms and inherited parameters (tool.ts, generate-command.ts) and normalise tool files for output (tool-file.ts)
  • Individual components (generated-command, json-output, tool-renderer) can also be installed separately
  • GeneratedCommand can be used as a composed card layout or as a minimal output-only renderer