Migrate from Fern

Migration3 min read||

DocsLit can import documentation from a Fern project. The import command reads your Fern configuration, converts the content, and generates a DocsLit project.

Run the migration

npx docslit import {{FERN_DIR}}

DocsLit detects Fern projects by looking for fern/fern.config.json in the source directory.

Use --dry-run to preview the migration without writing files:

npx docslit import {{FERN_DIR}} --dry-run

What gets converted

  • Markdown content — Copied and cleaned up
  • MDX components — Converted to <wc-*> equivalents
  • Import/export statements — Stripped
  • Sidebar structure — Generated from the Fern navigation config
  • Static assets — Copied to the output directory

After migration

cd {{FERN_DIR}}-docslit npx docslit dev npx docslit validate

Fix any broken links or unknown component tags.

Check the migration report for any pages marked as "needs review". These contain components or syntax that require manual conversion.

Custom output directory

npx docslit import {{FERN_DIR}} --out my-new-docs