Tool Renderer
commandly/tool-rendererFreeComponent
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.jsonSource
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";2627const 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;3233 return tool.commands.length > 0 ? tool.commands[0] : null;34};3536interface 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}4647function 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 <Badge79 variant="outline"80 className="ml-2 text-xs"81 >82 global83 </Badge>84 )}85 </Label>86 );87}8889// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from commandly
All 4 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Generated Commandgenerated-command | commandly | Components | Free | 3 deps · 5 files | |
| JSON Outputjson-output | commandly | Components | Free | 1 dep · 5 files |
