Preview your SDK

Use Fern's CLI tool to preview your SDK locally.

Once you configure your SDK, you can preview the generated SDK code using Fern’s CLI.

Simply append the --preview flag to the command used to generate the SDK and you will see the generated code populated in a .preview folder within your fern folder.

Custom Code

If you have added custom code to your SDK, --preview will preserve those changes.

Here’s an example of how you can preview your 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: 3.0.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