.amika/config.toml file lives at the root of a Git repository and declares sandbox defaults for that repository. When a sandbox is created from the repo, Amika reads this file and applies the settings automatically.
For an overview of how repository configuration works and how it interacts with other configuration sources, see Repository configuration.
Quick start
A minimal config that sets up a Node project with a secret and a web server:Sections
[lifecycle]— setup script that runs before the container command[env]— environment variables and secret references[services.<name>]— named services with port bindings and URL schemes[sandbox]— default sandbox preset and size
[lifecycle]
Controls sandbox initialization.
setup_script
| Type | String (file path) |
| Required | No |
| Default | Built-in no-op script (exit 0) |
/usr/local/etc/amikad/setup/setup.sh and run before the container command starts.
Relative paths are resolved from the repository root (the directory containing .git). Absolute paths are used as-is.
- Must be executable (
chmod +x). - Must exit with status code
0on success. A non-zero exit prevents the container command from running. - Runs with the working directory set to
$AMIKA_AGENT_CWD.
--setup-script on amika sandbox create takes priority over this value.
[env]
Declares environment variables that are set inside the sandbox. Each key is a variable name and each value is either a plain string or a secret reference.
Plain string
Secret reference
secret field references a secret by name in the Amika secrets store. The secret is resolved at sandbox creation time and its value is injected as the environment variable.
Secrets must be pushed before sandbox creation via amika secret push or the web UI.
Validation rules
| Rule | Detail |
|---|---|
| Name format | Must match ^[A-Z_][A-Z0-9_]*$ (UPPER_SNAKE_CASE) |
| Value type | String or { secret = "..." } table |
| Secret name | Must be a non-empty string |
[env] section is skipped and a warning is logged. Other sections are still applied.
Merge semantics
Environment variables are merged per-key across sources. Database entries (saved via the web UI) override TOML entries with the same name, but TOML-only entries are preserved.[services.<name>]
Declares named services with port bindings and optional URL schemes. Each [services.<name>] section defines one service. See Services for usage examples and runtime behavior.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
port | integer or "port/protocol" string | No | Single port declaration |
ports | array of integer or "port/protocol" string | No | Multiple port declarations |
url_scheme | string or array of { port, scheme } tables | No | URL generation scheme |
port and ports are mutually exclusive. A service may omit both to act as a metadata-only entry with no port bindings.
Port format
Each port value is either:- Integer — interpreted as
containerPort/tcp(TCP is the default protocol). - String
"containerPort/protocol"— sets the protocol explicitly.
url_scheme
Controls URL generation for service ports. Allowed values: "http", "https".
Single-port services accept a string or a single-element array:
Validation rules
| Rule | Detail |
|---|---|
| Port range | 1–65535 |
| Reserved range | Ports 60899–60999 are reserved for Amika internal services and are rejected |
| Protocol | tcp or udp |
| Mutual exclusivity | Cannot specify both port and ports on the same service |
| Uniqueness | No duplicate (port, protocol) pair across all services in the file |
| url_scheme ports | Must reference a port declared in the same service |
| url_scheme uniqueness | No duplicate port entries within url_scheme |
[lifecycle], [env]) are still applied.
Merge semantics
Service definitions use DB-wins-all semantics: if any service definitions are saved via the web UI, those are used exclusively and TOML definitions are ignored.Examples
Simple web server:[sandbox]
Sets default sandbox settings for the repository.
preset
| Type | String |
| Required | No |
| Default | "coder" |
| Values | "coder", "coder-dind" |
coder— Ubuntu 24.04 with Git, Node.js, Python, and agent CLIs (Claude Code, Codex, OpenCode).coder-dind— Same ascoderwith Docker-in-Docker support.
size
| Type | String |
| Required | No |
| Default | "m" |
| Values | "xs", "m" |
Merge semantics
Preset and size are resolved independently. Database values (saved via the web UI) override TOML values.Full example
Related docs
- Repository configuration — how repo config works and resolution precedence
- Sandbox configuration — CLI flags and runtime settings
- Services — service runtime behavior, port resolution, and listing