// @ts-expect-error import { IconChevronRight } from '~/../../packages/ui' import spec from '~/../../spec/cli_v1_commands.yaml' assert { type: 'yml' } import CodeBlock from '~/components/CodeBlock/CodeBlock' import Options from '~/components/Options' import Param from '~/components/Params' import RefSubLayout from '~/layouts/ref/RefSubLayout' interface ICommonFunc { id: string title: string slug: string product: string libs: string items: ICommonFunc[] } interface IRefFunctionSection { funcData: any commonFuncData: ICommonFunc spec: any } export type Flag = { id: string name: string description: string default_value: string accepted_values: AcceptedValue[] } export type AcceptedValue = { id: string name: string type: 'string' | 'boolean' | 'object' description?: string } export type Command = { id: string title: string description: string flags?: Flag[] summary: string tags?: [] links?: [] subcommands?: [] usage?: string } const CliCommandSection = (props) => { const command = spec.commands.find((x: any) => x.id === props.funcData.id) return (

{command.summary}

{/* {command.usage && ( {command.usage} )} */} {command.subcommands.length > 0 && (

Available Commands

)} {command.flags.length > 0 && ( <>

Flags

    {command.flags.map((flag: Flag) => ( <>
  • {flag?.accepted_values && ( {flag?.accepted_values.map((value) => { return })} )}
  • ))}
)}
{command.usage && ( {command.usage} )}
) } export default CliCommandSection