# Getting started

URL: /docs/getting-started

Install pro-visu, scaffold a config, and generate your first assets.

## Install

Two ways, same CLI and generators:

|         | **Dev dependency** (recommended) | **npx / global** (no install)             |
| ------- | -------------------------------- | ----------------------------------------- |
| Install | `pnpm add -D pro-visu`           | `npx pro-visu …` (or `npm i -g pro-visu`) |
| Config  | TS (`defineConfig`) or JSON      | JSON                                      |
| Version | pinned in your lockfile          | floating (pin with `pro-visu@x.y.z`)      |

A TS config needs the dev dependency — its `defineConfig` import must resolve from `node_modules`.
JSON works either way, with autocomplete + validation from a generated `pro-visu.schema.json`.

> **Unreleased builds:** build the package from a clone, then use a `pnpm link` or a `file:` path.
> A plain `github:pro-laico/pro-visu` install has no binary, since the package lives in the
> `packages/pro-visu` subdir of the monorepo. See the [README](https://github.com/pro-laico/pro-visu).

## Initialise

```bash
npx pro-visu init
```

Idempotent. Detects package manager, framework, and dev port → writes `pro-visu/pro-visu.config.ts`;
gitignores `pro-visu/output/`; adds a `"pro-visu"` package script; downloads the managed Chromium +
ffmpeg (one-time, shared). Leaves an existing config alone. `--json` for a dependency-free JSON
config; [all flags](/docs/cli#pro-visu-init).

## Configure

Edit `pro-visu/pro-visu.config.ts` — point an asset at your site by setting `URL` to whatever
you'll run (dev / prod build / deployed):

```ts title="pro-visu/pro-visu.config.ts"
import { defineConfig } from "pro-visu";

const URL = "http://localhost:3000";

export default defineConfig({
  settings: { outDir: "output" }, // → pro-visu/output/
  assets: [
    {
      name: "home-reel",
      url: URL,
      generator: "scroll-reel",
    },
  ],
});
```

Full shape (settings, defaults, splitting into modules): [Configuration](/docs/configuration).
Every asset type + its options: [Generators](/docs/generators).

## Generate

Start your site (or use a deployed URL), then:

```bash
npx pro-visu generate
```

Assets → `outDir` + `manifest.json`; review with `npx pro-visu list`. `generate` probes the URLs
up front and fails fast when nothing's listening — so if the port doesn't match your dev server,
fix `URL`.

> **Don't want to start the site yourself?** A [managed server](/docs/configuration#managed-server)
> builds → starts → captures → stops it, so `generate` is the only command you run.
