BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/commandly/tool-renderer

Tool Renderer

commandly/tool-renderer
FreeComponent

A component that provides real-time preview of CLI command execution and output.

Live preview

live · rendered by the registry
Rendered by commandly on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://commandly.divyeshio.in/r/tool-renderer.json

Source

registry/commandly/tool-renderer.tsxcommandly.divyeshio.in/r/tool-renderer.json · first 6 KB
1import { ParameterValue } from "@/components/commandly/types/flat";
2import { Command, Tool } from "@/components/commandly/types/flat";
3import {
4 ParameterRenderContext,
5 ParameterRendererEntry,
6} from "@/components/commandly/types/renderer";
7import { Badge } from "@/components/ui/badge";
8import { Button } from "@/components/ui/button";
9import {
10 Command as UICommand,
11 CommandEmpty,
12 CommandGroup,
13 CommandInput,
14 CommandItem,
15 CommandList,
16} from "@/components/ui/command";
17import { Input } from "@/components/ui/input";
18import { Label } from "@/components/ui/label";
19import { MultiSelect } from "@/components/ui/multi-select";
20import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
21import { Switch } from "@/components/ui/switch";
22import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
23import { cn } from "@/lib/utils";
24import { CheckIcon, ChevronsUpDownIcon, InfoIcon, PlusIcon, XIcon } from "lucide-react";
25import React, { useMemo } from "react";
26
27const findDefaultCommand = (tool: Tool): Command | null => {
28 const nameMatchCommand = tool.commands.find(
29 (command) => command.name.toLowerCase() === tool.binaryName.toLowerCase(),
30 );
31 if (nameMatchCommand) return nameMatchCommand;
32
33 return tool.commands.length > 0 ? tool.commands[0] : null;
34};
35
36interface ParameterLabelProps {
37 name: string;
38 longFlag?: string;
39 shortFlag?: string;
40 isRequired?: boolean;
41 isGlobal?: boolean;
42 description?: string;
43 className?: string;
44 children?: React.ReactNode;
45}
46
47function ParameterLabel({
48 name,
49 longFlag,
50 shortFlag,
51 isRequired,
52 isGlobal,
53 description,
54 className,
55 children,
56}: ParameterLabelProps) {
57 return (
58 <Label className={className}>
59 {name}
60 {(longFlag || shortFlag) && (
61 <span className="ml-1 text-muted-foreground">
62 ({[longFlag, shortFlag].filter(Boolean).join(", ")})
63 </span>
64 )}
65 {isRequired && <span className="ml-1 text-destructive">*</span>}
66 {description?.trim() && (
67 <Tooltip>
68 <TooltipTrigger>
69 <InfoIcon className="h-3.5 w-3.5" />
70 </TooltipTrigger>
71 <TooltipContent>
72 <span>{description}</span>
73 </TooltipContent>
74 </Tooltip>
75 )}
76 {children}
77 {isGlobal && (
78 <Badge
79 variant="outline"
80 className="ml-2 text-xs"
81 >
82 global
83 </Badge>
84 )}
85 </Label>
86 );
87}
88
89// … truncated

What it pulls in

npm packages

  • react

Other registry items

  • button
  • scroll-area
  • tabs

Files it writes

  • registry/commandly/tool-renderer.tsx
  • registry/commandly/types/renderer.ts
  • registry/commandly/types/flat.ts
  • registry/commandly/types/nested.ts

Facts

Registry
commandly
Type
registry:component
Access
Free
Files written
4
Licence
MIT
First indexed
2026-08-01
Last confirmed
2 days ago

Go to the source

Docs on commandly commandly.divyeshio.in divyeshio/commandly on GitHub Raw registry item This item as JSON

More from commandly

All 4 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Generated Commandgenerated-commandcommandlyComponentsFree3 deps · 5 files
JSON Outputjson-outputcommandlyComponentsFree1 dep · 5 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex