> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fimo.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy & publish

> On-demand hosted previews, publishing to production, and the AI-friendly markdown every deploy emits.

Fimo hosts your site. `fimo deploy` is **on-demand** — not your working loop and not a required final step. The loop is local (`pnpm dev`); reach for deploy only when you want a hosted preview, a shareable link, or to go live, and batch related edits into one deploy.

## The commands

```bash theme={null}
fimo deploy                                  # preview only (default; reversible)
fimo deploy -m "<commit message>"            # commit pending + push + sandbox sync
fimo deploy --no-restart                     # skip dev-server restart (HMR-safe changes only)
fimo deploy -m "<message>" --publish         # also publish a new live version
```

* **`fimo deploy`** commits pending changes, pushes to the current environment's branch, syncs its preview sandbox, and prints the preview URL. It's env-aware — it targets the environment of your current git branch.
* **`fimo deploy --publish`** does the same, then triggers a live publish and prints the live URL. Runs from `main` only. Use `--publish` only on a "ship it" / "go live" signal.
* **`-m`** is the commit message for uncommitted changes — required in non-interactive shells.
* **`--no-restart`** lets Vite HMR pick up the change instead of restarting the sandbox dev server. Safe for `src/**`, assets, and content JSON; **not** for `vite.config.*`, `package.json`/lockfiles, `.env`, or `.fimo/`. When in doubt, omit it.

## When to run which

<CardGroup cols={2}>
  <Card title="fimo deploy" icon="eye">
    Show a hosted version in Studio, share a link, or smoke-test a change on the deployed sandbox.
  </Card>

  <Card title="fimo deploy --publish" icon="rocket">
    Go live — first-time completion, or an explicit publish request. For a tagged release, use `fimo publish --version`
    instead.
  </Card>
</CardGroup>

<Note>
  Just need the current preview URL without pushing code? That's `fimo preview url` — sub-second, no commit or push.
  Don't run `fimo deploy` just to refresh a link.
</Note>

<Note>
  Projects with **Disable Preview** turned on still accept `fimo deploy`, but they sync changes without starting a
  visual Preview environment or returning a Preview URL. `fimo preview url` explains that Preview is disabled. Turn the
  setting off in Project Settings to use Preview again.
</Note>

## Markdown for AI agents

Every deploy emits an AI-friendly version of the site alongside the HTML — no setup needed.

* A **`.md` next to every prerendered page** (e.g. `index.html` → `index.md`), with frontmatter from `<title>` / meta / OG tags and the `<main>` content as GitHub-flavored markdown.
* A **`/llms.txt`** at the site root — a markdown index of all pages, following the [llms.txt](https://llmstxt.org) convention.

Agents can fetch it three equivalent ways:

```bash theme={null}
curl https://your-site/index.md                     # .md suffix
curl -H 'Accept: text/markdown' https://your-site/  # content negotiation
curl https://your-site/?format=md                   # query param
```

## What's next

<Columns cols={3}>
  <Card title="Custom domains" icon="globe" href="/docs/deploy/custom-domains">
    Put your site on your own URL.
  </Card>

  <Card title="Analytics" icon="chart-line" href="/docs/deploy/analytics">
    Traffic for your published site.
  </Card>

  <Card title="Preview vs production" icon="eye" href="/docs/environments/preview-vs-production">
    Preview and production, compared.
  </Card>
</Columns>
