What the definition is for
When a Roomote agent starts a task, the sandbox provider gives it a clean sandbox. The environment definition is what turns that empty sandbox into a workspace grounded in your product. It is applied in a predictable order:- shared workspace tool versions are installed
- requested services (databases, caches) are started while repositories clone
- configured Docker projects are built and started from cloned repositories
- each repository’s setup commands run, in order
- named ports become live previews, and agent instructions are attached to every task
Relationship to Dev Containers
If you have used Dev Containers, the environment definition will feel familiar. Both describe a development workspace as a version-controllable, declarative file so that anyone (or any agent) gets the same setup. The concepts map closely:
The important difference: Roomote uses its own schema and does not read
devcontainer.json. The comparison is conceptual. If a repository already has
a Dev Container, treat it as a reference for which tools, services, and commands
matter, then express those in the environment definition described below. For
the Dev Container spec itself, see the
Dev Container specification and the
metadata reference rather
than duplicating them here.
A complete example
The definition below is a self-contained example that uses most of the available fields. Every field is explained in the reference sections that follow.Top-level fields
Basics
name is the only required top-level scalar. description and initialUrl are
optional but recommended: initialUrl is the URL the shared preview surface
opens first, so point it at the app entry a reviewer would expect, for example
http://127.0.0.1:3000. Use about:blank when there is no default page.
Repositories
repositories is a required list with at least one entry. Each repository is
cloned onto the shared workspace.
Keep the first environment focused. One repository, or a small set that must be
cloned together, sets up faster and is easier to debug than a large multi-repo
environment.
All repositories in one environment must belong to the same source-control
installation.
Commands
Each entry in a repository’scommands list runs in order after the repository
is cloned. Commands are the durable setup steps a teammate would run after
cloning: installing dependencies, generating code, running migrations, and
starting long-running services.
Guidance:
- keep commands focused on setup, not final verification. Put “run the tests
before finishing” expectations in
agentInstructionsinstead. - use
detached: truewith alogfilefor servers such aspnpm dev, so the process keeps running and its output is debuggable. - use
continue_on_error: trueonly for helpful-but-optional steps. If the app cannot run without a command, let it fail so the problem is visible.
Services
services starts managed dependencies before repository setup runs. Each entry
is either a service name string or an object with a name and a custom port.
Supported services:
Docker projects
docker_projects runs Docker Compose or Dockerfile definitions already owned
by a configured repository. Roomote validates the Compose model, builds images,
starts services with docker compose up --wait, and treats startup as required
unless required: false is set.
Common fields:
For
type: compose, files is a required list of relative Compose file paths.
Optional profiles enables Compose profiles, and optional services limits
startup to those services. Each port mapping requires named_port, service,
and container_port.
type: dockerfile, Roomote generates a one-service Compose project.
context defaults to ., dockerfile defaults to Dockerfile, and target,
build_args, and command are optional. Dockerfile port mappings omit
service because the generated service is implicit.
Ports
ports declares the human-facing application URLs Roomote should expose as
live previews. Each named port gets
a preview URL and a corresponding ROOMOTE_<NAME>_HOST environment variable
inside the sandbox.
Limits: at most 10 proxied ports and at most 2 non-proxied ports per
environment.
Environment variables and tool versions
env provides workspace-level variables that every task can read. These are
workspace variables for the code Roomote is working on, distinct from the
deployment environment variables that configure
Roomote itself. Secrets are typically added through the editor rather than
committed to a definition you share.
Tool versions can be set at two levels:
tool_versionsat the top level installs tools at the shared workspace root via mise. Use this for workspace-level scripts, shared MCP servers, or as a broad fallback.tool_versionson a repository provides fallbacks for a single repository.
.tool-versions stays
authoritative. Environment-configured versions are fallbacks that fill in
missing tools; they do not override repository-owned pins.
Agent instructions
agentInstructions is guidance delivered to every task in the environment.
Good guidance is specific, durable, and tied to the workspace:
MCP servers
mcpServers adds environment-specific MCP servers that are
merged with built-in tools when a task starts. Each entry is either a streamable
HTTP server (url, optional headers) or a stdio server (command, optional
args and env).
Skills
skills installs published skills by source, keyed by owner/repo. The value
is either all or a list of specific skill names.
manualSkills defines inline skills directly in the environment. Each entry
needs a unique name, a description, and content with the skill
instructions.
OIDC
oidc declares sandbox OIDC targets. Roomote mints the tokens, writes them into
the sandbox filesystem, and refreshes them while the sandbox is active. Use
aws for an AWS role and custom for additional audiences.
token_file must be an absolute path and must be unique across targets.
Write a definition with a coding agent
Because this page fully describes the schema, you can have a local coding agent generate a definition as an alternative to the in-app setup agent. A reliable approach:- give the agent this page as context, along with the repository you want to set up
- ask it to infer the tools, services, setup commands, and preview ports from
the repository’s own README, package manifests, lockfiles, CI config, and any
existing
devcontainer.json - have it emit a single YAML document that matches the schema above, starting
from
nameandrepositories - paste the result into the YAML view when you create or edit an environment in Settings > Environments