Docs
Setup
Docs/Setup

Setup

Run belay setup inside the project you want to guard. One command does everything — you will be protected before it finishes.

Run setup

bash
$ cd your-project
$ belay setup

What setup does

belay setup is the single onboarding command. In order, it:

  1. Checks your Node version. Fails immediately if you are running Node older than 20.

  2. Initializes configuration if this is a new project. Creates a belay.config.json in the current directory. Any undeclared database host is treated as production by default — the safe starting point.

  3. Starts the guardrail daemon (or reuses one already running).

  4. Detects and configures your agent integrations. Belay checks which of the four supported agents — Claude Code, Cursor, VS Code, Codex — you already have configured and wires each one automatically. Existing configuration files are merged, never overwritten.

  5. Discovers databases by reading your .env files, Docker Compose configuration, and Prisma schema. This is read-only: Belay never opens a database connection or reads your passwords during this step. Any remote host it finds is automatically treated as production.

  6. Prints a summary and next steps.

Non-interactive environments

By default, belay setup is fully automatic — it makes sensible decisions without prompting. Two flags give you explicit control in CI or scripted environments:

bash
$ belay setup --all
# wires all four supported agent integrations
bash
$ belay setup --surfaces claude,cursor
# wire specific agents only

Re-discovering databases

When your project gains a new database connection — a new .env entry, a new service in Docker Compose — run belay scan to bring it into Belay's view:

bash
$ belay scan

belay scan re-reads your project's database configuration (read-only, never opening a connection) and lets you declare each discovered host as production or non-production. Remote hosts default to production. Skipping a host is always safe — undeclared hosts are already treated as production.

Configuration file: Belay stores your project's settings in belay.config.json at the root of your project. You can validate it at any time with belay config validate.