Files
supabase/apps/docs/components/reference/enrichments/cli/CliFlagDefault.tsx
Mike Donnalley 6c8c25b4da fix(docs): show CLI flag defaults in the reference (#53647)
Show default values from the CLI spec on global and command flag rows.
For example, readers can see which format `--output-format` uses when
omitted. Skip empty defaults and omit `Default: false` for opt-in
switches such as `--debug`.

Only render a parameter type when one is supplied. This removes the
contradictory `no type` label beside CLI flags such as `--network-id
<string>` while preserving type labels in the API reference and
self-hosting guides.

This changes the renderer only. The generated CLI spec is published
separately.
2026-11-18 22:19:29 +00:00

19 lines
570 B
TypeScript

type CliFlag = {
name: string
required?: boolean
default_value?: string | number | boolean | null
}
export function CliFlagDefault({ flag }: { flag: CliFlag }) {
const value = flag.default_value
if (value == null || value === '') return null
// Required values use " <value>"; optional values use "[=<value>]" in the CLI spec.
if (!flag.required && String(value) === 'false' && !flag.name.includes(' <')) return null
return (
<p className="text-sm text-foreground-light">
<strong>Default:</strong> <code>{String(value)}</code>
</p>
)
}