.amika/config.toml, the file that
declares rig defaults for a repository. For how these settings reach a
rig — resolution precedence, multi-repo, and repo-less behavior — read
How configuration works first.
The file lives at the root of a Git repository:
Quick start
A minimal config that sets up a Node project with a secret and a web server:Sections
[lifecycle]— setup and start scripts[env]— environment variables and secret references[services.<name>]— named services with port bindings and URL schemes[sandbox]— default rig preset, size, and snapshot[filesystem]— additional repos to clone alongside the primary repo[agent_credentials]— per-agent credential defaults
[lifecycle]
Controls rig initialization. Both keys are optional; a repository can define
only setup, only start, or both.
setup_script
Path to a repository script whose contents Amika installs as the setup hook. It
runs once during initial rig creation. Use a path relative to the repository
root.
Requirements:
- Include a shebang and exit with status code
0on success. - The executable bit in Git is not required for hosted rigs.
- A nonzero exit records a setup failure, but the hosted rig remains accessible.
- The script runs with the working directory set to
$AMIKA_AGENT_CWD.
--setup-script on amika rig create takes priority over
this value.
start_script
Path to a repository script that Amika installs as the start hook. Unlike
setup_script, it does not run on the initial create. It runs each time a
stopped rig is started again. It is re-read on each start, so edits take effect
without recreating the rig.
Use it for steps that must repeat whenever a rig resumes, such as starting a
long-running dev server or re-opening a tunnel. Put one-time provisioning in
setup_script. Relative paths resolve from the repository root. The same
exit-code behavior as setup_script applies.
This key is applied by the hosted platform. The open-source Go config parser
does not support a start script.
[env]
Declares environment variables that are set inside the rig. Each key is a
variable name and each value is either a plain string or a reference table. See
Environment variables vs. secrets for how to
choose between a plain value and a secret reference.
Plain string
Secret reference
secret field references a secret by name in the Amika secrets store. The
secret is resolved at rig creation time and its value is injected as the
environment variable.
Secrets must be pushed before rig creation via amika secret push or the
web UI.
Service reference
service field references a service declared in the same file’s
[services.<name>] section. The field selects which attribute to inject:
"url"— the public URL of the service (e.g.https://<rig>.preview.amika.dev). Requires the service to have aurl_scheme."host"— the hostname of that public URL (e.g.<rig>.preview.amika.dev), with no scheme, port, or path. Like"url", requires the service to have aurl_scheme."port"— the host-side port (inside the rig) the service is exposed on.
Validation rules
If validation fails, the
[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.
The singular
[service.<name>] is accepted as an alias for
[services.<name>]. Use one form or the other consistently within a file.Fields
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
If a service definition fails validation, rig creation fails with a 400
invalid_repo_config error whose message names the problem. Fix
.amika/config.toml and create the rig again.
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 rig settings for the repository.
preset
The base image preset for rigs created from this repository.
coder: Ubuntu 24.04 with Git, Node.js, Python, and the Claude Code, Codex, OpenCode, and Pi agent CLIs.coder-plus-docker: Same ascoder, with Docker support inside the rig.
size
The resource allocation size for rigs created from this repository.
Each provider serves one size generation. E2B serves
a1, and the other
hosted providers serve a0:
The friendly aliases are
xs (or extra-small), m (or medium), l (or
large), and xl (or extra-large). Aliases and sizes are case-insensitive.
a0 generation, so they are not
portable across providers. For example, l resolves to a0.l, which E2B does
not offer. Use a1.large for a large E2B rig. The API accepts versioned sizes
when the selected provider offers them. The coder-plus-docker preset does not
support the xs tier.
Amika ignores a size value it doesn’t recognize, and falls back to the
default. An unrecognized preset makes it ignore the whole [sandbox] table,
including size and snapshot.
snapshot
The friendly label of a snapshot captured for this repository (for example
custom-snapshot), not the org-qualified Daytona name. Amika maps the label
to the full snapshot for your org at creation time, keeping the config portable
across orgs.
snapshot
in the API request, then this repository default, then a repository custom
image, then the preset/size default. If the named snapshot is missing or no
longer owned by your org, Amika logs a warning and falls through to the
preset/size path rather than failing the create.
Merge semantics
Preset, size, and snapshot are resolved independently. Database values (saved via the web UI) override TOML values. When neither sets a value, the platform defaults apply: thecoder preset, the provider’s m size (a0.m, or
a1.medium on E2B), and no snapshot.
[filesystem]
Declares extra repositories to clone into the rig alongside the primary
repo. See Multi-repo rigs for
the key rule: only the primary repo’s .amika/config.toml is applied.
repos
~/workspace/<repo-name>. The
primary repo (the one this config lives in) is inferred automatically and need
not be listed; if listed, it is deduped.
Validation and resolution
Merge semantics: DB-wins-all. If additional repos are saved via the Edit
Repository UI, that list is used exclusively and the TOML list is ignored.
Additional repos are cloned during the hosted-platform initialization phase.
Providers without that phase (for example local Docker) clone only the primary
repo and log that the extras were skipped.
[agent_credentials]
Pins which credential each agent uses by default for rigs created from this
repository. This dimension lives only in TOML — there is no database layer.
See Inject credentials for how these defaults
interact with per-rig credential selection.
Full example
Related docs
- How configuration works — resolution precedence, multi-repo, repo-less
- config.toml key lookup — every key at a glance
- Environment variables vs. secrets — choosing plain values vs. secrets
- Services — service runtime behavior, port resolution, and listing