izcode.toml
izcode.toml tells a cloud workspace which language runtimes to install, how to set up and build your project, which services to run, and what a release does before it takes traffic. This page lists every key, its type, its default and its limits.
Where the file lives#
Put izcode.toml at the root of the cloud workspace folder, /workspace/izcode.toml. The workspace reads it when it starts and checks it again every few seconds, so a saved change applies without a restart:
- A new service starts, a removed service stops and a service whose definition changed restarts.
- A file that is not valid TOML, is larger than 256 KiB, declares more than 16 services or has an unknown
versionis rejected as a whole. The services that were running stay as they were. - Any other problem affects only its own section. An invalid service is not started (state Invalid) and the others run. An invalid
[runtime]or[setup]keeps the workspace's services from starting until you fix it, and an invalid[runtime],[build]or[release]fails a release.
To start a file, run Cloud: Create izcode.toml from the Command Palette. It detects your project and writes a version 2 file; see Framework guides.
Version 1 and version 2#
| Version 1 | Version 2 | |
|---|---|---|
| How to choose it | No version key, or version = 1 | version = 2 at the top |
| Sections | [setup], [services.*] | Also [runtime], [build], [release], [cron.*], [env.dev], [env.prod] |
| Service keys | command, cwd, port, env, restart, public, health | Also kind, dir, spa |
| In a release | Services start as soon as the release boots | Runtime, build and release steps run first; traffic moves only when the services are healthy |
version must be an integer, 1 or 2. Using a version 2 section in a version 1 file is reported as an error, for example `build` needs `version = 2` at the top of izcode.toml. Use version 2 for anything you plan to release.
Annotated example#
version = 2
[runtime] # language versions (installed with mise) and apt packages
python = "3.12" # versions are strings: 3.10 as a number would become 3.1
node = "22"
packages = ["libpq-dev"]
[setup] # workspace only: install dependencies
command = "uv sync --frozen"
watch = ["uv.lock"] # setup runs again when one of these files changes
[build] # release only, before the services
command = "uv run --no-sync python manage.py collectstatic --noinput"
env = { DJANGO_SETTINGS_MODULE = "app.settings" }
[release] # release only, once, after the build: migrations
command = "uv run --no-sync python manage.py migrate --noinput"
timeout = "5m"
[services.web] # kind = "web" is the default: a process that listens on a port
command = "uv run --no-sync gunicorn app.wsgi --bind 0.0.0.0:$PORT"
port = 8000
public = true # served at the host URL
health = { http = "/healthz", interval = "10s", grace = "60s" }
[services.worker]
kind = "worker" # no port
command = "uv run --no-sync celery -A app worker"
restart = "on-failure"
[services.docs]
kind = "static" # a built folder served by the workspace itself
dir = "site/out"
spa = true
port = 8081
[cron.cleanup] # release only, UTC
schedule = "0 3 * * *"
command = "uv run --no-sync python manage.py clearsessions"
[env.dev] # merged over the file in the workspace
services.web.command = "uv run --no-sync python manage.py runserver 0.0.0.0:$PORT"
[env.prod] # merged over the file in a release
services.web.env = { DJANGO_DEBUG = "0" }Top-level keys#
| Key | Type | Version | Notes |
|---|---|---|---|
version | integer | 1, 2 | 1 when missing |
runtime | table | 2 | See [runtime] |
setup | table | 1, 2 | See [setup] |
build | table | 2 | See [build] |
release | table | 2 | See [release] |
services | table of tables | 1, 2 | At most 16 services |
cron | table of tables | 2 | At most 16 jobs |
env | table | 2 | Only env.dev and env.prod |
Any other top-level key is an error.
[runtime]#
Each key except packages is a tool name for mise and its value is the version to install. Packages are installed with apt first, then the tools.
| Key | Type | Default | Limits |
|---|---|---|---|
<tool> | string (a non-negative integer is accepted) | none | Name: 1–40 characters, lowercase letters, digits, - and _, starting with a letter or digit. Version: 1–64 characters of letters, digits, ., _, +, -, starting with a letter or digit, for example "22", "3.12", "lts", "latest", "temurin-21". Decimal numbers are refused. At most 16 tools. |
packages | array of strings | [] | At most 64 Debian package names: 2–100 characters of lowercase letters, digits, +, ., -, starting with a letter or digit. No version pins or options. |
The runtime step has a 30-minute timeout. In a workspace it runs before [setup] and only again when the section changes; in a release it runs at every boot.
[setup]#
Installs dependencies in the workspace. It does not run in a release, because the release is copied from a workspace where it already ran.
| Key | Type | Default | Required | Limits |
|---|---|---|---|---|
command | string | none | yes | Not empty, at most 4096 bytes |
watch | array of strings | [] | no | At most 32 paths relative to /workspace, without ..; each at most 256 bytes |
[setup] has no cwd key: write cd app && npm ci. It runs again when the command or the content of a watched file changes, has a 30-minute timeout, and services wait for it. Run it again by hand with izc restart setup.
[build] and [release]#
Both run once per release boot, [build] first, then [release], then the services. Use [build] to compile and [release] for database migrations. In a workspace, run them by hand with izc build or izc run release.
| Key | Type | Default | Required | Limits |
|---|---|---|---|---|
command | string | none | yes | Not empty, at most 4096 bytes |
cwd | string | /workspace | no | Relative to /workspace, no .., at most 256 bytes |
env | table | {} | no | Same rules as a service env |
timeout | duration | 30m for build, 10m for release | no | Build: 10s to 2h. Release: 10s to 1h. |
[cron.<name>]#
A command run on a schedule in a release. Cron jobs never run in the workspace on their own; test one with izc run cron.<name>.
| Key | Type | Default | Required | Limits |
|---|---|---|---|---|
schedule | string | none | yes | Five crontab fields in UTC, or @hourly, @daily, @midnight, @weekly, @monthly, @yearly, @annually |
command | string | none | yes | Not empty, at most 4096 bytes |
cwd | string | /workspace | no | Relative, no .. |
env | table | {} | no | Same rules as a service env |
timeout | duration | 10m | no | 10s to 24h |
Job names have 1–32 characters of A-Z a-z 0-9 - _ and start with a letter or digit. At most 16 jobs. The fields are minute (0–59), hour (0–23), day of month (1–31), month (1–12 or jan–dec) and day of week (0–7 or sun–sat, where 0 and 7 are Sunday). Each field is *, a number, a range a-b, any of those with a step /n, or a comma-separated list. When both day fields are restricted, a day matching either one counts. One run of a job happens at a time.
[services.<name>]#
| Key | Type | Default | Required | Limits |
|---|---|---|---|---|
kind | string | "web" | no | "web", "worker" or "static" (version 2) |
command | string | none | yes, except static | Not empty, at most 4096 bytes. A static service must not have one. |
cwd | string | /workspace | no | Relative to /workspace, no .., at most 256 bytes |
port | integer | none; 8080 for static | for public and for http/tcp checks | 1024–65535, not 3000, unique across services. A worker has none. |
env | table | {} | no | At most 64 entries. Names are letters, digits and _, not starting with a digit. Values may be strings, integers, booleans or floats (stored as text), at most 4096 bytes. |
restart | string | "always" | no | "always", "on-failure" or "no" |
public | boolean | false | no | At most one public service. Needs a port. Not for workers. |
health | inline table | none | no | See below |
dir | string | none | yes, for static | Folder to serve, relative to /workspace (version 2) |
spa | boolean | false | no | Unknown paths get index.html (version 2) |
Service names have 1–32 characters of A-Z a-z 0-9 - _, start with a letter or digit, and cannot be setup. In version 2 they also cannot be runtime, build or release.
Each service runs as the user dev in a login Bash shell, in its own process group. The PORT environment variable holds the service's port, so write --port $PORT rather than repeating the number. Listen on 0.0.0.0.
A service that exits is restarted after 1 second, doubling up to 60 seconds (reset after 60 seconds of running). Five exits within 10 minutes put it in Crash loop, and it is tried again 5 minutes later. Stopping sends SIGTERM, then SIGKILL after 5 seconds.
dir and spa are ignored when kind is not "static". That lets [env.dev] turn a static site into a dev server by changing kind and adding a command.
Port rules#
- 1024 to 65535: services do not run as root.
- Not 3000: the workspace uses it for the IDE connection.
- No two services on the same port. When two clash, the service whose name sorts later is the one reported.
- Only one service may be
public = true. It is the one served at your host URL.
Reserved environment keys#
HOME, USER, LOGNAME, SHELL, PATH and PORT cannot be set in any env table. Put secrets in Environment secrets instead of the file; see Releases and rollback.
[services.<name>.health]#
Write it inline: health = { http = "/healthz" }. Exactly one of http, tcp or command is required.
| Key | Type | Default | Limits |
|---|---|---|---|
http | string | none | A path starting with /, no spaces, at most 1024 characters. GET on the service's port; 2xx and 3xx are healthy. Needs port. |
tcp | boolean | none | Only true. A TCP connect to the port. Needs port. |
command | string | none | Run as dev; exit code 0 is healthy |
interval | duration | 10s | 1s to 1h |
timeout | duration | 2s | 100ms to 60s, and not longer than interval |
threshold | integer | 3 | 1 to 100 consecutive failures make the service Unhealthy and restart it |
grace | duration | 30s | 0s to 1h. Failures this soon after a start do not count; the first success ends the grace. |
[env.dev] and [env.prod]#
These sections override parts of the file. [env.dev] applies in the workspace (and in an agent's fork), [env.prod] in a release. Each may contain only runtime, setup, build, release, services and cron.
flowchart TD
base["Base file"] --> wsx["Workspace and agent forks"]
base --> relx["Release"]
dev["env.dev override"] --> wsx
prod["env.prod override"] --> relx
wsx --> wsteps["runtime, setup, services"]
relx --> rsteps["runtime, build, release, services, cron"]The override is merged table by table: a value or an array replaces what was there and everything else stays. You cannot remove a key, so give the base file the production values and override what differs. Use dotted keys:
version = 2
[services.web]
kind = "static"
dir = "dist"
spa = true
port = 8080
public = true
[env.dev]
services.web.kind = "web"
services.web.command = "npx --no-install vite --port $PORT --host 0.0.0.0"The names of both sections are always checked. The values of an override are checked where it applies, so run izc validate, which checks the file with each one.
Durations#
A duration is a string such as "500ms", "10s", "1.5m", "2h", "1h30m" or "1d", or a whole number of seconds (45 or "45"). Units are ms, s, m, h and d. Spaces and negative values are not allowed.
Checking the file#
- In the editor: when you save
izcode.toml, problems appear as errors in the file and in the Problems panel. - In the workspace:
izc validateprints every problem, one per line, including those that only appear with[env.dev]or[env.prod]. See izc command. - In the app: the Services page shows "izcode.toml was not applied" with the reason.
Error messages#
Messages are shown with their section, for example services.web: `port` 80 is out of range (1024-65535: services do not run as root).
| Message | Fix |
|---|---|
izcode.toml is not valid TOML: … | Fix the syntax at the line and column given. Nothing in the file was applied. |
izcode.toml has version 3; this workspace image understands versions 1 to 2 … | Use version = 2, or restart the workspace to get a newer image. |
`version` must be an integer, found string | Write version = 2, not "2". |
unknown key `colour` (expected one of: …) | Remove or rename the key; the message lists the allowed ones. |
`build` needs `version = 2` at the top of izcode.toml | Add version = 2. |
17 services; at most 16 are allowed | Merge or remove services. |
`command` is required / `command` is empty | Give the section a command. |
`port` 80 is out of range (1024-65535: services do not run as root) | Use a port from 1024 up. |
`port` 3000 is the IDE's own port | Pick another port, for example 3001. |
port 4000 is already used by service `api` | Give each service its own port. |
only one service may be public, and `web` already is | Keep public = true on one service. |
a public service needs a `port` | Add port. |
a worker has no `port`; use `kind = "web"` for a service that listens | Remove port, or change the kind. |
a worker cannot be public (it has no port) | Remove public. |
a static service is served by izc itself: it takes `dir` (and `spa`, `port`), not `command` | Remove command, set dir. |
`dir` is required for a static service … | Set dir to the built folder, such as "dist". |
`kind` is "job"; expected "web", "worker" or "static" | Use one of the three kinds. |
`restart` is "sometimes"; expected "always", "on-failure" or "no" | Use one of the three policies. |
`public` must be true or false, found string | Write public = true without quotes. |
path "../etc" must be relative to /workspace and must not contain `..` | Use a path inside the workspace. |
`env.PATH` is set by the supervisor and cannot be overridden | Remove the reserved key. |
`env` key "A-B" is not a valid variable name | Use letters, digits and _. |
service name "my app" is not allowed (1-32 of A-Z a-z 0-9 - _, starting with a letter or digit) | Rename the service. |
`setup` is reserved for the [setup] section and cannot be a service name | Rename the service. |
`build` is the name of a step (`izc logs build`) and cannot be a service name | Rename the service. |
`health`: exactly one of `http`, `tcp` or `command` is required | Keep one check. |
`health`: an `http` or `tcp` check needs the service's `port` | Add port, or use a command check. |
`health`: `http` "health" must be a path starting with `/`, without spaces | Write "/health". |
`health`: `timeout` must not be longer than `interval` | Shorten timeout or lengthen interval. |
`interval` must be between 1s and 1h | Stay within the range for that key. |
"soon" is not a duration (examples: 500ms, 10s, 5m, 2h, 1h30m) | Use a duration string. |
`python`: write the version as a string (`python = "3.12"`): a number loses trailing zeros | Quote the version. |
"Node" is not a tool name … | Use lowercase tool names. |
`packages`: "curl && sh" is not an apt package name | List plain package names only. |
`schedule` is required (e.g. "0 3 * * *", "@hourly"; UTC) | Add a schedule. |
`schedule`: "61 * * * *": minute: … | Fix the field named in the message. |
unknown environment `env.staging` (expected `env.dev` or `env.prod`) | Only dev and prod exist. |
`env.prod.version` cannot be overridden (only runtime, setup, build, release, services, cron) | Move the key out of the override. |
Related#
[build], [release] and [env.prod] in a release.How releases run