Skip to content

Commit aab7f6e

Browse files
fern-supportjsklan
andauthored
Add fern usage guide to CONTRIBUTING.md (#295)
* initial * changes * restyle --------- Co-authored-by: jsklan <[email protected]>
1 parent 119488b commit aab7f6e

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,72 @@ Please note that this project is released with a [Contributor Code of Conduct][c
1414

1515
**We don't currently accept pull requests that directly modify the description artifacts found in this repository.** If you have feedback on the descriptions or have found a mismatch between the behavior that is described in this repo and the runtime behavior of the API, please [open an issue](https://github.com/intercom/Intercom-OpenAPI/issues/new).
1616

17+
### Using Fern
18+
19+
Our SDKs are generated from our OpenAPI spec using [Fern](https://buildwithfern.com/learn/sdks/overview/introduction).
20+
21+
If you're making changes to the OpenAPI spec, you can use the Fern CLI to validate your changes and preview the impact on the generated SDKs.
22+
23+
#### Installation
24+
25+
```bash
26+
npm install -g fern-api
27+
```
28+
29+
#### Common Commands
30+
31+
**Validate the spec:**
32+
```bash
33+
fern check
34+
```
35+
36+
**Preview an SDK:**
37+
```bash
38+
fern generate --preview --group <group-name>
39+
```
40+
41+
#### ⚠️ Important Warning
42+
43+
**Be careful not to run `fern generate` without the `--preview` flag in your local development environment!**
44+
45+
Running `fern generate` without the preview flag will automatically submit pull requests to the SDK's GitHub repository. This command is intended for use in CI/CD pipelines only.
46+
47+
**❌ Don't do this locally:**
48+
```bash
49+
fern generate --group <group-name>
50+
```
51+
52+
**✅ Always use preview mode for local development:**
53+
```bash
54+
fern generate --preview --group <group-name>
55+
```
56+
57+
> **Note:** You can find the appropriate group name in the [`generators.yml`](./fern/generators.yml) file. For example, `python-sdk` is the group name for the Python SDK.
58+
59+
**Generate the Fern definition from the OpenAPI spec:**
60+
```bash
61+
fern write-definition
62+
```
63+
64+
#### Help Commands
65+
66+
Get general help:
67+
```bash
68+
fern help
69+
```
70+
71+
Get help for the generate command:
72+
```bash
73+
fern generate help
74+
```
75+
76+
#### Additional Resources
77+
78+
For more details on how to use Fern, refer to the documentation for:
79+
- [Fern CLI](https://buildwithfern.com/learn/cli-api-reference/cli-reference/overview)
80+
- [Fern SDK](https://buildwithfern.com/learn/sdks/overview/introduction)
81+
82+
1783
## Contributions to other files in the repository
1884

1985
We will gladly accept pull requests for contributions to other files in this repository.

0 commit comments

Comments
 (0)