docs(cli-generator): add hidden self-service pages for fernapi/fern-cli#5610
docs(cli-generator): add hidden self-service pages for fernapi/fern-cli#5610devin-ai-integration[bot] wants to merge 6 commits into
Conversation
Add five hidden pages under learn/cli-generator/ covering the end-to-end 'new user to working CLI' flow: - Quickstart: 5-step setup guide with path-resolution callout - Configuration reference: generators.yml config block documentation - GraphQL support: quickstart for GraphQL introspection schemas - Distribution: building, TLS backends, cargo-dist, publishing - Troubleshooting: common first-time issues and solutions All pages are hidden (reachable by direct URL, absent from nav sidebar). Existing pages from PR #5472 (Features, Authentication, OpenAPI extensions, Customization) are not duplicated — cross-linked where appropriate. FER-10757
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
||
| When omitted, the generator derives the name from the API's display name (kebab-cased). Multi-spec workspaces must set this field explicitly. | ||
|
|
||
| Choose this value carefully: changing it later breaks shell scripts that reference environment variables or the binary path. |
There was a problem hiding this comment.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Adverbs] Remove 'carefully' if it's not important to the meaning of the statement.
|
|
||
| Use `rustls` when: | ||
| - Targeting musl-based Linux (Alpine, scratch Docker images) | ||
| - Cross-compiling for ARM or other architectures |
There was a problem hiding this comment.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'ARM' has no definition.
| - Distributing to environments where system OpenSSL is unavailable or outdated | ||
|
|
||
| <Note> | ||
| The `rustls` backend does not read the OS certificate store. Users who need custom CA certificates must set the `<NAME>_CA_BUNDLE` environment variable. See [Features](/learn/cli-generator/get-started/features#tls-proxies-and-ca-bundles) for details. |
There was a problem hiding this comment.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'doesn't' instead of 'does not'.
| The `rustls` backend does not read the OS certificate store. Users who need custom CA certificates must set the `<NAME>_CA_BUNDLE` environment variable. See [Features](/learn/cli-generator/get-started/features#tls-proxies-and-ca-bundles) for details. | ||
| </Note> | ||
|
|
||
| ## cargo-dist |
There was a problem hiding this comment.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Headings] 'cargo-dist' should use sentence-style capitalization.
|
|
||
| ## Publishing channels | ||
|
|
||
| ### GitHub Releases |
There was a problem hiding this comment.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Headings] 'GitHub Releases' should use sentence-style capitalization.
| fern upgrade | ||
| ``` | ||
|
|
||
| This updates to the latest CLI version. Verify with `fern --version` (v5.37.9 or later required). |
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'latest' that become outdated
|
|
||
| This updates to the latest CLI version. Verify with `fern --version` (v5.37.9 or later required). | ||
|
|
||
| ## `/target/` directory accidentally committed |
There was a problem hiding this comment.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Adverbs] Remove 'accidentally' if it's not important to the meaning of the statement.
|
|
||
| ## `/target/` directory accidentally committed | ||
|
|
||
| The generator does not ship a `.gitignore` in the output. After the first build, add one: |
There was a problem hiding this comment.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'doesn't' instead of 'does not'.
|
|
||
| ## `generators.yml` vs `generators.yaml` | ||
|
|
||
| Fern expects `generators.yml` (not `.yaml`). If the CLI cannot find your configuration, check the file extension. |
There was a problem hiding this comment.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'can't' instead of 'cannot'.
|
|
||
| 1. **Rust toolchain version**: The generated project requires a stable Rust toolchain. Run `rustup update stable`. | ||
| 2. **Stale `Cargo.lock`**: If you previously generated with a different generator version, delete `Cargo.lock` and rebuild: `cargo build`. | ||
| 3. **Feature flag mismatch**: If you added features to `Cargo.toml` manually, verify they are compatible with the current template version. |
There was a problem hiding this comment.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'they're' instead of 'they are'.
|
🌿 Preview your docs: https://fern-preview-devin-1779482846-cli-generator-hidden-pages.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
- Use contractions (doesn't, can't, they're) per Microsoft style - Sentence-style heading capitalization - Remove adverbs (carefully, accidentally) - Avoid undefined acronyms (ARM → aarch64) - Avoid time-relative terms (latest)
| ## Multi-spec workspaces | ||
|
|
||
| A single CLI can combine multiple OpenAPI specs into one command tree. Each spec can optionally be placed under a namespace: | ||
|
|
||
| ```yaml title="fern/generators.yml" | ||
| api: | ||
| specs: | ||
| - openapi: core.yml | ||
| - openapi: billing.yml | ||
| namespace: billing | ||
| default-group: cli | ||
| groups: | ||
| cli: | ||
| generators: | ||
| - name: fernapi/fern-cli | ||
| version: 0.5.0 | ||
| output: | ||
| location: local-file-system | ||
| path: ../../my-cli | ||
| config: | ||
| binaryName: my-cli | ||
| ``` | ||
|
|
||
| Specs without a `namespace` merge flat at the top level of the command tree. Specs with a `namespace` appear under a subcommand: | ||
|
|
||
| ```bash | ||
| my-cli users list # from core.yml | ||
| my-cli billing invoices list # from billing.yml | ||
| ``` | ||
|
|
||
| When a namespace matches a top-level resource in the incoming spec, the CLI hoists that resource's methods to avoid repetition (`billing billing invoices list` becomes `billing invoices list`). | ||
|
|
||
| <Note> | ||
| `binaryName` is required for multi-spec workspaces — there is no automatic derivation when multiple specs are present. | ||
| </Note> |
There was a problem hiding this comment.
🔴 Multi-spec workspaces content duplicated across configuration.mdx and existing customization.mdx
The new configuration.mdx (lines 74–108) restates the multi-spec workspaces concept — introductory sentence, bash examples, and namespace-collision hoisting behavior — that already exists in fern/products/cli-generator/customization.mdx:35-55. Per AGENTS.md rules: "Before creating new content, search the repo for existing pages that already cover the topic. Prefer updating over duplicating" and "One page owns the full explanation; every other page that touches the topic links to it rather than restating it." One page should be canonical for multi-spec workspaces and the other should link to it with a brief sentence.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Fixed in 7bc923e — removed the duplicated behavioral description (bash examples, hoisting behavior) from configuration.mdx. The config page now keeps the generators.yml YAML example and links to the Customization page for namespace interaction details and Rust-level behavior.
- Move hidden pages into a 'Self-service guides' hidden section so navigating to one page shows the others in the sidebar - Fix 'See [page]' link phrasing: embed links on natural noun phrases instead of standalone 'See X for details' sentences (AGENTS.md) - Remove multi-spec behavioral duplication between configuration.mdx and customization.mdx: keep config YAML in configuration.mdx, link to customization.mdx for Rust-level namespace behavior - Update cross-links for new /guides/ URL segment
Hidden sections remove the entire group from navigation, so sibling pages aren't visible in the sidebar. Instead, each hidden page now includes a shared CardGroup snippet linking to all five self-service guides, letting users navigate between them from any page. Reverts the hidden-section approach back to individually hidden pages under 'Get started' with a shared Markdown snippet for the nav cards.
Replace custom 'output: location: github' with standard Fern generator github config (github: repository: + mode:) and link to generators.yml reference for mode details.
| mode: pull-request | ||
| ``` | ||
|
|
||
| Fern pushes the generated CLI source to the specified GitHub repository. When your spec changes, Fern opens a PR against your CLI repo with the updated source. The `mode` field supports `pull-request`, `release`, and `push` — the [generators.yml reference](/learn/sdks/reference/generators-yml-reference#github) covers each mode in detail. |
There was a problem hiding this comment.
🔴 Incorrect page slug in internal link: generators-yml-reference should be generators-yml
The link /learn/sdks/reference/generators-yml-reference#github uses the file name (generators-yml-reference) instead of the configured page slug. In fern/products/sdks/sdks.yml:276, the page has slug: generators-yml. Per the AGENTS.md link checking rules, URLs must be built from the YAML config slugs, not file paths. The correct URL path segment is generators-yml. Additionally, the #github anchor targets an #### heading (fern/products/sdks/reference/generators-yml-reference.mdx:836), but per AGENTS.md rules, internal anchors only resolve for ## / ### headings, so the anchor won't work either.
| Fern pushes the generated CLI source to the specified GitHub repository. When your spec changes, Fern opens a PR against your CLI repo with the updated source. The `mode` field supports `pull-request`, `release`, and `push` — the [generators.yml reference](/learn/sdks/reference/generators-yml-reference#github) covers each mode in detail. | |
| Fern pushes the generated CLI source to the specified GitHub repository. When your spec changes, Fern opens a PR against your CLI repo with the updated source. The `mode` field supports `pull-request`, `release`, and `push` — the [generators.yml reference](/learn/sdks/reference/generators-yml) covers each mode in detail. | |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Adds five hidden documentation pages under the CLI Generator product for early-access users of
fernapi/fern-cli. Pages are grouped in a hidden "Self-service guides" section: invisible in the sidebar for normal browsing, but when a user visits any page via direct URL, the full group is visible for navigation between them.PR #5472 status: Merged and live. This PR does not duplicate any of its content (Features, Authentication, OpenAPI extensions, Customization). Cross-links to those pages are used where appropriate.
New pages (under
/learn/cli-generator/guides/):local-file-systempath-resolution gotchagenerators.ymlconfig:block options (binaryName), output locations, and multi-spec workspace setupnative-tlsvsrustls), cargo-dist setup, publishing channels (GitHub Releases, npm, Homebrew)/target/, etc.)Open questions from the ticket that could not be resolved without Niels:
namespace:behavior (one binary per namespace, or one binary with subcommands per namespace?) — documented based on source code analysis (subcommands)Resolves FER-10757
Review & Testing Checklist for Human
fern generatebehaviorNotes
fern-api/fern/generators/cli/and the CLI SDK atfern-api/cli-sdk. No information was fabricated.availability: betafrontmatter consistent with existing CLI Generator pages.Link to Devin session: https://app.devin.ai/sessions/f837d4fee3304207a5d5bb390d983b38