Skip to content

Commit d3a6807

Browse files
authored
docs: document --force flag (#4382)
1 parent 41da3db commit d3a6807

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

fern/products/cli-api-reference/pages/commands.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ hideOnThisPage: true
360360

361361
<CodeBlock title="terminal">
362362
```bash
363-
fern generate --docs [instance <instance-url>] [--preview] [--id <name>]
363+
fern generate --docs [instance <instance-url>] [--preview] [--id <name>] [--force]
364364
```
365365
</CodeBlock>
366366

@@ -391,6 +391,14 @@ hideOnThisPage: true
391391

392392
This is useful in CI workflows where you want one preview URL per pull request. See [Preview changes](/learn/docs/preview-publish/preview-changes#preview-links) for details.
393393

394+
### force
395+
396+
When reusing an `--id` that already exists, Fern prompts you to confirm the overwrite. Use `--force` to skip the confirmation. This is detected automatically in GitHub Actions, but is needed for other CI environments like Azure Pipelines.
397+
398+
```bash
399+
fern generate --docs --preview --id my-feature --force
400+
```
401+
394402
</Accordion>
395403

396404
<Accordion title="fern docs preview list">
-53.7 KB
Loading

fern/products/docs/pages/getting-started/preview-changes-locally.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ fern generate --docs --preview --id my-feature
5858
# With --id my-feature (stable URL)
5959
[docs]: Published docs to https://fern-preview-my-feature.docs.buildwithfern.com/learn
6060
```
61+
<Info>
62+
When a preview with the same `--id` already exists, Fern prompts you to confirm the overwrite. This is skipped automatically in GitHub Actions, but for other CI environments (e.g., Azure Pipelines), use `--force` to skip the confirmation.
63+
64+
```bash
65+
fern generate --docs --preview --id my-feature --force
66+
```
67+
</Info>
6168

6269
You can [delete a preview deployment](/learn/cli-api-reference/cli-reference/commands#fern-docs-preview-delete) when it's no longer needed:
6370

@@ -72,7 +79,7 @@ You can use a GitHub Actions workflow to automatically generate a preview URL wh
7279
<Frame>
7380
<img
7481
src="./images/markdown-links-preview.png"
75-
alt="GitHub Actions bot comment on a pull request showing a preview URL and direct links to changed documentation pages"
82+
alt="GitHub Actions bot comment on a pull request showing a named preview URL and direct links to changed documentation pages"
7683
/>
7784
</Frame>
7885

0 commit comments

Comments
 (0)