Skip to content
Open
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
8 changes: 7 additions & 1 deletion fern/products/cli-api-reference/pages/docs-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These commands build, preview, and publish a Fern documentation site, and valida

<CodeBlock title="terminal">
```bash
fern generate --docs [--instance <instance-url>] [--preview] [--id <name>] [--force] [--no-prompt] [--guest] [--new-session]
fern generate --docs [--instance <instance-url>] [--preview] [--id <name>] [--force] [--no-prompt] [--guest] [--new-session] [--no-source]
```
</CodeBlock>

Expand Down Expand Up @@ -85,6 +85,12 @@ These commands build, preview, and publish a Fern documentation site, and valida

`--guest` can't be combined with `FERN_TOKEN` or a saved login. Add `--new-session` to discard the saved guest session and start a fresh one.

A guest publish to production (not `--preview`) also uploads your `fern/` folder, the folder that contains `fern.config.json`, with the site. After you claim the site, [connecting a GitHub repository](/learn/dashboard/configuration/github-repo) in the Fern Dashboard writes that folder to the repository. The upload leaves out files ignored by git, `.env` and `.env.*` files, `.guest-session`, `.git`, `node_modules`, and `.DS_Store`. A folder larger than 20 MB or 5,000 files isn't uploaded: the CLI prints a warning and still publishes the site. Pass `--no-source` to publish without uploading the folder.

```bash
fern generate --docs --guest --no-source
```

</Accordion>

<Accordion title="fern docs dev">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ These commands apply to every Fern project, whether it publishes [docs](/learn/c
```
</CodeBlock>

The claim link printed by `fern generate --guest` does the same from the Fern Dashboard.
The claim link printed by `fern generate --guest` does the same from the Fern Dashboard. After claiming, [connecting a GitHub repository](/learn/dashboard/configuration/github-repo) adds the `fern/` folder that the guest publish uploaded.

</Accordion>

Expand Down
2 changes: 2 additions & 0 deletions fern/products/dashboard/pages/github-repo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ If you haven't already installed the [Fern GitHub app](https://github.com/apps/f
<Step title="Select your repository">

Choose the repository containing your Fern documentation. Once connected, Fern automatically deploys your documentation when you push changes to the configured branch.

For a site claimed from a [guest publish](/learn/cli-api-reference/cli-reference/docs-commands#guest), Fern writes the `fern/` folder uploaded with the site to the repository you select, opening a pull request if the repository already has commits.
</Step>
</Steps>

Expand Down
4 changes: 4 additions & 0 deletions fern/products/home/pages/fern-instructions/new-site.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Run `fern whoami` (or `fern whoami --json`) to see what the CLI acts as in the c
- Later runs in the same repo reuse the session. The CLI stores it in `fern/.guest-session` (gitignored) and keeps the credential in `~/.fern/guest-sessions/`. It warns when less than an hour is left, and a run that crosses the deadline fails.
- While running as a guest, the CLI ignores the `organization` in `fern.config.json` (with a warning) and doesn't change the file.
- `fern generate --docs --guest` publishes the docs to a temporary `drop-<id>` site that the guest session owns. It ignores the `instances` URL in `docs.yml`. The CLI prints the site URL and the claim link.
- A guest publish to production (not `--preview`) also uploads the `fern/` folder with the site. After claiming, connecting a GitHub repository in the Fern Dashboard writes that folder to the repo (as a pull request if the repo already has commits). Files ignored by git, `.env` and `.env.*` files, `.guest-session`, `.git` and `node_modules` are left out. A folder over 20 MB or 5,000 files is skipped with a warning and the site still publishes. Pass `--no-source` to publish without uploading the folder.
- `--guest` fails if `FERN_TOKEN` is set or a login is saved. Unset `FERN_TOKEN` or run `fern logout` to continue as a guest, or drop `--guest` to use the existing credentials.
- `fern generate --docs --guest --new-session` discards the recorded session and starts a new guest organization. Earlier guest output isn't carried over. Use it when the old session was claimed, revoked, or expired.

Expand All @@ -63,6 +64,7 @@ Common `fern claim` failures:

- Never invent an organization name. Ask the user. Use only letters, numbers, hyphens and underscores.
- Don't commit `fern/.guest-session` or anything from `~/.fern/`.
- Before a guest publish, check that `fern/` holds no secrets git doesn't ignore. Add them to `.gitignore` or pass `--no-source`.
- Don't print or store `FERN_TOKEN` values. Store them as CI secrets.
- The `organization` in `fern.config.json` must match the user's organization in the [Fern Dashboard](https://dashboard.buildwithfern.com), or publishing with a login fails.

Expand All @@ -78,3 +80,5 @@ Common `fern claim` failures:
- [Docs quickstart](https://buildwithfern.com/learn/docs/getting-started/quickstart.md)
- [SDKs quickstart](https://buildwithfern.com/learn/sdks/overview/quickstart.md)
- [General CLI commands](https://buildwithfern.com/learn/cli-api-reference/cli-reference/general-commands.md)
- [Docs commands](https://buildwithfern.com/learn/cli-api-reference/cli-reference/docs-commands.md)
- [Connect a Git repository](https://buildwithfern.com/learn/dashboard/configuration/github-repo.md)
Loading