# Trevize Docs > Documentation for Trevize — cloud agents for teams. Autonomous tasks, automations, and everything in between. Index: https://docs.trevize.dev/llms.txt # Concepts > The core building blocks of Trevize — workspaces, automations, tasks, briefs, knowledge, and insights. Source: https://docs.trevize.dev/concepts/ · Markdown: https://docs.trevize.dev/concepts/index.md Everything in Trevize is built from a small set of concepts. Understanding how they relate makes the rest of the product predictable. - [**Workspaces & projects**](/concepts/workspaces) — the team boundary that owns your connected repositories, members, and billing. - [**Automations**](/concepts/automations) — autonomous loops that keep working on a goal in the background and open pull requests as they make progress. - [**Tasks & implementations**](/concepts/tasks) — the unit of work: a brief becomes an implementation, which becomes a pull request. - [**Briefs**](/concepts/briefs) — the specification that tells an agent what to build. - [**Knowledge & memory**](/concepts/knowledge) — the durable context agents carry across runs so they don't relearn your codebase every time. - [**Insights**](/concepts/insights) — the signals Trevize surfaces about what's happening across your work. If you're just getting oriented, start with [Get started](/get-started) for the big picture before diving into individual concepts. # Automations > Autonomous loops that run on a schedule and keep improving your product in the background. Source: https://docs.trevize.dev/concepts/automations/ · Markdown: https://docs.trevize.dev/concepts/automations/index.md An **automation** is a configured, autonomous workflow bound to a repository and a **blueprint** (a workflow template). It runs on a schedule — no one needs to be present — and each run spawns a [task/implementation](/concepts/tasks) that works toward the goal you defined and opens a pull request. Use automations for ongoing, background improvement: recurring maintenance, sweeping fixes, or any goal you want the agent to keep chipping away at without anyone having to be present. ## Creating an automation When you create an automation you provide: - **Name** and an optional **Description**. - **Instructions** — the prompt the agent executes each run. - **Repository** and an optional **base branch**. - **Blueprint** — the workflow the run follows, and an optional **Model**. - **Environment variables** and **Secrets** — plain key-value pairs and references to workspace secrets, passed to the sandbox at run time. ## Schedules An automation can have one or more **schedules**. Each schedule has a **type** — **Hourly**, **Daily**, or **Monthly** — plus the relevant time fields (hour and minute for daily, and day-of-month for monthly) and a **timezone**. The automation shows its **next run** time, or **Paused** when disabled. ## Running & managing From an automation's page you can: - **Trigger now** — run it immediately without waiting for the schedule. - **Pause / Enable** — turn the schedule off or on. - **Edit** its configuration or **Delete** it. - Review its **run history** — the most recent runs, each a task you can open. > **Automations produce the same work products** > > Every automation run is an [implementation](/concepts/tasks): it runs an agent > in a sandbox, follows the blueprint's steps, and opens a pull request you > review — just started on a schedule instead of by hand. See the [Create & run an automation](/guides) guide for a walkthrough. # Briefs > A specification an agent works from — draft it, refine it with context, approve it, then start an implementation. Source: https://docs.trevize.dev/concepts/briefs/ · Markdown: https://docs.trevize.dev/concepts/briefs/index.md A **brief** is a specification: a document that describes what to build. Instead of handing an agent a one-line prompt, you write a brief, refine it with real context, approve it, and then start a [task](/concepts/tasks) from it — so the agent works from a clear, reviewed spec. ## The editor A brief has an editable **title** and a markdown/rich-text **body** that autosaves as you type and supports real-time collaborative editing with `@mentions`. A side **chat assistant** helps you draft: it can search your GitHub issues, repositories, and files and read file contents to ground the brief in your actual codebase. ## Status: draft → approved → archived Every brief has a status you control: - **Draft** — a work in progress. - **Approved** — reviewed and ready to build. Implementation is only enabled once a brief is approved. - **Archived** — set aside. ## Attaching context A brief can reference **resources** — GitHub repositories and Linear issues or projects — to give the agent the surrounding context it needs. ## From brief to implementation When a brief is **approved**, choose **Implement** to open the *Start Implementation* dialog: pick the repository, an optional base branch, a model, and the blueprint. Trevize links the resulting [implementation](/concepts/tasks) back to the brief, and the brief lists its implementations so you can track them. > **Why write a brief?** > > Briefs pay off for larger or higher-stakes work: a reviewed spec produces more > predictable results than an off-the-cuff prompt, and it gives your team a shared > artifact to align on before any code is written. # Insights > Workspace analytics that show how much Trevize is contributing — pull requests, merge velocity, and cost over time. Source: https://docs.trevize.dev/concepts/insights/ · Markdown: https://docs.trevize.dev/concepts/insights/index.md **Insights** show Trevize's impact on your workspace. They answer the question "what are the agents actually delivering?" by aggregating pull-request activity, Trevize's share of it, and cost — so you can see the value and keep an eye on spend. ## What you'll see At the top, a row of headline stats: - **% PRs by Trevize** — the share of pull requests Trevize authored. - **Total PRs** — pull requests over the selected period. - **PRs merged** — how many landed. - **Avg merge time** — how long, on average, PRs took to merge. Below them, charts break the story down over time: - **PR activity over time** — Trevize's pull requests against your team's total. - **Trevize's contributions** — Trevize's activity over time. - **Usage** and **Cost over time** — how much agent work is costing. ## Time ranges A range selector scopes every metric to the **last 7 days**, **30 days**, **90 days**, or **all time**. ## Where the data comes from Insights are computed from **pull-request metrics synced from GitHub** (author, state, and timing) together with agent **usage and cost** records. Trevize recognizes its own bot authors when attributing PRs, so the "by Trevize" figures reflect real agent-authored work. > **Measuring ROI** > > Because every [task](/concepts/tasks) and > [automation](/concepts/automations) ultimately opens pull requests, insights > give you a single place to see the return across both. # Knowledge & memory > The durable context agents capture as they work, so future runs start informed instead of relearning your codebase. Source: https://docs.trevize.dev/concepts/knowledge/ · Markdown: https://docs.trevize.dev/concepts/knowledge/index.md **Knowledge** is the memory that persists across runs. As agents work, they record **observations** — durable notes about what they decided, fixed, or discovered — which later runs can search and build on. This is what lets Trevize get better at *your* codebase over time instead of starting from scratch every run. ## Observations Each observation is captured automatically during a [task](/concepts/tasks) or [automation](/concepts/automations) run and has a **type**: - **Decision** — a choice made and why. - **Bug fix** — a defect and its resolution. - **Feature** — something built. - **Refactor** — a structural change. - **Discovery** — something learned about the codebase. - **Change** — a general change. An observation records a **title**, a **narrative**, structured **facts** and **concepts**, and the **files** it read and modified. ## Browsing knowledge The **Knowledge** page summarizes what's been captured — a total plus per-type counts — and lets you **search** and filter by type. Each observation opens to a detail view with its narrative, facts, concepts, and file lists. Knowledge is **read-only insight**: it's captured for you as agents work, not hand-authored. ## How it's used Observations are semantically searchable (vector embeddings), so when a new run starts, relevant past work can surface as context. Knowledge is scoped to your workspace and projects. > **A workspace-level capability** > > Knowledge capture is governed at the [workspace](/concepts/workspaces) level. > It compounds: the more work runs through Trevize, the richer the context future > runs begin with. # Tasks & implementations > The core unit of work — a prompt (or brief) that runs autonomously from a plan to a reviewable pull request. Source: https://docs.trevize.dev/concepts/tasks/ · Markdown: https://docs.trevize.dev/concepts/tasks/index.md A **task** is a single unit of work. Under the hood it becomes an **implementation**: one autonomous run that takes your request from a plan, to code, to a **pull request**. A task runs on its own and reports back. ## Where tasks come from - **Directly** — from the prompt card on your workspace home: pick a **blueprint** (bug fix, feature, or quick change), describe what you want to build, and choose a repository and model. - **From a brief** — start an implementation from an approved [brief](/concepts/briefs) so the agent works from a reviewed spec. - **From an automation** — every [automation](/concepts/automations) run creates a task on a schedule. ## The lifecycle A task moves through clear states you can watch: **pending → queued → running → completed** (or **failed**, **stopped**, or **cancelled**), and it may pause in a **waiting for input** state to ask for your approval. Once its pull request is merged, it shows as **merged**. While running, the task shows its **blueprint steps** — for example *Sandbox setup → Plan → Analyze → Implement → Fix issues → Test → Open PR* — along with an iteration count and the current step. ## Previews & UI feedback An implementation can serve a **live preview** of your app. On that preview you can leave **UI feedback** — comments pinned to what you see, each tracked through `open → in progress → resolved` (or `ignored`) — and the agent can act on them. This makes review visual, not just diff-based. ## Follow-ups, approvals & conflicts When a task finishes (or fails), you can send **follow-up instructions** to request changes or fixes. If a step is waiting on you, you can **approve** it or reply with feedback. If a merge is blocked by conflicts, you can ask the agent to **fix conflicts**. ## The pull request Every task's output is a **pull request** on your repo. You can **Open PR**, **Merge**, re-open, or close it, and its status (open, draft, merged, closed) is shown with a link to GitHub. If [CI auto-fix](/concepts/workspaces) is enabled, a failing CI run can trigger an automatic follow-up that pushes a fix. See [Review implementations, previews & UI feedback](/guides) for how to work through a task's output. # Workspaces & projects > The team boundary that owns your connected repositories, members, billing, and workspace-wide settings. Source: https://docs.trevize.dev/concepts/workspaces/ · Markdown: https://docs.trevize.dev/concepts/workspaces/index.md A **workspace** is your team's home in Trevize. It's the boundary that owns everything else: the GitHub repositories you connect, your members and their roles, your billing, and the settings that govern how agents behave. Tasks, automations, briefs, knowledge, and insights are all scoped to a single workspace. ## What a workspace owns - **Repositories** — GitHub repos connected through the Trevize GitHub App installation. Agents check these out, branch, push, and open pull requests. - **Members** — the people who can access the workspace, each with a role and a status (invited or active). - **Billing** — the plan for the workspace, which sets limits such as member seats and how many agent runs can execute concurrently. - **Settings** — workspace-wide configuration (below). ## Identity Each workspace has a **name** and a **URL slug** (its address). You choose both when you create the workspace; the slug is checked for availability and can be updated later in workspace settings, along with a logo. ## Members & roles Members are managed on the **Members** page. You **invite people** by email and assign a role (for example, Admin or Member); invited users appear with an `invited` tag until they accept. From a member's menu you can change their role, resend or cancel an invitation, or remove them. Invites are gated by your plan's seat limit — when it's reached, Trevize prompts you to upgrade. ## Workspace settings - **Commit attribution** — choose whether commits agents make are attributed to **Trevize** or to **the user who started the work**. - **CI auto-fix** — when enabled, a failing CI run on a branch from a completed implementation automatically starts a follow-up that fixes the CI issue and pushes the fix (it stops after a few attempts to avoid loops). > **Everything is scoped to the workspace** > > Access control, connected repos, and all work products live inside the > workspace. Switching workspaces switches the entire context. ## Related - **Team & billing** — Invite teammates and manage your plan. [Team & billing guide](/guides). - **Integrations** — Connect GitHub and the other tools a workspace uses. [Integrations](/integrations). # Configuration > Configure a repository for Trevize with .trevize/settings.json — hooks, preview targets and processes, and resources. Source: https://docs.trevize.dev/configuration/ · Markdown: https://docs.trevize.dev/configuration/index.md A repository tells Trevize how to set itself up, run, and preview through a single file: **`.trevize/settings.json`**. It lives in your repo, is versioned alongside your code, and controls what happens inside every sandbox Trevize creates for a task or automation. - [**Overview & schema**](/configuration/settings-json) — the shape of `settings.json` and what each top-level key does. - [**Hooks**](/configuration/hooks) — commands that run at sandbox lifecycle points such as `SandboxReady` (install dependencies, select a runtime, run setup). - [**Preview targets & processes**](/configuration/preview) — declare the processes that serve your app so reviewers get a live preview (`command`, `port`, `env`, `defaultProcess`). - [**Secrets**](/configuration/secrets) — inject workspace secrets into preview processes without committing sensitive values to the repository. - [**Resources**](/configuration/resources) — attach managed resources such as a Neon database and map their connection details into environment variables. - [**Annotated example**](/configuration/example) — a complete `settings.json` walked through section by section. For the exhaustive field list, see the [settings.json reference](/reference). # Annotated example > A complete .trevize/settings.json walked through section by section, based on a real repository. Source: https://docs.trevize.dev/configuration/example/ · Markdown: https://docs.trevize.dev/configuration/example/index.md 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. ```json { "$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](/configuration/settings-json). **Hooks.** On [`SandboxReady`](/configuration/hooks), the sandbox selects Node 24 and installs dependencies with `bun install` — so the repository is ready before anything runs. **Preview.** The [`dev` target](/configuration/preview) 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](/configuration/resources) 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. > **Start small** > > You don't need all of this at once. A `hooks.SandboxReady` with your install > command plus a single-process `preview` target is enough to get a working > preview; add `resources` when you want a real database per run. # Hooks > Run install and setup commands at sandbox lifecycle points with hooks.SandboxReady. Source: https://docs.trevize.dev/configuration/hooks/ · Markdown: https://docs.trevize.dev/configuration/hooks/index.md **Hooks** run shell commands at points in a sandbox's lifecycle. They're how you install dependencies, select a runtime, or do any one-time setup so the agent starts from a ready-to-work environment. ## `SandboxReady` `SandboxReady` is the hook that runs once the sandbox is up and your repository is checked out — before preview processes start. Provide an **array of commands**; they run **in order**. ```json { "hooks": { "SandboxReady": [ { "command": "source /usr/local/share/nvm/nvm.sh && nvm use 24" }, { "command": "bun install" } ] } } ``` Each entry is an object with a **`command`** string. Commands run in your repository's working directory. ## Environment variables Hook entries accept the same `env` and `secretEnv` blocks as [preview processes](/configuration/preview): - **`env`** — literal environment variables for that command. - **`secretEnv`** — variables resolved from [workspace secrets](/configuration/secrets) at runtime. Each entry maps the variable your command reads to a workspace secret key; the value never appears in your repository. ```json { "hooks": { "SandboxReady": [ { "command": "bun install" }, { "command": "bun run db:migrate && bun run db:seed", "env": { "NODE_ENV": "development" }, "secretEnv": { "SEED_API_KEY": "SEED_API_KEY" } } ] } } ``` Because hooks run through a shell, injected variables are also available directly in the command string as `$VAR` — no placeholder syntax needed. When a run provisions [resources](/configuration/resources), the resource's variables (for example a database branch URL) are injected into that repo's hooks automatically. If the same variable is defined in more than one place, a resolved secret wins over a resource variable, which wins over plain `env` — the same precedence previews use. A `secretEnv` entry that references a missing workspace secret fails **only that command** — it is reported in the timeline with the missing key, and the remaining hooks still run. ## What to put here - **Install dependencies** — `bun install`, `npm ci`, `pip install -r requirements.txt`, etc. - **Select a runtime/toolchain** — e.g. activate a Node version. - **One-time setup** — generate code, prepare a database schema, seed fixtures. > **Keep it fast and deterministic** > > Hooks run on every sandbox. Prefer commands that are idempotent and reasonably > quick — heavy setup slows down every task and automation. Hook > execution is time-bounded, so long-running processes belong in > [preview processes](/configuration/preview), not hooks. # Preview targets & processes > Declare the processes that serve your app so reviewers get a live preview — command, port, env, and defaults. Source: https://docs.trevize.dev/configuration/preview/ · Markdown: https://docs.trevize.dev/configuration/preview/index.md The **`preview`** block declares how to run your application inside a sandbox so reviewers get a **live preview** on an [implementation](/concepts/tasks). You define one or more **targets**, each made up of one or more **processes**. ## Targets `preview.targets` is a map of named targets. An optional `defaultTarget` picks which one launches when none is specified. ```json { "preview": { "defaultTarget": "dev", "targets": { "dev": { "defaultProcess": "web", "processes": [ { "name": "web", "command": "bun run dev", "port": 5173 } ] } } } } ``` ## Processes Each process runs a command and exposes a port the gateway proxies to. A process has: | Field | Required | Description | | ----------- | -------- | --------------------------------------------------------- | | `name` | yes | Unique name within the target (e.g. `web`, `api`). | | `command` | yes | Shell command to start the process. | | `port` | yes | Port the process listens on (1–65535). | | `cwd` | no | Working directory, relative to the sandbox home. | | `env` | no | Literal environment variables for this process. | | `secretEnv` | no | Environment variables resolved from **workspace secrets**. | For a multi-process target, set **`defaultProcess`** to the process shown by default (it must match one of the process `name`s). ### Single-process shorthand If a target runs just one process, you can set `command` and `port` directly on the target instead of a `processes` array: ```json { "preview": { "targets": { "docs": { "command": "bun run dev", "port": 4321 } } } } ``` A target must have **either** a `processes` array **or** both `command` and `port`. ## Environment variables - **`env`** — literal `KEY: "value"` pairs. Can be set at the target level (shared by all processes) or per process (merged on top). - **`secretEnv`** — maps an environment variable to a **workspace secret key**, resolved at runtime so secrets never live in your repo. See [Secrets](/configuration/secrets) for setup, scoping, and examples. ### Interpolation Values may reference runtime variables with `${VAR}`: - `${PREVIEW_URL}` / `${PREVIEW_HOST}` — the preview's URL and host. - `${PREVIEW_URL_}` / `${PREVIEW_HOST_}` — a specific process's URL/host, so one process can point at another (e.g. a frontend at its API). - Resource variables such as `${NEON_DATABASE_URL}` — see [Resources](/configuration/resources). ```json { "preview": { "targets": { "dev": { "defaultProcess": "web", "processes": [ { "name": "web", "command": "bun run dev", "port": 5173, "env": { "VITE_API_URL": "${PREVIEW_URL_API}" } }, { "name": "api", "command": "bun run api", "port": 8787 } ] } } } } ``` > **Validation** > > `defaultTarget` must name a real target, and `defaultProcess` must name a real > process within its target — otherwise the preview config is rejected. # Resources > Provision managed resources like a database branch per run and map their connection details into your app's environment. Source: https://docs.trevize.dev/configuration/resources/ · Markdown: https://docs.trevize.dev/configuration/resources/index.md The **`resources`** block wires managed resources — like an isolated database branch — into each run's sandbox. It's the repo-side half of the [Neon](/integrations/neon) and [Supabase](/integrations/supabase) integrations: the integration connects the provider at the workspace level, and `resources` declares that *this repository* wants a branch and how to expose it. ## How it works Each entry under `resources` is keyed by the integration id and has an **`env`** map that translates the variable Trevize provides into the variable **your app** expects: ```json { "resources": { "neon": { "env": { "DATABASE_URL": "NEON_DATABASE_URL" } } } } ``` Read the mapping as `"": ""`. Above, your app's `DATABASE_URL` is set from the `NEON_DATABASE_URL` that Trevize injects for the run's branch. > **Declaration is the trigger** > > A connected integration does nothing until a repository declares it here. > Adding the `resources` entry is what makes Trevize provision a branch for the > run. ## Provided variables For each declared resource, Trevize provisions a fresh branch per run and injects these variables into the sandbox (map whichever ones your app needs): | Resource | Injected variables | | ---------- | -------------------------------------------------------------------- | | `neon` | `NEON_DATABASE_URL`, `NEON_BRANCH_ID` | | `supabase` | `SUPABASE_DATABASE_URL`, `SUPABASE_BRANCH_ID`, `SUPABASE_BRANCH_REF` | You can also compose these variables in a [preview](/configuration/preview) process's `env` — for example `"${NEON_DATABASE_URL}?connection_limit=5"`. ## Mapping more than one variable Map as many app variables to a provided variable as you need: ```json { "resources": { "neon": { "env": { "DATABASE_URL": "NEON_DATABASE_URL", "DIRECT_URL": "NEON_DATABASE_URL" } } } } ``` > **Let an agent set it up** > > The Neon and Supabase integration pages can copy a setup prompt that detects > your app's real database variable and writes the correct `resources` block for > you. # Secrets > Keep sensitive values out of your repository and inject workspace secrets into preview processes with secretEnv. Source: https://docs.trevize.dev/configuration/secrets/ · Markdown: https://docs.trevize.dev/configuration/secrets/index.md Workspace secrets let preview processes and lifecycle hooks use API keys, tokens, and other sensitive values without storing them in your repository. Your `.trevize/settings.json` contains only a secret key; Trevize resolves the encrypted value at runtime. ## Add a workspace secret Open **Workspace settings → Secrets**, select **Add secret**, and enter: - **Key** — the stable name referenced by repository configuration. It must start with a letter and contain only uppercase letters, digits, and underscores. - **Value** — the sensitive value injected at runtime. - **Description** — optional context for other workspace members. After a secret is saved, Trevize returns only its key and metadata to the UI; the value remains masked. ## Reference a secret in a repository Add `secretEnv` to a [preview target](/configuration/preview). Each entry maps the environment variable your application reads to a workspace secret key: ```json { "preview": { "targets": { "dev": { "command": "bun run dev", "port": 3000, "secretEnv": { "OPENAI_API_KEY": "OPENAI_PRODUCTION_KEY" } } } } } ``` Read the mapping as `"": ""`. In this example, the application reads `process.env.OPENAI_API_KEY`, while Trevize looks up the workspace secret named `OPENAI_PRODUCTION_KEY`. [Hook](/configuration/hooks) entries accept the same `secretEnv` block, so a setup command can, for example, seed data through an authenticated API: ```json { "hooks": { "SandboxReady": [ { "command": "bun run db:seed", "secretEnv": { "SEED_API_KEY": "SEED_API_KEY" } } ] } } ``` The secret value itself never belongs in `.trevize/settings.json`. ## Manage secrets from the CLI The CLI accepts values only through a hidden TTY prompt or stdin, so values do not appear in shell history or command arguments. Secret listings and mutation responses contain keys and metadata only: ```sh trevize secrets list --output json printf '%s\n' "$SERVICE_TOKEN" | trevize secrets set SERVICE_TOKEN --stdin trevize secrets delete SERVICE_TOKEN --yes --output json ``` Use `--dry-run` to validate a key before a write. Deletion requires an interactive confirmation, or the explicit `--yes` flag in automation. Do not put secret values in repository configuration; map uploaded workspace secrets by name with `secretEnv` as shown above. ## Share secrets or limit them to one process Target-level `secretEnv` entries are available to every process in that target. Put `secretEnv` on an individual process when only that process needs the secret: ```json { "preview": { "targets": { "dev": { "defaultProcess": "web", "secretEnv": { "SHARED_SERVICE_TOKEN": "SHARED_SERVICE_TOKEN" }, "processes": [ { "name": "web", "command": "bun run dev:web", "port": 3000 }, { "name": "api", "command": "bun run dev:api", "port": 8787, "secretEnv": { "STRIPE_SECRET_KEY": "STRIPE_PRODUCTION_KEY" } } ] } } } } ``` Here, both processes receive `SHARED_SERVICE_TOKEN`, but only `api` receives `STRIPE_SECRET_KEY`. If the same environment variable appears in more than one place, resolution uses this order, with later values taking precedence: 1. Target-level `env` 2. Process-level `env` 3. Target-level `secretEnv` 4. Process-level `secretEnv` This lets a process-specific secret override a shared value deliberately. ## Secrets and interpolation Use `secretEnv` for secret values. A workspace secret is not available as a `${NAME}` placeholder inside `env`: ```json { "env": { "DATABASE_URL": "postgres://user:${DATABASE_PASSWORD}@db.example.com/app" } } ``` The configuration above does not resolve `DATABASE_PASSWORD` from workspace secrets. Store the complete sensitive value, such as the complete database URL, as a workspace secret and map it directly instead: ```json { "secretEnv": { "DATABASE_URL": "DATABASE_URL" } } ``` ## Troubleshooting If a referenced key does not exist in the workspace, Trevize stops the preview before starting its processes and reports the missing key. Add the secret in workspace settings or correct the right-hand side of the `secretEnv` mapping. When a process cannot read a configured value, check that: - The repository's `workspaceId` belongs to the workspace containing the secret. - The right-hand value matches the workspace secret key exactly. - `secretEnv` is attached to the intended target or process. - The application reads the left-hand environment variable name. > **Keep the scope narrow** > > Put a secret at process level unless every process in the target needs it. > Repository configuration can safely contain secret keys, but never commit > secret values. # Overview & schema > How .trevize/settings.json configures a repository for Trevize — where it lives, how it's read, and its top-level keys. Source: https://docs.trevize.dev/configuration/settings-json/ · Markdown: https://docs.trevize.dev/configuration/settings-json/index.md A repository tells Trevize how to set itself up, run, and preview through a single versioned file: **`.trevize/settings.json`**. It lives in your repo, so the configuration travels with your code and applies to every sandbox Trevize creates for a [task](/concepts/tasks) or [automation](/concepts/automations). ## Where it lives Put the file at **`.trevize/settings.json`** in the root of your repository. > **Legacy path** > > The older `.tervezo/settings.json` path is still honored as a fallback (with a > deprecation warning), but **`.trevize/`** is canonical — prefer it for new > repositories. When a sandbox is created, Trevize reads this file for the repository and uses it to run lifecycle hooks, start preview processes, and provision resources. ## Top-level keys ```json { "$schema": "https://trevize.dev/schemas/settings.json", "workspaceId": "your-workspace-id", "projectId": "your-org/your-repo", "hooks": {}, "preview": {}, "resources": {} } ``` | Key | Purpose | | ------------- | ------------------------------------------------------------------------------------------------------------ | | `$schema` | Points at the JSON schema so editors can offer autocomplete and validation. Optional. | | `workspaceId` | Identifies the Trevize workspace this project belongs to (used by the [MCP](/integrations/mcp) integration). | | `projectId` | Your `org/repo` identifier (can be auto-detected from the git remote). | | `hooks` | Commands to run at sandbox lifecycle points. See [Hooks](/configuration/hooks). | | `preview` | Preview targets and processes that serve your app. See [Preview](/configuration/preview). | | `resources` | Managed resources (e.g. a database) mapped into the sandbox. See [Resources](/configuration/resources). | All keys are optional — include only what your repository needs. `hooks`, `preview`, and `resources` are the parts that shape what happens inside a sandbox. ## Next - **Hooks** — Run install/setup commands when the sandbox is ready. [Configure hooks](/configuration/hooks). - **Preview** — Serve your app so reviewers get a live preview. [Configure preview](/configuration/preview). - **Resources** — Wire a database branch into the sandbox. [Configure resources](/configuration/resources). - **Annotated example** — A complete, walked-through `settings.json`. [See the example](/configuration/example). For a field-by-field table, see the [`settings.json` reference](/reference/settings-reference). # Get started > What Trevize is, the ideas behind it, and how to connect your first repository and start building with agents. Source: https://docs.trevize.dev/get-started/ · Markdown: https://docs.trevize.dev/get-started/index.md Trevize is a shared workspace where your team and AI agents build software together. You start **tasks** for focused pieces of work, and **automations** keep improving your product autonomously in the background — every change lands as a reviewable pull request on your own repository. This section gets you oriented and productive: - **Introduction** — what Trevize is, who it's for, and how the pieces fit together. - **Core concepts** — a fast tour of workspaces, automations, tasks, and the rest of the vocabulary you'll see throughout the product. - **Quickstart** — connect a repository and start your first task. New to the platform? Read the introduction first, then keep the [Concepts](/concepts) section open as a reference while you explore. # Core concepts > A fast tour of the Trevize vocabulary — workspaces, automations, tasks, briefs, knowledge, and insights. Source: https://docs.trevize.dev/get-started/core-concepts/ · Markdown: https://docs.trevize.dev/get-started/core-concepts/index.md This is a quick orientation to the terms you'll see across Trevize. Each one has a full page in [Concepts](/concepts) — this tour is just enough to get moving. ## Workspace Your team's home. A **workspace** owns the GitHub repositories you connect, your members and their roles, and your billing. Everything else — tasks, automations, briefs, knowledge — lives inside a workspace and is scoped to it. ## Automation An **automation** is an autonomous loop bound to a repository and a schedule (for example, hourly or daily). When it triggers, it runs an agent against your repo to make progress toward a goal you defined, opening pull requests without anyone having to be present. ## Task & implementation A **task** is a single unit of work. Under the hood it becomes an **implementation** — one autonomous run that takes a prompt (and an optional brief) from start to a pull request. Tasks, briefs, and automations all ultimately produce implementations that land as PRs. ## Brief A **brief** is a specification: a document describing what to build. You draft it, refine it (optionally attaching GitHub repos or Linear issues for context), approve it, and then start an implementation from it — so the agent works from a clear, reviewed spec rather than a one-line prompt. ## Knowledge **Knowledge** is the durable memory agents carry across runs. As agents work, they record observations — decisions, bug fixes, discoveries — that are stored and semantically searchable, so future runs start with relevant context instead of relearning your codebase every time. ## Insights **Insights** show Trevize's impact on your workspace: how many pull requests it opens, what share of your team's PRs it authors, merge rates and times, and cost over time — so you can see the value it's delivering. ## How they fit together - A **workspace** contains your repositories, members, and everything below. - A **brief** describes work; starting it creates an **implementation**. - **Tasks** started from a prompt and **automations** also create implementations. - Every implementation runs an agent in a sandbox and opens a **pull request**. - **Knowledge** accumulates across runs; **insights** summarize the results. Ready to try it? Head to the [Quickstart](/get-started/quickstart). # Introduction > What Trevize is, how teams build software with AI agents, and why every change lands as a reviewable pull request. Source: https://docs.trevize.dev/get-started/introduction/ · Markdown: https://docs.trevize.dev/get-started/introduction/index.md Trevize is a shared workspace where your team and AI agents build software together. You describe what you want, agents do the work inside isolated cloud sandboxes, and every change comes back as a **pull request on your own GitHub repository** — so nothing ships without your review. ## Two ways to work Trevize gives you two complementary modes, backed by the same agents and the same repositories: - **Tasks** — A single unit of work that runs autonomously from a short prompt (or an approved brief) and a blueprint — a bug fix, a feature, or a quick change — and produces a pull request. See [Tasks & implementations](/concepts/tasks). - **Automations** — Autonomous loops that run on a schedule and keep improving your product in the background, opening pull requests as they make progress. See [Automations](/concepts/automations). ## How it works 1. You **connect a GitHub repository** to a workspace. 2. You start a task or automation and describe the goal. 3. Trevize spins up an isolated **sandbox**, checks out your repo, and runs a **Claude Code** agent against it. 4. The agent implements the change on a branch, optionally serves a **live preview**, and opens a **pull request**. 5. You review, leave feedback, and merge — on your terms. > **You stay in control** > > Agents work on branches and propose pull requests. Trevize never merges to your > default branch on its own — humans review and merge, exactly like any other > contributor. ## What it connects to Trevize meets your team where it already works: - **GitHub** — repositories, branches, and pull requests. - **Linear** — turn issues into work and track it across tools. - **Claude Code** — the coding agent that powers tasks and automations. - **MCP**, **Neon**, **Sentry**, and **Supabase** — extend agents with tools, databases, error context, and backend services. See [Integrations](/integrations) for the full list. ## Who it's for Trevize is built for product teams who want to move faster with AI agents without giving up code review, previews, or ownership of their repositories. Work stays in your GitHub, agents carry [knowledge](/concepts) forward across runs, and [insights](/concepts) show you exactly how much they're contributing. ## Next steps - **Core concepts** — A fast tour of the vocabulary you'll see throughout Trevize. [Read the tour](/get-started/core-concepts). - **Quickstart** — Connect a repository and start your first task. [Get started](/get-started/quickstart). # Quickstart > Sign up, connect a GitHub repository, and start your first task in a few minutes. Source: https://docs.trevize.dev/get-started/quickstart/ · Markdown: https://docs.trevize.dev/get-started/quickstart/index.md This guide takes you from zero to your first agent-authored pull request. You'll create a workspace, connect a repository, and start a task. > **What you'll need** > > A GitHub account with access to a repository you can connect, and a Claude Code > API token (Trevize uses it to run the coding agent). 1. **Sign up** Create an account and sign in. You can use **email and password**, or **Continue with GitHub** / **Continue with Linear** to sign in with an existing account. If you were invited to a workspace, enter your invite code during sign-up. 2. **Create your workspace** On first sign-in, the getting-started flow walks you through a short setup: 1. **Create workspace** — give it a name; Trevize generates a URL slug (your workspace address) from it. 2. **Choose your style** — pick a light or dark appearance (changeable later). 3. **Invite your team** — optionally add teammates by email (you can skip this). A workspace is your team's home: it owns your connected repositories, members, and billing. When setup finishes you land on your workspace home. 3. **Connect GitHub** From your workspace home, open the **Connect GitHub** card and install the Trevize GitHub App, then authorize the repositories you want to use. This is what lets Trevize **create branches, push code, and open pull requests** on your behalf — so agent work shows up as reviewable PRs in your repo. See the [GitHub integration](/integrations) for details. 4. **Set up Claude Code** Open the **Set up Claude Code** card and add your Claude Code API token. Trevize uses it to run the coding agent that powers tasks and automations. Optionally, **Connect Linear** too, so you can turn issues into work and track it across tools. 5. **Start your first task** Use the prompt card on your workspace home to start a **task**: pick a blueprint (bug fix, feature, or quick change), describe what you want to build, choose a repository and model, and let it run autonomously. > **Working from a spec?** > > For larger work, write a [brief](/concepts/briefs) first, approve it, and start > the implementation from it so the agent works from a reviewed specification. 6. **Review and merge** The agent works in an isolated sandbox, checks out your repository, and implements your request on a branch. When it's ready you get a **pull request** (and often a **live preview**) to review. Leave feedback, request changes, and merge when you're happy — just like any other contributor. ## Where to next - **Concepts** — Understand tasks, automations, briefs, and more in depth. [Explore concepts](/concepts). - **Guides** — Step-by-step walkthroughs for automations, reviews, and more. [Browse guides](/guides). - **Configuration** — Set up hooks and previews with `.trevize/settings.json`. [Configure your repo](/configuration). # Guides > Task-oriented walkthroughs for getting real work done in Trevize. Source: https://docs.trevize.dev/guides/ · Markdown: https://docs.trevize.dev/guides/index.md Guides are practical, step-by-step walkthroughs for the things you'll do most often. Where [Concepts](/concepts) explain *what* something is, guides show you *how* to do it. - [**Create & run an automation**](/guides/automations) — set up an autonomous loop and let it improve your product in the background. - [**Review implementations, previews & UI feedback**](/guides/reviewing-implementations) — inspect what an agent built, preview it live, and leave feedback that the agent acts on. - [**Manage workspace members & billing**](/guides/team-and-billing) — invite teammates and manage your plan. Reach for these once you've connected a repository in [Get started](/get-started). # Create & run an automation > Set up an autonomous loop that runs on a schedule or on friction reports and opens pull requests in the background. Source: https://docs.trevize.dev/guides/automations/ · Markdown: https://docs.trevize.dev/guides/automations/index.md An [automation](/concepts/automations) runs an agent against your repositories on a schedule, or when agents keep reporting the same friction, without anyone present. Use it for recurring maintenance or any goal you want chipped away at over time. This guide sets one up. 1. **Create the automation** Choose **New automation** and fill in: - **Trigger** — **Schedule**, or **Friction reports** when [friction](/guides/friction) is enabled. - **Name** (and an optional **Description**). - **Instructions** — the prompt the agent runs each time (scheduled automations; a friction run's instructions are the friction item's report). - **Repositories** — one or more. Each run checks out all of them; with a single repository you can also pick a **base branch**. - **Blueprint** — the workflow to follow — and an optional **Model**. - **Environment variables** and **Secrets** if the run needs them. 2. **Choose a trigger** **Schedule** runs the automation at set times. Add one or more schedules. For each, pick a **type** — **Hourly**, **Daily**, or **Monthly** — set the time (hour and minute for daily; day-of-month for monthly), and choose a **timezone**. You can add several schedules to one automation. **Friction reports** (when [friction](/guides/friction) is enabled) runs the automation when an open or routed friction item in one of its repositories reaches the **number of reports** you set. The run works in that item's repository with the item's report as its instructions, and moves the item to **Fixing**. Each item runs an automation at most once, and items already past the count when you turn the automation on don't run. 3. **Run it** Save the automation. It will run at the next scheduled time — or choose **Trigger now** to run it immediately. Use **Pause** / **Enable** to turn the schedule off and on; the automation shows its **next run** (or **Paused**). 4. **Review the runs** Each run appears in the automation's **run history**. Every run is a [task/implementation](/concepts/tasks): it follows the blueprint's steps in a sandbox and opens a pull request you review — see [Review implementations](/guides/reviewing-implementations). > **Keep instructions focused** > > Automations run unattended and repeatedly. A tight, well-scoped instruction > produces more predictable pull requests than a broad one. # Collect agent friction > Let agents report the docs, setup and tooling gaps that cost them time, and see which ones keep coming back. Source: https://docs.trevize.dev/guides/friction/ · Markdown: https://docs.trevize.dev/guides/friction/index.md Agents run into the same papercuts again and again: a doc that misses a step, an error that points the wrong way, an install that needs a token nobody mentioned. Friction reports collect them. Every report of the same problem adds to one item, so the count shows what to fix first. Friction reports are in early access: ask us to turn on `friction` for your workspace. ## What a report contains | Field | What goes in it | | --- | --- | | `scope` | `repo` for the code, docs, scripts or config of the repository; `environment` for setup, secrets, services and installs; `trevize` when a Trevize tool or step got in the way | | `title` | A short imperative summary, 8-120 characters | | `whatHappened` | What happened, with the error or output | | `wanted` | What was expected or needed instead | | `reproduction` | The steps or exact command that reproduce it | | `cost` | `minutes`, `retries` and/or a `note` | | `investigation` | Optional preliminary cause | | `relevantFiles` | Optional repo-relative paths | | `tool`, `stepName` | Optional tool or command, and blueprint step | | `agent` | Optional `harness`, `model` and `effort` of the reporting agent. Cloud runs fill in the harness and model themselves | Never put secrets or customer data in a report. ## What gets recorded The server checks every report before recording it, whichever way it was filed. A report is skipped, with a hint for improving it, when: - the reproduction is missing or shorter than 20 characters, - it only describes the reporting session ("I forgot", "my context") and names no tool, file or cause, - `wanted` restates `whatHappened`, or no cost is given, - a `repo` report names nothing in the repository, or a `trevize` report names no tool or step. A skip is guidance, not an error: the agent improves the report and files it again. Reports are matched by scope, repository and title. Titles are compared after removing case, punctuation, numbers, commit SHAs, paths and filler words, so "Typecheck fails at 3f9a2c1" and "typecheck fails at 9b8e7d6" are the same item. A matching report adds one to the item's count and keeps its details. Each item keeps its 50 most recent reports; the count keeps going up after that. An item is `open` until someone resolves or dismisses it. A new report of a resolved or dismissed problem opens a new item, so a regression shows up. ## Filing reports In cloud runs, agents get a `file_friction` tool and are asked to use it before they finish a step. Each call stays visible in the run's timeline. Locally, use the CLI or its MCP server: ```bash trevize friction file \ --scope environment \ --title "bun install needs the registry token" \ --what "bun install exits with 401 from npm.pkg.github.com" \ --wanted "The token documented in the README" \ --repro "Run bun install in a fresh clone without NPM_TOKEN" \ --minutes 15 ``` `--json ` reads the whole report as JSON, and `--dry-run` runs the check locally without sending anything. The repository defaults to the `origin` remote. `trevize mcp` exposes the same as the `file_friction` tool. To teach local agents when and how to file, install the `file-friction` skill into the repository: ```bash trevize skills add file-friction ``` It writes `.agents/skills/file-friction/SKILL.md`, the shared skills folder that works across agents. For an agent that only reads its own folder, pick it with `--dir`, for example `--dir .claude/skills`. `trevize skills add` with no name installs every Trevize skill. An existing skill is kept unless you confirm overwriting it; pass `--yes` to overwrite without asking. ## Reviewing items The **Friction** page in the web app lists the workspace's items, most reported first, with a two-week trend for each. Switch between active, resolved and dismissed items, and filter by status, scope or repository. An item shows its latest report, the average time and retries it costs per report, and its recent reports with the runs they came from and the harness, model and effort of the agent that filed each one. From an item you can: - **Fix with agent**: start a background task on the item's repository with the workspace's bug fix blueprint and the report as its prompt. The item moves to `fixing` and links to the task. - **Create Linear issue**, when an issue tracker is set up. The item moves to `routed` and links to the issue by its key. - **Resolve** or **Dismiss** it. Dismissing needs a reason. - **Reopen** a resolved or dismissed item. If a newer active item already collects the same reports, reopening is refused. From the command line: ```bash trevize friction list --status open --scope repo trevize friction get trevize friction dismiss --reason "Works as intended" trevize friction issue ``` The `/api/v1/friction` routes do the same: `POST /friction` files a report, `GET /friction` lists items most reported first, `GET /friction/{id}` returns an item with its recent reports, and `POST /friction/{id}/status` resolves, dismisses or reopens one. ## Fixing automatically An [automation](/guides/automations) with the **Friction reports** trigger fixes items on its own: when an open or routed item in one of its repositories reaches the number of reports you set, it starts a run on that repository with the item's report and moves the item to **Fixing**. ## Issue tracker Workspace owners and admins can send friction items to Linear under **Settings → Friction**. Issue creation is off until a tracker is picked, and Linear is offered once the workspace has connected it under **Settings → Integrations**. - **Default team** gets every issue, unless **Teams per repository** maps the item's repository to another team. A **Project** is optional. - Every issue gets the `friction` label, created on the team if it doesn't exist. The issue carries the report, its scope, repository and report count. - **Create issues automatically** creates an issue when an open item reaches the set number of reports, for the scopes you pick. Trevize-scope items are never sent automatically. - When an item with an issue is reported again, the issue gets a "seen again" comment, at most once a day. - When the issue is completed in Linear the item is resolved, when it is canceled the item is dismissed, and when it is reopened the item goes back to `routed`. This needs **Issues** events enabled on the Linear app's webhook. `GET /friction/settings` and `PUT /friction/settings` read and change these settings (`PUT` is for owners and admins), and `POST /friction/{id}/issue` creates one item's issue. # Review implementations, previews & UI feedback > Inspect what an agent built, preview it live, leave UI feedback the agent acts on, and merge the pull request. Source: https://docs.trevize.dev/guides/reviewing-implementations/ · Markdown: https://docs.trevize.dev/guides/reviewing-implementations/index.md Whether it came from a [task](/concepts/tasks) or an [automation](/concepts/automations), every piece of agent work lands as a reviewable change. This guide covers reviewing it. 1. **Open the implementation** Open the implementation to see its **status** and progress. While it runs, it shows the **blueprint steps** — *Sandbox setup → Plan → Analyze → Implement → Fix issues → Test → Open PR* — and an **iteration** count, so you can see exactly where it is. 2. **Preview the change** Open the **live preview** to see the change running. If your app exposes more than one process, switch between them; use the address bar to navigate. 3. **Leave UI feedback** On the preview, choose **Add** to leave a **UI feedback** comment pinned to what you see. Each comment is tracked through **open → in progress → resolved** (or **ignored**), supports threaded replies, and the agent can act on it — so review is visual, not just diff-reading. 4. **Review the diff and pull request** Check the **diff** of changed files and the **pull request** on GitHub. From the implementation you can **Open PR** (if there isn't one yet), **Merge**, close, or re-open it; the PR's status is shown throughout. If a merge is blocked by conflicts, ask the agent to **fix conflicts**. 5. **Follow up** When the run reaches a terminal state, send **follow-up instructions** to request changes or fixes. If a step is waiting on you, **approve** it or reply with feedback. With [CI auto-fix](/concepts/workspaces) enabled, a failing CI run can trigger an automatic follow-up that pushes a fix. > **You always merge** > > Trevize opens pull requests; it doesn't merge to your default branch on its own. > Review, request changes, and merge on your terms — just like any contributor. # Label PRs by risk > Classify pull requests as low, medium or high risk and mirror the tier to a risk label on GitHub. Source: https://docs.trevize.dev/guides/risk-labels/ · Markdown: https://docs.trevize.dev/guides/risk-labels/index.md Every pull request in a connected repository can get a risk tier, `low`, `medium` or `high`, mirrored to a `risk:low`, `risk:medium` or `risk:high` label on GitHub. Reviewers see at a glance which PRs need careful eyes. Risk labels are in early access: ask us to turn on `risk_labels` for your workspace. ## How the tier is decided 1. It starts at the proposed tier. With no proposal it starts at `medium`. 2. Every path rule that matches a changed file raises it to that rule's tier. Rules never lower a tier. A rename matches on both its old and new path. 3. A person can override the result. The computed tier is kept alongside it. A diff too large for GitHub to list in full (over 3,000 files) is `high`. The built-in rules raise PRs that touch: | Paths | Tier | Why | | --- | --- | --- | | `migrations/`, `migration/`, `migrate/`, `alembic/`, `flyway/` and `liquibase/` folders, `*.sql`, `schema.prisma`, `schema.rb` | high | Schema or data migration | | `auth/`, `authz/`, `permissions/`, `rbac/`, `oauth/`, `sso/` and `security/` folders (and similar), code files named after auth, permissions, passwords, tokens, secrets or crypto | high | Authentication or authorization | | `billing/`, `payments/`, `checkout/`, `invoices/` and `subscriptions/` folders | high | Billing | | `.github/workflows/`, `.gitlab-ci.yml`, `.circleci/`, `.buildkite/`, `Jenkinsfile`, Azure and Bitbucket pipelines | high | CI pipeline | | `Dockerfile`, Compose files, `Procfile`, `fly.toml`, `vercel.json`, `netlify.toml`, `render.yaml`, `app.yaml` | high | Build and deploy config | | `*.tf`, `*.tfvars`, `*.hcl`, and `terraform/`, `infra/`, `k8s/`, `helm/`, `charts/`, `pulumi/` and `cdk/` folders | high | Infrastructure as code | | `CODEOWNERS` | high | Review and ownership rules | | Dependency manifests and lockfiles (npm, Yarn, pnpm, Bun, pip, Poetry, uv, Go, Cargo, Bundler, Composer, Maven, Gradle, NuGet, Mix) | medium | Dependency change | Settings → Risk labels shows the exact globs. Add the paths that matter in your own codebase as workspace rules. ## Add your own rules Go to **Settings → Risk labels** in the app. Workspace owners and admins can: - add path rules, each with a glob, a tier (`medium` or `high`) and a reason shown with the assessment, - turn the built-in rules off. Rules apply to every repository in the workspace and only ever raise a tier. ## Check every PR automatically Turn on **GitHub checks** under **Settings → Risk labels** to classify every pull request in your connected repositories, including PRs your team opens without Trevize. No CI setup is needed. Each time a PR is opened, reopened or pushed to, Trevize: - classifies it with your workspace rules, - adds or updates a **Trevize risk** check on the latest commit, with the tier and the rules that raised it, - updates its `risk:*` label. The check is informational: it always completes as neutral, so it never blocks a merge. Workspace owners and admins can turn checks on once GitHub is connected. The Trevize GitHub App needs the **Checks** permission to add the check. If a repository's installation has not approved it yet, the PR still gets its label, and the CLI reports that the check was not updated. ## Classify a PR From a laptop, a local agent session or CI: ```bash trevize risk classify https://github.com/acme/app/pull/123 trevize risk classify # the open PR for the current branch trevize risk classify --propose low --rationale "Copy change in the footer only" ``` The server fetches the PR's changed files and your workspace's rules, stores the tier and applies the label. `--no-label` stores without labeling and `--dry-run` only prints. Exit code 3 means the repository is not connected to your workspace. Every `trevize risk` command needs a login (`trevize login`) or an API key. To classify PRs from your own CI instead of turning on GitHub checks, add a step with a `TREVIZE_API_KEY` secret. The CLI runs on Node, so it works on GitHub-hosted runners without installing Bun: ```yaml - run: npx -y trevize risk classify "${{ github.event.pull_request.html_url }}" env: TREVIZE_API_KEY: ${{ secrets.TREVIZE_API_KEY }} TREVIZE_WORKSPACE_ID: ${{ vars.TREVIZE_WORKSPACE_ID }} ``` Local agents can use the `classify_risk` and `get_risk` tools of `trevize mcp`. An agent may propose a tier but never override one. After the first classification, every push to the PR re-classifies it. ## Override Add a risk label on GitHub, or run: ```bash trevize risk set https://github.com/acme/app/pull/123 --tier high --reason "Touches the export job" trevize risk set https://github.com/acme/app/pull/123 --clear ``` A person adding a label overrides the tier with their GitHub login; if several are added at once, the highest wins. Removing the only risk label goes back to the computed tier. For a PR opened by a Trevize task, the override applies to every PR of that task. # Manage workspace members & billing > Invite teammates, assign roles, and manage your plan, invoices, and workspace-wide settings. Source: https://docs.trevize.dev/guides/team-and-billing/ · Markdown: https://docs.trevize.dev/guides/team-and-billing/index.md Your [workspace](/concepts/workspaces) owns your team and your plan. This guide covers inviting members and managing billing. ## Invite and manage members 1. **Invite people** On the **Members** page, choose **Invite people**, enter one or more email addresses, and pick a **role**. Invited users appear with an **invited** tag until they accept. 2. **Manage existing members** From a member's menu you can **change their role**, **resend** or **cancel** an invitation, or **remove** them from the workspace. > **Seats are plan-gated** > > Inviting people is limited by your plan's seat count. When you hit the limit, > Trevize prompts you to upgrade before adding more. ## Manage billing 1. **View your plan** The **Billing** page shows your current plan and renewal date (or trial status). Use **Update plan** to change plans and **Manage billing** for payment details. 2. **Set a billing email and get invoices** Set the **billing email** that invoices are sent to, and review past **invoices** — each shows its date, status, and amount, with a link to view it. ## Workspace settings Beyond members and billing, workspace settings let you set the workspace **name**, **URL**, and **logo**, choose **commit attribution** (attribute commits to Trevize or to the user who started the work), and toggle **CI auto-fix**. See [Workspaces](/concepts/workspaces) for what each setting does. # Integrations > Connect Trevize to the tools your team already uses — source control, issue tracking, agents, databases, and observability. Source: https://docs.trevize.dev/integrations/ · Markdown: https://docs.trevize.dev/integrations/index.md Trevize connects to the services your team already relies on. Integrations let agents read context, open pull requests, spin up previews, and wire real data into sandboxes. - [**GitHub**](/integrations/github) — connect repositories; agents open branches and pull requests. - [**Linear**](/integrations/linear) — turn issues into briefs and track work across tools. - [**Claude Code**](/integrations/claude-code) — the coding agent that powers tasks and automations. - [**MCP**](/integrations/mcp) — connect Claude Code to Trevize's knowledge and actions. - [**Neon**](/integrations/neon) — provision an isolated Postgres branch per run. - [**Sentry**](/integrations/sentry) — turn new issues into automatic bugfix implementations. - [**Supabase**](/integrations/supabase) — provision an isolated Supabase preview branch per run. Each integration page covers what it enables, how to connect it, and how it maps into a task or automation. Many integrations are also wired through `.trevize/settings.json` — see [Configuration](/configuration). # Claude Code > Add your Claude Code access token so Trevize runs the coding agent under your account. Source: https://docs.trevize.dev/integrations/claude-code/ · Markdown: https://docs.trevize.dev/integrations/claude-code/index.md **Claude Code** is the coding agent that powers Trevize [tasks](/concepts/tasks) and [automations](/concepts/automations). Adding your access token lets the workspace run implementations under your own Claude Code account. ## Add your access token Claude Code connects with an access token you generate yourself. 1. **Generate a token** In your terminal, run: ```bash claude setup-token ``` This produces a long-lived Claude Code OAuth token. 2. **Save it in Trevize** In integration settings, paste the token into the **access token** field and choose **Save**. The status changes to **Connected**, and the token is stored and used for implementations in this workspace. Use **Update** to replace it later. ## Disconnecting Choose **Disconnect** to remove the token from the workspace. Implementations then fall back to the platform default token. > **Why connect your own token** > > Running under your own Claude Code token means agent usage is tied to your > account. If no token is set, Trevize uses a platform default instead. # GitHub > Connect repositories so agents can branch, push code, and open pull requests. Source: https://docs.trevize.dev/integrations/github/ · Markdown: https://docs.trevize.dev/integrations/github/index.md GitHub is the backbone of Trevize. Connecting it lets Trevize **sync your repositories and issues** and gives agents what they need to **create branches, push code, and open pull requests** — so every piece of agent work lands as a PR you review. ## Connect GitHub You connect GitHub by installing the **Trevize GitHub App** and authorizing the repositories it can access. 1. **Install the app** From your workspace's integration settings, choose **Install GitHub App** (or **Add account** if you've already connected one). You'll be taken to GitHub to pick an account or organization and select which repositories to grant access to. 2. **Approve, if required** If you install into an organization, an org admin may need to approve the installation first. Trevize will let you know it's pending — once approved, the account becomes available. 3. **Manage connected accounts** Connected accounts appear under **Connected Accounts**, each showing the account, its type (user or organization), a **Configure** link (which opens the installation's settings on GitHub, where you can change repository access), and a control to remove it. You can connect more than one account. ## How it's used Once connected, GitHub repositories are selectable when you start a [task](/concepts/tasks) or an [automation](/concepts/automations). Agents work on a branch and open a pull request; the run tracks the PR's status (open, draft, merged, closed) with a link back to GitHub. > **Scope access deliberately** > > You control exactly which repositories the GitHub App can touch. Grant access > to only the repos you want Trevize to work in, and adjust it anytime from > **Configure**. # Linear > Connect Linear to turn issues into work — @mention the agent, auto-generate briefs, and handle issue assignments. Source: https://docs.trevize.dev/integrations/linear/ · Markdown: https://docs.trevize.dev/integrations/linear/index.md Connecting **Linear** lets your team drive Trevize from the issue tracker you already use. Once connected, Trevize can **respond to `@trevize` mentions**, **automatically generate [briefs](/concepts/briefs) from issues**, and **handle issue assignments** — bridging planning in Linear and building in Trevize. ## Connect Linear Linear connects over OAuth. 1. **Authorize** From integration settings, choose **Connect Linear**. A popup opens where you authorize Trevize to access your Linear workspace. 2. **Confirm the connection** When it succeeds, the **connection status** shows **Connected**. Trevize can now receive webhooks from Linear, respond to `@trevize` mentions, and process issue assignments. ## Managing the connection - **Reconnect** — re-authorize or switch to a different Linear workspace. - **Disconnect** — remove the connection from this workspace. Webhooks and `@trevize` mentions stop working. > **From issue to implementation** > > Mention `@trevize` or assign an issue, and Trevize can turn it into a brief and > an [implementation](/concepts/tasks) — keeping the work and its context linked > back to Linear. # MCP > Connect Claude Code to Trevize's knowledge and actions through the Trevize MCP server. Source: https://docs.trevize.dev/integrations/mcp/ · Markdown: https://docs.trevize.dev/integrations/mcp/index.md Trevize ships a **Model Context Protocol (MCP)** server that connects Claude Code — running in your own terminal or editor — to your Trevize workspace. With it, your local agent can search your project's [knowledge](/concepts/knowledge), save observations, and even kick off [implementations](/concepts/tasks). ## What it gives Claude Code Once configured, these tools are available in your Claude Code session: - `search(query)` — search your project's knowledge. - `smart_search(query)` — semantic search across your code and knowledge. - `write_observation(content)` — save an observation back to Trevize. - `start_implementation(briefId)` — trigger an implementation. - `migrate_claude_mem()` — import existing Claude memory. ## Set it up 1. **Create an API key** The MCP server authenticates with an **API key**. Create one in your account settings (**API keys**) and keep it handy. 2. **Point Trevize at your project** Make sure your repository has a Trevize settings file with your `workspaceId` and `projectId` (the `projectId` can be auto-detected from your git remote). See [Configuration](/configuration) for the full settings file. 3. **Add the server to .mcp.json** Add the Trevize server to your project's `.mcp.json`: ```json { "mcpServers": { "trevize": { "command": "npx", "args": ["-y", "trevize@latest", "mcp"], "env": { "TERVEZO_API_KEY": "your-api-key" } } } } ``` Replace `your-api-key` with the key from the first step. 4. **Verify** Start a Claude Code session and run `search("test")`. If it returns, the server is connected. > **Two directions** > > The MCP integration connects *your* local Claude Code to Trevize. Inside Trevize > tasks and automations, agents already run against your connected repositories > — MCP brings that same knowledge and those actions to your own machine. # Neon > Give every run its own isolated Neon Postgres branch, wired into the sandbox through .trevize/settings.json. Source: https://docs.trevize.dev/integrations/neon/ · Markdown: https://docs.trevize.dev/integrations/neon/index.md Connecting **Neon** lets Trevize provision an **isolated Postgres branch for every run**. Each run gets a fresh read-write branch of your Neon project — so agents (and previews) work against real data without touching production — and the branch is torn down when the run's sandbox is cleaned up. ## Connect Neon 1. **Add a Neon API key** In integration settings, paste a **Neon API key** (it starts with `napi_`). For security, prefer a **project-scoped** key (Neon console → Organization settings → API keys); account-wide keys work too but grant access to all projects. For a project-scoped key, also enter its **Project ID**. 2. **Choose the project and branch** Once connected, pick the **project** runs should branch from and, optionally, a **parent branch** (each run branches from it; leave empty to use the project's default). Save the configuration. ## Use it in a repository Tell a repository to use Neon by declaring the resource in its [`.trevize/settings.json`](/configuration), mapping your app's database environment variable to the one Trevize provides: ```json { "resources": { "neon": { "env": { "DATABASE_URL": "NEON_DATABASE_URL" } } } } ``` For each run, Trevize provisions a branch and injects `NEON_DATABASE_URL` (the branch's connection string) and `NEON_BRANCH_ID` into the sandbox. The mapping above sets your app's `DATABASE_URL` from `NEON_DATABASE_URL`. The settings page shows, per repository, whether the resource is **configured** and the env mapping in effect. > **Let an agent wire it up** > > The Neon settings page can copy a setup prompt that detects your app's actual > Postgres environment variable and generates the correct `resources` block for > you. See [Resources configuration](/configuration) for the details. # Sentry > Connect Sentry so new issues automatically start bugfix implementations. Source: https://docs.trevize.dev/integrations/sentry/ · Markdown: https://docs.trevize.dev/integrations/sentry/index.md Connecting **Sentry** closes the loop from error to fix: when a new issue is reported to Sentry, Trevize can **automatically start a bugfix [implementation](/concepts/tasks)** — so regressions get a proposed fix as a pull request without anyone filing a ticket. ## Connect Sentry Sentry connects over OAuth. 1. **Authorize** From integration settings, choose **Connect Sentry**. A popup opens where you authorize Trevize to access your Sentry organization. 2. **Confirm** When it succeeds, the status shows **Connected**. New Sentry issues will now automatically trigger bugfix implementations. ## Managing the connection - **Reconnect** — re-authorize or switch Sentry organizations. - **Disconnect** — stop new issues from triggering implementations. > **Workspace-level** > > Unlike [Neon](/integrations/neon) or [Supabase](/integrations/supabase), Sentry > isn't provisioned per run — it's a workspace-level trigger that turns incoming > issues into work. # Supabase > Give every run its own isolated Supabase preview branch, wired into the sandbox through .trevize/settings.json. Source: https://docs.trevize.dev/integrations/supabase/ · Markdown: https://docs.trevize.dev/integrations/supabase/index.md Connecting **Supabase** lets Trevize provision an **isolated preview branch for every run** — its own branch of your Supabase project's database — so agents and previews work against realistic data. The branch is torn down when the run's sandbox is cleaned up. > **Requires branching** > > Supabase branching requires a paid Supabase plan with branching enabled on the > project you connect. ## Connect Supabase 1. **Authorize** Choose **Connect Supabase**. A popup opens where you authorize Trevize with your Supabase organization and pick which organization to grant access to. 2. **Choose a project** Once connected, select the **project** runs should branch from and save the configuration. Use **Reconnect** to switch organizations, or **Disconnect** to stop provisioning branches. ## Use it in a repository Declare the resource in a repository's [`.trevize/settings.json`](/configuration), mapping your app's database environment variable to the one Trevize provides: ```json { "resources": { "supabase": { "env": { "DATABASE_URL": "SUPABASE_DATABASE_URL" } } } } ``` For each run, Trevize provisions a preview branch and injects `SUPABASE_DATABASE_URL`, `SUPABASE_BRANCH_ID`, and `SUPABASE_BRANCH_REF` into the sandbox. The mapping above sets your app's `DATABASE_URL` from `SUPABASE_DATABASE_URL`. The settings page shows, per repository, whether the resource is **configured** and the env mapping in effect. > **Let an agent wire it up** > > The Supabase settings page can copy a setup prompt that detects your app's > actual Postgres environment variable and generates the correct `resources` > block. See [Resources configuration](/configuration). # Reference > Exhaustive lookups — the full .trevize/settings.json field reference and a glossary of platform terms. Source: https://docs.trevize.dev/reference/ · Markdown: https://docs.trevize.dev/reference/index.md Reference material you keep open in a second tab while you work. - [**`settings.json` field reference**](/reference/settings-reference) — every field in `.trevize/settings.json`, its type, whether it's required, and what it does. - [**Glossary**](/reference/glossary) — concise definitions of the terms used throughout these docs. Looking for explanations rather than lookups? Start with [Concepts](/concepts) or the guided [Configuration](/configuration) pages. # Glossary > Concise definitions of the terms used throughout the Trevize documentation. Source: https://docs.trevize.dev/reference/glossary/ · Markdown: https://docs.trevize.dev/reference/glossary/index.md Short definitions of the terms you'll see across these docs, with links to the full explanations. | Term | Meaning | | ---- | ------- | | **Automation** | An autonomous loop bound to a repository and a schedule that spawns implementations without anyone present. See [Automations](/concepts/automations). | | **Blueprint** | The workflow template a run follows. Task blueprints include *bug fix*, *feature*, and *quick change*. | | **Brief** | A reviewed specification an agent works from (`draft → approved → archived`). See [Briefs](/concepts/briefs). | | **Hook** | A command run at a sandbox lifecycle point. The `SandboxReady` hook runs setup after the sandbox is ready. See [Hooks](/configuration/hooks). | | **Implementation** | One autonomous run that takes a task from plan to pull request. See [Tasks & implementations](/concepts/tasks). | | **Insights** | Workspace analytics on pull-request activity, Trevize's contribution, and cost. See [Insights](/concepts/insights). | | **Integration** | A connected external service (GitHub, Linear, Claude Code, MCP, Neon, Sentry, Supabase). See [Integrations](/integrations). | | **Knowledge** | Durable observations agents capture as they work, searchable by later runs. See [Knowledge & memory](/concepts/knowledge). | | **MCP** | Model Context Protocol — the Trevize MCP server connects Claude Code to your workspace. See [MCP](/integrations/mcp). | | **Observation** | A single unit of captured [knowledge](/concepts/knowledge) (decision, bug fix, feature, refactor, discovery, or change). | | **Preview** | A live, running view of your app served from the sandbox. Configured with [preview targets & processes](/configuration/preview). | | **Preview process** | One command + port within a preview target (e.g. `web`, `api`). | | **Preview target** | A named group of processes that together form a previewable app. | | **Pull request** | The GitHub PR every run produces for you to review and merge. | | **Resource** | A managed dependency (e.g. a database branch) provisioned per run and mapped into the sandbox. See [Resources](/configuration/resources). | | **Run** | A single autonomous execution of agent work, such as an implementation or an automation run. | | **Sandbox** | The isolated cloud environment where an agent checks out your repo and works. | | **Task** | A single unit of work that runs autonomously to a pull request; realized as an [implementation](/concepts/tasks). | | **UI feedback** | Comments pinned to a live [preview](/configuration/preview) that the agent can act on. See [Reviewing implementations](/guides/reviewing-implementations). | | **Workspace** | Your team's boundary — it owns repositories, members, and billing. See [Workspaces](/concepts/workspaces). | # settings.json reference > Field-by-field reference for .trevize/settings.json — every key, its type, whether it's required, and what it does. Source: https://docs.trevize.dev/reference/settings-reference/ · Markdown: https://docs.trevize.dev/reference/settings-reference/index.md A complete reference for [`.trevize/settings.json`](/configuration/settings-json). For explanations and examples, see the [Configuration](/configuration) guides. ## Top-level | Field | Type | Required | Description | | ------------- | -------- | -------- | --------------------------------------------------------------------------- | | `$schema` | string | no | JSON schema URL, for editor autocomplete and validation. | | `workspaceId` | string | no | The Trevize workspace this project belongs to (used by the [MCP](/integrations/mcp) server). | | `projectId` | string | no | The `org/repo` identifier. Can be auto-detected from the git remote. | | `hooks` | object | no | Lifecycle hook commands. See [`hooks`](#hooks). | | `preview` | object | no | Preview targets and processes. See [`preview`](#preview). | | `resources` | object | no | Managed resource declarations. See [`resources`](#resources). | The file is read from `.trevize/settings.json` (canonical) or the legacy `.tervezo/settings.json` (deprecated fallback). ## `hooks` Commands run at sandbox lifecycle points. See [Hooks](/configuration/hooks). | Field | Type | Required | Description | | -------------------- | ----------------------- | -------- | ------------------------------------------------------- | | `hooks.SandboxReady` | array of hook entries | no | Commands run **in order** once the sandbox is ready. | | `…[].command` | string | yes | The shell command to run. | | `…[].env` | map of name → value | no | Literal env vars for this command. | | `…[].secretEnv` | map of name → secret key | no | Env vars resolved from [workspace secrets](/configuration/secrets). | `SandboxReady` is currently the only supported hook event. A resolved secret overrides a run-resource variable of the same name, which overrides plain `env`. ## `preview` Declares how to serve your app. See [Preview](/configuration/preview). | Field | Type | Required | Description | | ----------------------- | ----------------------- | -------- | ------------------------------------------------------- | | `preview.targets` | map of name → target | yes | Named preview targets. | | `preview.defaultTarget` | string | no | Target to launch by default. Must exist in `targets`. | ### Target A target uses **either** a `processes` array **or** the single-process `command` + `port` shorthand. | Field | Type | Required | Description | | ---------------- | ----------------------- | ----------- | ------------------------------------------------------------- | | `processes` | array of process | conditional | Processes for a multi-process target. | | `defaultProcess` | string | no | Process shown by default. Must match a process `name`. | | `command` | string | conditional | Shorthand: command for a single-process target. | | `port` | number | conditional | Shorthand: port for a single-process target (1–65535). | | `cwd` | string | no | Working directory shared by all processes in the target. | | `env` | map of string → string | no | Literal env vars shared by all processes. | | `secretEnv` | map of string → string | no | Secret env vars (var → workspace secret key) for all processes. | ### Process | Field | Type | Required | Description | | ----------- | ----------------------- | -------- | ------------------------------------------------------- | | `name` | string | yes | Unique name within the target (e.g. `web`, `api`). | | `command` | string | yes | Shell command to start the process. | | `port` | number | yes | Port the process listens on (1–65535). | | `cwd` | string | no | Working directory, relative to the sandbox home. | | `env` | map of string → string | no | Literal env vars (merged on top of the target's `env`). | | `secretEnv` | map of string → string | no | Secret env vars, resolved from workspace secrets. | See [Secrets](/configuration/secrets) for mapping examples, process-level scoping, precedence, and troubleshooting. ### Interpolation variables `env` values may reference `${VAR}`: | Variable | Description | | -------------------------- | ------------------------------------------------------- | | `${PREVIEW_URL}` | The preview's base URL. | | `${PREVIEW_HOST}` | The preview's host. | | `${PREVIEW_URL_}` | A specific process's URL (uppercase process name). | | `${PREVIEW_HOST_}`| A specific process's host. | | resource variables | e.g. `${NEON_DATABASE_URL}` — see [`resources`](#resources). | ## `resources` Declares managed resources to provision per run. See [Resources](/configuration/resources). | Field | Type | Required | Description | | ----------------------- | ----------------------- | -------- | ---------------------------------------------------------------- | | `resources.` | object | no | Keyed by integration id (`neon`, `supabase`). | | `resources..env` | map of string → string | no | Maps `` → ``. | ### Provided variables | Resource | Injected variables | | ---------- | ------------------------------------------------------------------- | | `neon` | `NEON_DATABASE_URL`, `NEON_BRANCH_ID` | | `supabase` | `SUPABASE_DATABASE_URL`, `SUPABASE_BRANCH_ID`, `SUPABASE_BRANCH_REF` |