Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion fern/products/cli-api-reference/pages/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ hideOnThisPage: true

<CodeBlock title="terminal">
```bash
fern generate --docs [instance <instance-url>] [--preview] [--id <name>]
fern generate --docs [instance <instance-url>] [--preview] [--id <name>] [--force]
```
</CodeBlock>

Expand Down Expand Up @@ -391,6 +391,14 @@ hideOnThisPage: true

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.

### force

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.

```bash
fern generate --docs --preview --id my-feature --force
```

</Accordion>

<Accordion title="fern docs preview list">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ fern generate --docs --preview --id my-feature
# With --id my-feature (stable URL)
[docs]: Published docs to https://fern-preview-my-feature.docs.buildwithfern.com/learn
```
<Info>
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.

```bash
fern generate --docs --preview --id my-feature --force
```
</Info>

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

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

Expand Down
Loading