docs(cli-generator): document the --schema flag - #6660
Open
fern-api[bot] wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Requested by: will.kendall |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
🌿 Preview your docs: https://fern-preview-fern-document-schema-flag.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every generated Fern CLI has a
--schemaflag that prints its whole command surface as JSON, so an agent (or a human) can learn what commands and flags exist without parsing--helpprose. This PR documents that flag, including the newly added per-propertyflagfield: each property in an operation'sinputnow 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--querygets a-paramsuffix, andx-fern-parameter-namecan rename it. Withflagin the contract, a valid invocation can be built straight from--schemainstead 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, andjqrecipes. Property metadata leads withflag, explains the three reasons it differs from the property key, notes thatmultipart/form-datafields carry it too, and that a property with noflagis 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:--helpshows the spec name as(api: <name>),--schemakeys by that name and gives the flag inflag.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_nameingenerators/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