Skip to content

Annotated example

A complete .trevize/settings.json walked through section by section, based on a real repository.

Updated View as Markdown

Here’s a complete .trevize/settings.json that uses every top-level block. It’s based on a real monorepo — a web app plus a companion sync process, backed by a Neon database — and is walked through below.

{
  "$schema": "https://trevize.dev/schemas/settings.json",
  "workspaceId": "your-workspace-id",
  "projectId": "trevize-dev/trevize",
  "hooks": {
    "SandboxReady": [
      { "command": "source /usr/local/share/nvm/nvm.sh && nvm use 24" },
      { "command": "bun install" }
    ]
  },
  "preview": {
    "targets": {
      "dev": {
        "defaultProcess": "web",
        "processes": [
          {
            "name": "web",
            "command": "bun run dev",
            "port": 4321,
            "env": { "VITE_ZERO_CACHE_URL": "${PREVIEW_URL_ZERO}" }
          },
          {
            "name": "zero",
            "command": "bun run --cwd apps/web dev:zero",
            "port": 4848,
            "env": {
              "ZERO_QUERY_URL": "${PREVIEW_URL_WEB}/api/zero/query",
              "ZERO_MUTATE_URL": "${PREVIEW_URL_WEB}/api/zero/mutate"
            }
          }
        ]
      }
    }
  },
  "resources": {
    "neon": {
      "env": {
        "DATABASE_URL": "NEON_DATABASE_URL",
        "ZERO_UPSTREAM_DB": "NEON_DATABASE_URL"
      }
    }
  }
}

Walking through it

Identity. $schema enables editor autocomplete; workspaceId and projectId identify the project to Trevize. See Overview & schema.

Hooks. On SandboxReady, the sandbox selects Node 24 and installs dependencies with bun install — so the repository is ready before anything runs.

Preview. The dev target runs two processes:

  • web (port 4321) is the default process reviewers see. Its VITE_ZERO_CACHE_URL points at the other process using ${PREVIEW_URL_ZERO}.
  • zero (port 4848) is a sync service that points back at the web process with ${PREVIEW_URL_WEB} — showing how processes reference each other by name.

Resources. The neon resource gives each run its own Postgres branch. Both DATABASE_URL and ZERO_UPSTREAM_DB are set from the injected NEON_DATABASE_URL, so the app and the sync service share the same isolated database.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close