Skip to content

docs(fern): add local library autodocs without Fern auth - #2102

Merged
lbliii merged 4 commits into
mainfrom
lbliii/test-fern-unauth-docs
Jul 7, 2026
Merged

lbliii merged 4 commits into
mainfrom
lbliii/test-fern-unauth-docs

Conversation

@lbliii

@lbliii lbliii commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a no-auth local flow for generating the Python API reference. npm run generate:library:local (or make docs-generate-library-local) runs fern/scripts/generate-library-local.sh, which temporarily injects a path-based nemo-curator-local library entry into docs.yml, runs Fern's docs md generate --local (Docker, no Fern login), and restores docs.yml on exit.

The entry is injected rather than committed because the Fern CLI has two conflicting rules (verified in fern-api/fern source, present in 5.50.4 and latest 5.65.5):

  • fern docs md generate --local requires a path input (git inputs are remote-only and need auth), but
  • fern docs dev / fern generate --docs reject any docs.yml containing a path input library ("'path' input which is not yet supported. Please use 'git' input.") and render a blank page. fern check does not catch this.

CI and publish/preview workflows are pinned to --library nemo-curator so the git-based remote generation path is unchanged. Also bumps the Fern CLI pin to 5.50.4 and documents both flows in fern/README.md, fern/AUTODOCS_GUIDE.md, and the docs agent skill.

Usage

cd fern
npm run generate:library:local   # no Fern auth; requires Docker
npm run generate:library         # full reference via git; needs fern login or FERN_TOKEN

Checklist

  • I am familiar with the Contributing Guide.
  • New or Existing tests cover these changes.
  • The documentation is up to date with these changes.

Made with Cursor

Add a nemo-curator-local path-based library entry for Docker-based
generation via --local, pin CI to the git-based nemo-curator library,
and bump the Fern CLI pin to 5.50.4.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@lbliii
lbliii requested review from a team as code owners June 22, 2026 19:10
@lbliii
lbliii requested review from ayushdg and removed request for a team June 22, 2026 19:10
@copy-pr-bot

copy-pr-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Pin docs-generate-library to the git-based nemo-curator entry and add
docs-generate-library-local for unauthenticated Docker-based generation.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a local, no-auth path for generating the Python API reference using Docker (fern docs md generate --local), working around the Fern CLI's constraint that --local only accepts path-based library inputs while fern docs dev rejects them. A shell script temporarily injects the path entry into docs.yml, runs generation, and restores the file via a trap.

  • CI is unchanged functionally: both preview and publish workflows now explicitly pass --library nemo-curator, ensuring only the git-based remote entry is processed and the nemo-curator-local path entry never appears in the committed docs.yml.
  • New developer workflow: npm run generate:library:local (or make docs-generate-library-local) invokes the script, which uses awk to inject the temporary nemo-curator-local block, runs Fern with Docker, and restores docs.yml on exit.
  • Fern CLI bumped from 5.29.0 to 5.50.4 in fern.config.json; the local script reads this version dynamically, while other package.json scripts still pin to @latest.

Confidence Score: 5/5

Safe to merge — all CI paths use the committed git-based library entry and are unaffected by the new local flow.

The change is confined to documentation, a new developer-only shell script, and adding the --library nemo-curator flag to CI steps. The nemo-curator-local path entry is never committed to docs.yml, so fern generate --docs and fern docs dev in CI see no change. The shell script is well-guarded (set -euo pipefail, pre-flight grep checks, trap-based restore), and the Fern CLI version bump is straightforward.

fern/scripts/generate-library-local.sh — the docs.yml.bak backup file is not gitignored, which could lead to accidental staging after an interrupted run.

Important Files Changed

Filename Overview
fern/scripts/generate-library-local.sh New script that temporarily injects a path-based library entry, runs local Fern generation via Docker, and restores docs.yml via trap; solid guards, but docs.yml.bak is not gitignored
.github/workflows/publish-fern-docs.yml Now pins library generation step to --library nemo-curator, ensuring only the git-based entry is processed; fern generate --docs publish step is unaffected since nemo-curator-local is not committed to docs.yml
.github/workflows/fern-docs-preview-comment.yml Identical --library nemo-curator pin added to library generation step; safe change
fern/docs.yml Only adds a comment block warning against committing path-input library entries; no functional YAML change
fern/fern.config.json Bumps Fern CLI pin from 5.29.0 to 5.50.4; the local generation script reads this version dynamically
fern/package.json Adds generate:library:local script pointing to the new shell script; generate:library gets --library nemo-curator flag
Makefile Adds docs-generate-library-local target delegating to the shell script; docs-generate-library updated with --library flag and clarified description

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Developer] -->|npm run generate:library:local| B[generate-library-local.sh]
    B --> C{docs.yml has nemo-curator-local?}
    C -->|Yes - abort| D[Exit: committed path entry breaks fern docs dev]
    C -->|No| E[cp docs.yml docs.yml.bak / trap to restore on EXIT]
    E --> F[awk injects nemo-curator-local path entry into docs.yml]
    F --> G[npx fern-api@5.50.4 docs md generate --local --library nemo-curator-local]
    G --> H[Docker pulls fernapi/fern-python-library-docs-parser]
    H --> I[MDX written to product-docs/.../Full-Library-Reference]
    I --> J[trap fires: mv docs.yml.bak docs.yml]
    J --> K[docs.yml restored]
    A2[CI: push tag / PR] -->|fern docs md generate --library nemo-curator| L[Fern cloud generation git-based, needs FERN_TOKEN]
    L --> M[MDX written to product-docs/.../Full-Library-Reference]
    M --> N[fern generate --docs publish / preview]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Developer] -->|npm run generate:library:local| B[generate-library-local.sh]
    B --> C{docs.yml has nemo-curator-local?}
    C -->|Yes - abort| D[Exit: committed path entry breaks fern docs dev]
    C -->|No| E[cp docs.yml docs.yml.bak / trap to restore on EXIT]
    E --> F[awk injects nemo-curator-local path entry into docs.yml]
    F --> G[npx fern-api@5.50.4 docs md generate --local --library nemo-curator-local]
    G --> H[Docker pulls fernapi/fern-python-library-docs-parser]
    H --> I[MDX written to product-docs/.../Full-Library-Reference]
    I --> J[trap fires: mv docs.yml.bak docs.yml]
    J --> K[docs.yml restored]
    A2[CI: push tag / PR] -->|fern docs md generate --library nemo-curator| L[Fern cloud generation git-based, needs FERN_TOKEN]
    L --> M[MDX written to product-docs/.../Full-Library-Reference]
    M --> N[fern generate --docs publish / preview]
Loading

Reviews (3): Last reviewed commit: "docs(fern): inject local library entry a..." | Re-trigger Greptile

Comment thread fern/docs.yml Outdated
Comment on lines +186 to +191
nemo-curator-local:
input:
path: ../nemo_curator
output:
path: ./product-docs/nemo-curator/Full-Library-Reference
lang: python

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.

P2 Shared output path produces silently smaller reference on local machines

Both nemo-curator and nemo-curator-local write to the same Full-Library-Reference/ directory. Running generate:library:local after generate:library overwrites the full 424-page set with the beta Docker-parsed subset. A developer iterating locally may not notice the missing pages until they compare output sizes. The docs call this out, but a runtime guard — even just an echo warning — in the Makefile/npm script that the local flow produces fewer pages and overwrites any previous full generation would prevent confusion.

lbliii and others added 2 commits July 7, 2026 14:39
…mmitting it

A committed path-input library entry breaks 'fern docs dev' and
'fern generate --docs': the docs config parser rejects any
'input.path' library ("'path' input which is not yet supported.
Please use 'git' input.") and renders a blank page. Meanwhile
'fern docs md generate --local' only accepts path inputs, so the
entry can't live in docs.yml at all.

Move the nemo-curator-local entry out of docs.yml and into
scripts/generate-library-local.sh, which injects it temporarily,
runs the local generation, and restores docs.yml on exit. The npm
script and Makefile target now call the script; CI flows are
unchanged.

Verified in the fern-api/fern source and npm bundles that the parser
throw exists in 5.50.4 (our pin) and 5.65.5 (latest), and that
'fern check' does not catch it — only 'docs dev'/builds fail.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lbliii

lbliii commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 9e68e26: the committed nemo-curator-local (input.path) entry in docs.yml turned out to break fern docs dev — the docs config parser throws Library '...' uses 'path' input which is not yet supported. Please use 'git' input. and renders a blank page (reproduced by @chtruong814 in Voice-Agent; the throw exists in every fern-api release through latest 5.65.5, and fern check doesn't catch it).

Since docs md generate --local requires a path input while docs dev rejects one, the entry now lives only in fern/scripts/generate-library-local.sh, which injects it into docs.yml, generates, and restores the file on exit. npm run generate:library:local / make docs-generate-library-local are unchanged from the caller's perspective, and fern docs dev keeps working.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@sarahyurick

Copy link
Copy Markdown
Contributor

/ok to test 9e68e26

@lbliii
lbliii enabled auto-merge (squash) July 7, 2026 19:37
@lbliii
lbliii merged commit 95beee1 into main Jul 7, 2026
62 checks passed
tromanski-nv pushed a commit to tromanski-nv/Curator that referenced this pull request Sep 14, 2026
…#2102)

* docs(fern): add local library autodocs generation without Fern auth

Add a nemo-curator-local path-based library entry for Docker-based
generation via --local, pin CI to the git-based nemo-curator library,
and bump the Fern CLI pin to 5.50.4.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(fern): align Makefile library generate targets with dual config

Pin docs-generate-library to the git-based nemo-curator entry and add
docs-generate-library-local for unauthenticated Docker-based generation.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(fern): inject local library entry at generate time instead of committing it

A committed path-input library entry breaks 'fern docs dev' and
'fern generate --docs': the docs config parser rejects any
'input.path' library ("'path' input which is not yet supported.
Please use 'git' input.") and renders a blank page. Meanwhile
'fern docs md generate --local' only accepts path inputs, so the
entry can't live in docs.yml at all.

Move the nemo-curator-local entry out of docs.yml and into
scripts/generate-library-local.sh, which injects it temporarily,
runs the local generation, and restores docs.yml on exit. The npm
script and Makefile target now call the script; CI flows are
unchanged.

Verified in the fern-api/fern source and npm bundles that the parser
throw exists in 5.50.4 (our pin) and 5.65.5 (latest), and that
'fern check' does not catch it — only 'docs dev'/builds fail.

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

This branch was previously deployed

3 inactive deployments
nemo-ci — 9e68e269 Deployed Jul 7, 2026 by copy-pr-bot[bot] via L0_Unit_Test_GPU-serve #4882
public — 9e68e269 Deployed Jul 7, 2026 by copy-pr-bot[bot] via release / finalize / notify #480
test — 9e68e269 Deployed Jul 7, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #4882
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.

3 participants