Skip to content

docs(cli-generator): add hidden self-service pages for fernapi/fern-cli#5610

Closed
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1779482846-cli-generator-hidden-pages
Closed

docs(cli-generator): add hidden self-service pages for fernapi/fern-cli#5610
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1779482846-cli-generator-hidden-pages

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented May 22, 2026

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/):

  • Quickstart — 5-step end-to-end setup guide with a directory layout diagram and prominent callout for the local-file-system path-resolution gotcha
  • Configuration reference — all generators.yml config: block options (binaryName), output locations, and multi-spec workspace setup
  • GraphQL support — quickstart for generating a CLI from a GraphQL introspection schema, command tree structure
  • Distribution — debug/release builds, TLS backend selection (native-tls vs rustls), cargo-dist setup, publishing channels (GitHub Releases, npm, Homebrew)
  • Troubleshooting — seven common first-time issues with solutions (wrong output dir, missing auth, OpenSSL errors, old CLI version, committed /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)
  • Regeneration clobbering behavior — not documented (out of scope for this PR, flagged for follow-up)

Resolves FER-10757

Review & Testing Checklist for Human

  • Verify all five new pages render correctly in the preview deploy (navigation should NOT show them in the sidebar when browsing other pages)
  • Visit one hidden page directly and confirm the other four appear in the sidebar for navigation
  • Check cross-links between new pages and existing pages (Authentication, Features, Customization) resolve correctly
  • Review the path-resolution callout in the Quickstart for accuracy against actual fern generate behavior
  • Verify the GraphQL command tree example matches actual generated CLI output

Notes

  • All content is based on the generator source code at fern-api/fern/generators/cli/ and the CLI SDK at fern-api/cli-sdk. No information was fabricated.
  • The ticket asks for Niels to be requested as reviewer on the PR.
  • Pages use availability: beta frontmatter consistent with existing CLI Generator pages.

Link to Devin session: https://app.devin.ai/sessions/f837d4fee3304207a5d5bb390d983b38

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-integration devin-ai-integration Bot requested a review from devalog as a code owner May 22, 2026 20:50
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring


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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Headings] 'cargo-dist' should use sentence-style capitalization.


## Publishing channels

### GitHub Releases
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [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).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'they're' instead of 'they are'.

@devin-ai-integration devin-ai-integration Bot requested a review from Swimburger May 22, 2026 20:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

- 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)
@jsklan jsklan self-requested a review May 22, 2026 21:19
Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +74 to +108
## 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>
Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread fern/products/cli-generator/distribution.mdx Outdated
Comment thread fern/products/cli-generator/troubleshooting.mdx Outdated
- 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
devin-ai-integration[bot]

This comment was marked as resolved.

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.
Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 9 additional findings in Devin Review.

Open in Devin Review

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.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Suggested change
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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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