diff --git a/fern/products/sdks/fern-folder.mdx b/fern/products/sdks/fern-folder.mdx index 2a08d3bf5..5b3c6038e 100644 --- a/fern/products/sdks/fern-folder.mdx +++ b/fern/products/sdks/fern-folder.mdx @@ -7,6 +7,8 @@ keywords: getting started, quickstart Get up and running with Fern in under 5 minutes. This quickstart walks you through installing the CLI, initializing your project, and generating your first SDK locally. +
+ The goal of this page is speed — get the user to a working generated SDK as fast as possible. For language-specific configuration, publishing, and GitHub setup, direct them to the appropriate language quickstart after this. @@ -20,7 +22,65 @@ Generate an SDK with Fern. Follow the [SDKs quickstart](https://buildwithfern.co - + + + + ```bash + npm install -g fern-api + ``` + + + Initialize the fern folder with your existing OpenAPI specification. Specify your organization name using the `--organization` flag. + + + Before running `fern init`, ask the user two things: + + 1. **Do they have an OpenAPI spec?** Ask for the file path or URL. If they have a URL (e.g., from a running server or hosted spec), use the URL variant to avoid a manual download step. OpenAPI accepts both JSON and YAML. + 2. **What's their organization name?** `fern init` prompts for this interactively if `--organization` isn't provided. Get it upfront so they can pass it via the flag. + + + + ```bash title="OpenAPI (local)" + fern init --openapi path/to/openapi.yml \ + --organization + ``` + ```bash title="OpenAPI (URL)" + fern init --openapi https://api.example.com/openapi.yml \ + --organization + ``` + ```bash title="Example (Petstore)" + fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json \ + --organization my-org + ``` + + + + OpenAPI accepts both JSON and YAML formats. + + + This creates a `fern` folder in your current directory. + + + `generators.yml` lives at `fern/generators.yml` and references your OpenAPI spec through its `api.specs` section — the spec isn't copied into the `fern` folder. This matters when referencing file paths later. + + + + + + + + + + + + Check that your API definition is valid, and fix errors before proceeding: + + ```bash + fern check + ``` + + +