Skip to content
GitHub

bino preview

bino preview starts a local HTTP server that renders your report in a browser. It reloads automatically when you change manifests or data files.

bino preview [flags]

Common flags:

  • --work-dir – report bundle directory (default: .).
  • --port – HTTP port (default: 45678), bound on 127.0.0.1.
  • --addr – full listen address, overriding --port (e.g. 0.0.0.0:8080). Needed inside a container, where the default loopback bind is the container's own. A non-loopback bind exposes the unauthenticated /__explorer/query SQL endpoint to anything that can reach it, and suppresses the automatic browser open.
  • --artefact – preview only specified artefact names (can be repeated).
  • --exclude-artefact – skip specified artefact names (can be repeated).
  • --log-sql – log executed SQL queries.
  • --lint – run lint rules on each refresh (disabled by default).
  • --data-validation – data validation mode: warn (default), fail, or off.

DocumentArtefacts render at /doc/<name> with the same live reload as report artefacts: editing a markdown source re-renders only the affected document, and edits to an embedded component or its data propagate into the open page. The preview pins the page to the artefact's paper width and marks page breaks and header/footer bands, but real pagination and TOC page numbers appear only in bino build — see Previewing documents for the exact contract. --artefact and --exclude-artefact filter document artefacts too.

You can set default values for preview flags in your project's bino.toml file. These defaults are applied automatically and can be overridden by explicit command-line flags:

[preview.args]
port = 9000
log-sql = true
lint = true
data-validation = "warn"
artefact = ["monthly", "weekly"]
exclude-artefact = ["draft"]

When you override a TOML default, the CLI logs an info message:

$ bino preview --port 8080
Overriding port from bino.toml (9000 -> 8080)

You can also set environment variables for preview in your bino.toml. This is useful for configuring query limits during development:

[preview.env]
BNR_MAX_QUERY_ROWS = "10000"
BNR_CDN_MAX_BYTES = "10485760"
DATABASE_URL = "postgres://localhost/dev"

Actual environment variables always take precedence over TOML values. When an env var overrides a TOML value, the CLI logs a message:

$ BNR_MAX_QUERY_ROWS=5000 bino preview
Environment variable BNR_MAX_QUERY_ROWS overrides bino.toml ("10000" -> "5000")

See bino init for the full configuration reference.

Preview the bundle in the current directory:

bino preview

Preview a different workdir and log SQL:

bino preview --work-dir my-report --log-sql

Preview only selected artefacts — useful for speeding up the live-reload loop in bundles with many artefacts:

bino preview --artefact monthly_sales --artefact annual_sales

If the browser does not open automatically, open http://127.0.0.1:45678/ manually.