For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog inStart for free
  • Overview
    • Introduction
    • How it works
    • Quickstart
    • Customer showcase
  • Working with SDKs
    • Project structure
    • Adding custom code
    • Migrating to Replay
    • Capabilities
  • Generators
      • Local SDK previews
      • Testing
  • Reference
    • generators.yml
Checking status...
SOC2Soc 2 Type II
© 2026 Fern • Birch Solutions, Inc., a Postman company

Documentation

SDKsDocsAsk FernCLI Reference

API Definitions

OpenAPIAsyncAPIOpenRPCgRPC

Resources

BlogSupportPricing

Company

Brand KitPrivacy PolicyTerms of Service
LogoLogo
Book a demoLog inStart for free
On this page
  • Example usage
Preview & testing

Set up local SDK previews

||View as Markdown|
Was this page helpful?
Edit this page
Previous

Retries with backoff

Next

Testing

Once you configure your SDK, you can use the --preview flag to test generated SDK code locally before publishing. This allows quick iteration on your SDK as you develop:

$# Preview all SDKs
$fern generate --preview
$
$# Preview SDK for a specific language
$fern generate --group <language>-sdk --preview

--preview generates your SDK code into a local .preview/ folder within your fern folder. No changes are published to package managers or GitHub.

--preview preserves any custom code you added to your SDK.

Example usage

Here’s an example of how you can preview a Python SDK.

1

Generator configuration

generators.yml
1api:
2 path: ./path/to/openapi.yml
3groups:
4 python-sdk:
5 generators:
6 - name: fernapi/fern-python-sdk
7 version: 5.10.0
8 output:
9 location: pypi
10 package-name: imdb
11 token: ${PYPI_TOKEN}
12 github:
13 repository: imdb/imdb-python
14 config:
15 client_class_name: imdb
2

Invoke the Fern CLI

$fern generate --group python-sdk --preview
3

Preview your SDK

The resulting folder structure will look like this:

fern
fern.config.json
.preview
fern-python-sdk
...
generators.yml
openapi
openapi.yml