Skip to content

feat(cli): make fern docs md generate local-only - #17515

Open
Ryan-Amirthan wants to merge 1 commit into
mainfrom
devin/1787616073-local-only-library-docs
Open

feat(cli): make fern docs md generate local-only#17515
Ryan-Amirthan wants to merge 1 commit into
mainfrom
devin/1787616073-local-only-library-docs

Conversation

@Ryan-Amirthan

@Ryan-Amirthan Ryan-Amirthan commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

Removes remote (server-side) library documentation generation from the CLI. fern docs md generate now always runs the library parser Docker images locally — no authentication, no FDR requests.

Compatibility decision for --local: the flag is kept as an accepted no-op so existing invocations (fern docs md generate --local) keep working, but it is hidden: true, default: true, and marked deprecated in yargs, so it no longer appears in --help and its value is ignored:

.option("local", {
    boolean: true,
    default: true,
    hidden: true,
    deprecated: "Library docs generation always runs locally using Docker; --local is no longer needed."
})

docs.yml inputs are unchanged: path inputs resolve relative to the docs directory, and git inputs (including ref/subpath from #17510) are cloned locally via cloneRepositoryAtRef/resolveRepositorySubpath.

Changes Made

  • library-docs-generator/orchestrate.ts: deleted the remote pipeline (LibraryDocsClient, createLibraryDocsClient, generateIrRemotely, startGeneration, pollForCompletion, downloadIr, poll constants) and the orgId/tokenValue/local options; runLibraryDocsGeneration({ libraries, library?, docsDirectoryPath, context, wrapStep? }) is now local-only
  • cli (v1): generateLibraryDocs no longer prompts for login or threads a token; the command routes straight to local orchestration; --local deprecated as above
  • cli-v2: docs md generate no longer calls getTokenOrPrompt()/verifyOrgAccess()
  • configuration: updated the ParsedLibraryInputConfiguration doc comment to local-only semantics
  • Changelog entry in packages/cli/cli/changes/unreleased/
  • Updated README.md generator (not applicable)

Testing

  • Unit tests added/updated
    • orchestrate.test.ts rewritten local-only: default invocation (no local flag) runs runLocalParser, git ref/subpath are forwarded (packagePath/sourceUrl/branch), and a rejecting globalThis.fetch spy proves no network request is made
    • localGeneration.test.ts (end-to-end to disk) now calls the orchestrator without local: true
    • v1/v2 wrapper tests assert delegation happens with no tokenValue/orgId and that v2 never calls getTokenOrPrompt/verifyOrgAccess
  • Manual testing completed
    • pnpm turbo run compile/test/depcheck for @fern-api/cli, @fern-api/cli-v2, @fern-api/library-docs-generator — all green
    • pnpm lint:biome --fix, pnpm format:fix, pnpm check:fix clean

Link to Devin session: https://app.devin.ai/sessions/ecb844f08d7249be8ff1527fad00acd9
Requested by: @Ryan-Amirthan


Open in Devin Review

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

Copy link
Copy Markdown
Contributor

🤖 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, CI, and merge conflict monitoring

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

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-actions

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-24T04:15:25Z).

Fixture main PR Delta
docs 270.7s (n=5) 273.8s (35 versions) +3.1s (+1.1%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-08-24T04:15:25Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-25 00:47 UTC

@github-actions

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-24T04:15:25Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 75s (n=5) 113s (n=5) 90s +15s (+20.0%)
go-sdk square 137s (n=5) 298s (n=5) 144s +7s (+5.1%)
java-sdk square 239s (n=5) 285s (n=5) 227s -12s (-5.0%)
php-sdk square 64s (n=5) N/A 56s -8s (-12.5%)
python-sdk square 152s (n=5) 252s (n=5) 114s -38s (-25.0%)
ruby-sdk-v2 square 95s (n=5) 125s (n=5) 105s +10s (+10.5%)
rust-sdk square 228s (n=5) 215s (n=5) 192s -36s (-15.8%)
swift-sdk square 60s (n=5) 450s (n=5) 76s +16s (+26.7%)
ts-sdk square 138s (n=5) 150s (n=5) 135s -3s (-2.2%)

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-08-24T04:15:25Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-25 00:48 UTC

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.

1 participant