Skip to content

Commit 9d158da

Browse files
nickdevin-ai-integration[bot]
andcommitted
docs: rewrite README with Homebrew install, updated version, repo structure, and CI/CD details
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 9e4cb5c commit 9d158da

1 file changed

Lines changed: 150 additions & 30 deletions

File tree

README.md

Lines changed: 150 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<br/>
2+
23
<div align="center">
34
<a href="https://www.buildwithfern.com/?utm_source=github&utm_medium=readme&utm_campaign=fern&utm_content=logo">
45
<picture>
@@ -10,10 +11,12 @@
1011

1112
<br/>
1213

13-
# Docs starter
14+
# Docs Starter
1415

1516
Create beautiful documentation in under 5 minutes using your OpenAPI specification.
1617

18+
[![View live example](https://img.shields.io/badge/View-Live_Example-green?style=flat)](https://plantstore.docs.buildwithfern.com)
19+
1720
</div>
1821

1922
## Customer showcase
@@ -24,56 +27,156 @@ Get inspired by API documentation built with Fern: [Webflow](https://developers.
2427

2528
## Requirements
2629

27-
- Node 18 or higher
30+
- **Node.js 18+** (required for `npm install`) _or_ **Homebrew** (macOS/Linux)
2831
- A [GitHub](https://github.com) account
29-
- Knowledge of the command line
32+
- A [Fern](https://buildwithfern.com) account (free to start)
33+
34+
## Installation
35+
36+
Install the Fern CLI globally using one of the following methods:
37+
38+
**npm** (all platforms):
39+
40+
```bash
41+
npm install -g fern-api
42+
```
43+
44+
**Homebrew** (macOS / Linux):
45+
46+
```bash
47+
brew install fern-api
48+
```
49+
50+
Verify the installation:
51+
52+
```bash
53+
fern --version
54+
```
55+
56+
## Repository structure
57+
58+
```
59+
fern/
60+
├── docs.yml # Site config: navigation, theme, tabs, navbar links
61+
├── fern.config.json # Organization name and CLI version
62+
├── generators.yml # API spec sources (OpenAPI, AsyncAPI)
63+
├── openapi.yaml # Sample Plant Store OpenAPI spec
64+
├── asyncapi.yaml # Sample AsyncAPI spec
65+
├── styles.css # Custom CSS overrides
66+
├── snippets/ # Reusable MDX content fragments
67+
├── docs/
68+
│ ├── pages/ # Markdown (MDX) documentation pages
69+
│ ├── assets/ # Logos, favicon, and static assets
70+
│ └── changelog/ # Changelog entries
71+
└── ...
72+
.github/
73+
└── workflows/
74+
├── check.yml # Validates your API spec on every PR and push
75+
├── preview-docs.yml # Generates a preview URL on every PR
76+
└── publish-docs.yml # Publishes docs to production on merge to main
77+
```
3078

3179
## Getting started
3280

3381
> **Prefer a no-code setup?** Use the [guided UI](https://dashboard.buildwithfern.com/get-started) to get started from your browser instead.
3482
35-
Follow the steps below, or see the [Docs quickstart](https://buildwithfern.com/learn/docs/getting-started/quickstart) for a more detailed walkthrough.
83+
### 1. Create your repository
84+
85+
Use this template to create a new repository:
86+
87+
```bash
88+
# Using the GitHub CLI
89+
gh repo create my-org/my-docs --template fern-api/docs-starter --private --clone
90+
cd my-docs
91+
```
92+
93+
Or click **"Use this template"** on [GitHub](https://github.com/fern-api/docs-starter) and clone the resulting repository.
94+
95+
Alternatively, start from scratch in any directory:
96+
97+
```bash
98+
fern init --docs
99+
```
100+
101+
> **Note:** `fern init --docs` generates only `docs.yml` and `fern.config.json`. You'll need to add your own pages and API spec afterward.
36102
37-
1. **Install the CLI**
103+
### 2. Configure your organization
38104

39-
```bash
40-
npm install -g fern-api
41-
```
105+
Update `fern/fern.config.json` with your organization name:
42106

43-
2. **Initialize your docs**
107+
```json
108+
{
109+
"organization": "your-org-name",
110+
"version": "5.35.4"
111+
}
112+
```
44113

45-
Clone this starter template, or run `fern init --docs` to start from scratch.
114+
Update the docs URL in `fern/docs.yml`:
46115

47-
3. **Configure your organization**
116+
```yaml
117+
instances:
118+
- url: your-org-name.docs.buildwithfern.com
119+
```
48120
49-
Set your organization name in `fern.config.json` and your docs URL in `docs.yml`:
121+
Use only alphanumeric characters, hyphens, and underscores for both values.
50122
51-
```json
52-
// fern.config.json
53-
{ "organization": "your-org-name", "version": "4.21.3" }
54-
```
123+
### 3. Validate your configuration
55124
56-
```yaml
57-
# docs.yml
58-
instances:
59-
- url: your-org-name.docs.buildwithfern.com
60-
```
125+
Run the linter to catch errors before previewing:
61126
62-
4. **Preview locally**
127+
```bash
128+
fern check
129+
```
63130

64-
```bash
65-
fern docs dev
66-
```
131+
### 4. Preview locally
67132

68-
5. **Publish**
133+
Start a local development server with hot-reloading:
69134

70-
```bash
71-
fern generate --docs
72-
```
135+
```bash
136+
fern docs dev
137+
```
138+
139+
Open [http://localhost:3000](http://localhost:3000) to see your docs. Changes to MDX files and `docs.yml` will reload automatically.
140+
141+
### 5. Publish
142+
143+
When you're ready to go live:
144+
145+
```bash
146+
fern generate --docs
147+
```
148+
149+
This requires a `FERN_TOKEN`. Get yours from the [Fern dashboard](https://dashboard.buildwithfern.com) under **Settings > API keys**.
150+
151+
To generate a shareable preview URL without publishing:
152+
153+
```bash
154+
fern generate --docs --preview
155+
```
156+
157+
## CI/CD workflows
158+
159+
This template includes three GitHub Actions workflows out of the box:
160+
161+
| Workflow | Trigger | What it does |
162+
|----------|---------|--------------|
163+
| `check.yml` | Every PR and push to `main` | Runs `fern check` to validate your API spec |
164+
| `preview-docs.yml` | Every PR | Generates a preview URL and posts it as a PR comment |
165+
| `publish-docs.yml` | Push to `main` (after first build) | Publishes your docs to production |
166+
167+
### Setting up CI
168+
169+
Add your `FERN_TOKEN` as a repository secret:
170+
171+
1. Go to **Settings > Secrets and variables > Actions** in your GitHub repository.
172+
2. Click **New repository secret**.
173+
3. Name it `FERN_TOKEN` and paste your token value.
174+
175+
The `check.yml` workflow works without a token; only preview and publish require it.
73176

74177
## Customize your docs
75178

76-
Once you're up and running, you can tailor your docs site to match your brand and product:
179+
Once you're up and running, tailor your docs to match your brand and product:
77180

78181
- **[Brand your docs](https://buildwithfern.com/learn/docs/configuration/site-level-settings)** — Set custom colors, logo, favicon, and fonts in `docs.yml`
79182
- **[Add an API reference](https://buildwithfern.com/learn/docs/api-references/generate-api-ref)** — Auto-generate interactive API docs from your OpenAPI spec
@@ -82,6 +185,23 @@ Once you're up and running, you can tailor your docs site to match your brand an
82185
- **[Configure analytics](https://buildwithfern.com/learn/docs/integrations/overview)** — Integrate with PostHog, Segment, Google Tag Manager, and others
83186
- **[Customize navigation](https://buildwithfern.com/learn/docs/configuration/navigation)** — Add versioned docs, tabs, nested sections, and multi-product layouts
84187

188+
## Useful commands
189+
190+
| Command | Description |
191+
|---------|-------------|
192+
| `fern check` | Validate your Fern configuration and API specs |
193+
| `fern docs dev` | Start local dev server with hot-reloading |
194+
| `fern generate --docs` | Publish docs to your configured URL |
195+
| `fern generate --docs --preview` | Generate a shareable preview URL |
196+
| `fern upgrade` | Upgrade the CLI version in `fern.config.json` |
197+
198+
## Further reading
199+
200+
- [Docs quickstart](https://buildwithfern.com/learn/docs/getting-started/quickstart)
201+
- [CLI reference](https://buildwithfern.com/learn/cli-api-reference/cli-reference/overview)
202+
- [Writing content (Markdown)](https://buildwithfern.com/learn/docs/writing-content/overview)
203+
- [Configuration reference](https://buildwithfern.com/learn/docs/configuration/overview)
204+
85205
---
86206

87207
## Support

0 commit comments

Comments
 (0)