Skip to content

Commit f87f663

Browse files
committed
simplify top level sdk quickstart
1 parent 2774f8d commit f87f663

File tree

5 files changed

+71
-107
lines changed

5 files changed

+71
-107
lines changed

fern/products/sdks/fern-folder.mdx

Lines changed: 71 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,85 @@
11
---
22
title: Quickstart
3-
subtitle: Set up the fern folder
43
---
54

65
Configuring Fern starts with the `fern` folder, the root directory that contains
7-
your API definitions, generators, and your CLI version.
8-
9-
## Set up the fern folder
6+
your API definitions, SDK generators, and CLI version.
107

118
<Steps>
9+
<Step title="Install the Fern CLI">
1210

13-
<Markdown src="/products/sdks/snippets/install-cli.mdx"/>
14-
15-
### Initialize the Fern Folder
16-
17-
<Markdown src="/products/sdks/snippets/initialize-fern-folder-intro.mdx"/>
11+
```bash
12+
npm install -g fern-api
13+
```
14+
</Step>
15+
<Step title="Initialize the fern folder">
16+
Initialize the fern folder with your existing OpenAPI specification, or start from scratch with a Fern Definition template. Specify your organization name using the `--organization` flag.
1817

19-
<AccordionGroup>
20-
<Markdown src="/products/sdks/snippets/option-1-openapi.mdx"/>
18+
```bash
19+
# OpenAPI (local)
20+
fern init --openapi path/to/openapi.yml \
21+
--organization <YourOrganization>
2122

22-
<Accordion title="Option 2: Fern Definition">
23-
24-
<Markdown src="/products/sdks/snippets/option-2-fern-def.mdx"/>
25-
</Accordion>
23+
# OpenAPI (URL)
24+
fern init --openapi https://api.example.com/openapi.yml \
25+
--organization <YourOrganization>
2626

27-
{/* <Markdown src="/products/sdks/snippets/option-3-asyncapi.mdx"/> */}
28-
</AccordionGroup>
27+
# Fern Definition
28+
fern init --organization <YourOrganization>
29+
```
30+
<Tip>
31+
OpenAPI accepts both JSON and YAML formats. You can always convert a [Fern Definition to OpenAPI](/api-definitions/ferndef/export-openapi) or OpenAPI to a Fern Definition later on.
32+
</Tip>
33+
34+
This creates a `fern` folder in your current directory.
35+
<Tabs>
36+
<Tab title="OpenAPI">
37+
<Files>
38+
<Folder name="fern" defaultOpen>
39+
<File name="fern.config.json" comment="root-level configuration" />
40+
<Folder name="api" defaultOpen comment="your API">
41+
<File name="generators.yml" comment="generators you're using" />
42+
<Folder name="openapi" defaultOpen>
43+
<File name="openapi.yml" comment="API-level configuration" />
44+
</Folder>
45+
</Folder>
46+
</Folder>
47+
</Files>
48+
</Tab>
49+
<Tab title="Fern Definition">
50+
<Files>
51+
<Folder name="fern" defaultOpen>
52+
<File name="fern.config.json" comment="root-level configuration" />
53+
<File name="generators.yml" comment="generators you're using" />
54+
<Folder name="definition" defaultOpen>
55+
<File name="api.yml" comment="API-level configuration" />
56+
<File name="imdb.yml" comment="endpoints, types, and errors" />
57+
</Folder>
58+
</Folder>
59+
</Files>
2960

30-
### Next: Set up your repository structure
61+
<Note> `imdb.yml` contains an example movies API. If you’re just
62+
generating an SDK for test purposes, you can leave this file as it is. To
63+
generate an SDK for your own API instead of the example movies API,
64+
replace `imdb.yml` with your own endpoints, types, and errors. </Note>
65+
</Tab>
66+
</Tabs>
67+
</Step>
68+
<Step title="Next steps">
3169

32-
Now that you have your `fern` folder initialized, [learn how to organize your repositories for SDK generation](/sdks/overview/project-structure).
33-
70+
<CardGroup cols={2}>
71+
<Card title="Learn about project structure" icon="regular folder-tree" href="/learn/sdks/overview/project-structure">
72+
Understand how to organize your API definitions and generators.
73+
</Card>
74+
<Card title="Generate SDKs" icon="regular code" href="/learn/sdks/overview/introduction">
75+
Explore all supported languages.
76+
</Card>
77+
<Card title="Build with TypeScript" icon="regular rocket" href="/learn/sdks/generators/typescript/quickstart">
78+
Get started with TypeScript SDK generation.
79+
</Card>
80+
<Card title="Add custom code" icon="regular code-branch" href="/learn/sdks/overview/custom-code">
81+
Extend your generated SDKs with custom functionality.
82+
</Card>
83+
</CardGroup>
84+
</Step>
3485
</Steps>

fern/products/sdks/snippets/initialize-fern-folder-intro.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.

fern/products/sdks/snippets/install-cli.mdx

Lines changed: 0 additions & 7 deletions
This file was deleted.

fern/products/sdks/snippets/option-1-openapi.mdx

Lines changed: 0 additions & 44 deletions
This file was deleted.

fern/products/sdks/snippets/option-2-fern-def.mdx

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)