What it does
A preview.yaml file connects the frontend, API, setup jobs, and databases. Previewhost starts each service after its dependencies are ready. It assigns local URLs. It separates each environment's ports and managed data. You choose the commands and readiness checks. Environment variables can be bound to services, selected host inputs, or stored secret references. For stored secrets, your agent declares the secret references and the services that need them. You approve access and enter missing values in a private form outside your agent chat. Services receive approved values at startup. Install it with npm install -g previewhost, which requires Node.js 22.23 or later. You can then use the CLI or connect your coding agent over MCP.
Capabilities
- Runs environments for different worktrees side by side, each with separate ports, local URLs, and managed database data.
- Combines frontend and API source directories from different repositories in one environment, even when their branch names differ.
- Shows frontend, API, and setup-job output in one log view that can be filtered by source or attempt.
- Supports HTTP services, managed or existing local PostgreSQL and Redis, and setup jobs that run to completion. Managed databases require local Docker and downloaded images.
- Accepts a saved preview.yaml, JSON passed to the CLI, or a configuration supplied by your agent.
When to use it
- You need to run a frontend, API, and databases together on your own machine.
- You need environments for different worktrees running side by side.
- You need to combine existing source directories from different repositories in one environment.