Skip to content

docs(cli-generator): document the --schema flag - #6660

Open
fern-api[bot] wants to merge 2 commits into
mainfrom
fern/document-schema-flag
Open

docs(cli-generator): document the --schema flag #6660
fern-api[bot] wants to merge 2 commits into
mainfrom
fern/document-schema-flag

Conversation

@fern-api

@fern-api fern-api Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Every generated Fern CLI has a --schema flag that prints its whole command surface as JSON, so an agent (or a human) can learn what commands and flags exist without parsing --help prose. This PR documents that flag, including the newly added per-property flag field: each property in an operation's input now states the exact flag to pass. That matters because the flag often isn't the property's name from the spec — headers are kebab-cased, a spec name that collides with a global flag such as --query gets a -param suffix, and x-fern-parameter-name can rename it. With flag in the contract, a valid invocation can be built straight from --schema instead of re-deriving the CLI's naming rules.

Implements docs for:

Pages changed:

  • fern/products/cli-generator/schema.mdx — new page covering the three scopes (<bin> --schema, <bin> <resource> --schema, <bin> <resource> <method> --schema), the root object (globalFlags, sdkVariables, operations), the per-operation contract (input, output, defaultSelection, paginable, binaryResponse, streaming), property metadata, and jq recipes. Property metadata leads with flag, explains the three reasons it differs from the property key, notes that multipart/form-data fields carry it too, and that a property with no flag is reachable only through --params / --json.
  • fern/products/cli-generator/features.mdx — links to the new page, and the flag-name guidance now covers both directions: --help shows the spec name as (api: <name>), --schema keys by that name and gives the flag in flag.
  • fern/products/cli-generator/overview.mdx — "Runtime introspection" card links to the page.
  • fern/products/cli-generator/cli-generator.yml — navigation entry.

Content verified against the generator implementation (resolve_param_flag_name / resolve_multipart_field_flag_name in generators/cli/sdk/src/openapi/) and real output from a generated CLI.

Link to Devin session: https://app.devin.ai/sessions/f3f5bc50b2b648d5b47ba5a67fc3d665
Open in Devin Desktop: https://app.devin.ai/desktop/session/f3f5bc50b2b648d5b47ba5a67fc3d665?variant=devin

@fern-api
fern-api Bot requested a review from devalog as a code owner August 17, 2026 18:10
@fern-api

fern-api Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Requested by: will.kendall
Slack thread: View conversation

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants