Skip to main content
A template is a single orgo.ai/v1 document, written in YAML or JSON. This page is the field-by-field reference. The canonical machine-readable contract is the JSON Schema at GET /api/template-schema. Point your editor at it for autocomplete and inline validation.
The published JSON Schema describes the canonical form only. It requires api_version and template, and it rejects unknown top-level keys. An editor validating against it therefore flags every sugar document as invalid on two counts. Sugar is desugared server-side, so check a sugar template with Validate template instead of relying on editor validation.

Two forms

Templates accept a canonical form and a shorter sugar form. Both normalize to the same document and the same digest.

Sugar → canonical

A canonical block always wins: if a document sets both hardware.cpu and top-level cpu, the hardware value is used and the sugar key is ignored. ram and disk accept 4gb, 4g, or a bare 4; a sub-gigabyte size such as 512mb resolves to 0, which is the same as omitting it.

Top-level fields

Every field except api_version and template is optional, so the smallest valid template is a name, a version, and the API version.

template

Identity and provenance. name and version are required.

hardware

The computer’s resource shape. Every field is optional; omit one and the platform default applies. A Create computer request overrides these at launch.

vars and interpolation

vars are compile-time strings, interpolated across the document before build.
  • ${var.X} resolves from vars.
  • ${env.X} resolves from a literal env value (not secret-backed ones).
  • $${var.X} escapes to a literal ${var.X}.
  • An unknown reference is a validation error with the exact field path.

env

Environment variables written to the computer. Keys must be UPPER_SNAKE_CASE. Each value is a literal string, or a {secret: <name>} reference resolved from the launching user’s vault at create time. A value cannot be both.
A {secret: …} reference to a name you never declared under secrets is a validation error (unknown_reference). See Secrets for the full secret-injection model.

build

Package and command steps run once when baking the golden snapshot, before app installs. This is where dependencies get pre-installed so launches are instant.

files

Files materialized into the computer. Each entry sets exactly one of from or inline. Setting both, or neither, is a validation error.
to must be an absolute path with no ... Reserved system paths are rejected: /proc, /sys, /boot, /dev, /tmp, /run, plus the Orgo runtime (/etc/orgo, /var/orgo, /orgo, /etc/supervisor, and Orgo’s own binaries under /opt and /usr/local/sbin). Your apps can still write under /opt and elsewhere. Only Orgo’s own runtime files are off-limits.

apps

An app bundles an install step with the long-running services, health checks, and ports it needs. Services are managed by supervisord, so they start at boot and respawn on crash.
App name is required and must be unique kebab-case. requires lists other app names this one depends on, and data lists persistent data paths, validated the same way as files[].to.

services

health

A polled liveness check. After retries consecutive failures, on_fail runs. This is the per-app watchdog. type is required; the other fields are optional. every defaults to 30s, timeout to 5s, and retries to 3. All durations are Go duration strings (30s, 2m, 1h). on_fail is one of restart_service:<name>, restart_vm, alert, or none.

ports

terminal

Pre-staged tmux sessions, created detached at first boot. Orgo’s browser terminal attaches to them by name. name is required and must be unique.
Sessions are not auto-restarted. For a process that must respawn, use an app service instead.

hooks

Shell that runs at lifecycle points. Each runs with set -e; the default timeout is 10 minutes per hook.
Launching a built template is a golden-snapshot restore, and a restore never re-runs the cold-boot init. on_first_boot and on_every_boot fire only on a cold boot, which for a built template means the build itself. Neither runs on a normal launch. on_resume is the only hook that runs on every launch.
on_resume is the right place for per-computer work that depends on launch-time state, like a freshly injected secret. See Secrets. Work that should be baked into the image belongs in build or an app’s install, not in a boot hook.

telemetry

egress_policy

Per-computer network filtering, enforced on the host. Both mode and rules are required when the block is present.
Rules are domain patterns, exact domains, IPs, or CIDRs. Domain patterns match at the DNS layer, so *.github.com also covers subdomains. The VNC and Desktop API paths are always reachable. Omit the block entirely for no filtering.

streaming

Outbound RTMP(S) streams of the desktop. name, url, and key are required; url must start with rtmp:// or rtmps://.
streaming is parsed and validated today; the runtime streamer is rolling out. Track status in the JSON Schema.

Next steps

Secrets

The full secret-injection model.

Triggers

Sources, actions, and dedup.

Examples

Annotated real templates.

Publish API

Ship a template over HTTP.