Skip to main content

dagger.toml

A workspace is configured by a dagger.toml file at its root. It records the modules installed in the workspace and their settings. dagger module install creates it on first install.

The machine-readable schema is published at dagger-workspace.schema.json.

Top level

KeyTypeDescription
modulestableInstalled modules, keyed by install name. See [modules.<name>].
sdkstableInstalled SDK providers and their generation scopes. See [sdks.<name>].
portstableHost port mappings for services. See [ports.<name>].
ignorearrayPath patterns excluded when loading the workspace.
defaults_from_dotenvboolRead module constructor defaults from a .env file.
check-generatedboolRun generators as checks during dagger check, failing when generated files are stale. Defaults to true; CLI flags override it.

Resolved image and Git lookups are pinned in dagger.lock alongside the config, and refreshed with dagger workspace update.

[modules.<name>]

[modules.eslint]
source = "dagger.io/js/eslint@v0.3.0"

[modules.eslint.settings]
packageManager = "yarn"
KeyTypeDescription
sourcestringModule address — a workspace-relative path, or a Git ref such as github.com/org/mod@version.
pinstringResolved version for source.
settingstableModule settings. Keys are defined by the module; set them with dagger module settings.
entrypointboolMarks this module as the workspace entrypoint.
legacy-default-pathboolCompatibility flag recorded by workspace migration.
checktableskip = [...] — check functions to exclude from dagger check.
generatetableskip = [...] — generators to exclude from dagger generate.
uptableskip = [...] — services to exclude from dagger up.

Settings can point at another module's output instead of a literal value — see Module wiring.

[sdks.<name>]

[modules.go-sdk]
source = "dagger.io/sdk/go"

[sdks.go]
module = "go-sdk"

[sdks.go.scopes.".dagger/modules/demo"]
is-module = true
name = "demo"
clients = ["github.com/acme/api"]

[sdks.go.scopes.".dagger/modules/demo".settings]
template = "default"
KeyTypeDescription
modulestringName of the installed module that provides this SDK.
scopestableGeneration scopes, keyed by paths relative to dagger.toml.

Each scope can contain one module, module clients, or both. Client paths are relative to the directory containing dagger.toml. Use ./api, ../api, . or ..; a bare api is not a local path.

Scope keyTypeDescription
is-moduleboolThe scope contains a Dagger module.
namestringOptional scope name. Overrides the inferred module name when is-module is true.
clientsarrayExplicit local paths or module addresses for generated clients. Installed module names are not supported.
settingstableSDK settings for this scope.

module init saves a scope name only when you set --name. It preserves an existing saved name. Before generation, an unnamed module scope uses the name of its local entrypoint installation, if one exists. Otherwise, it uses the scope directory name. A scope at the workspace root uses the config-parent or workspace name with -dev. Multiple matching entrypoint names require an explicit scope name. The inferred name is not written to this field.

Use dagger sdk scope name -u to remove an override. An unnamed scope that contains only clients passes an empty name to the SDK.

[ports.<name>]

KeyTypeDescription
backendServicestringService that backs this host port.
backendPortintPort on the backing service.

User-level file

The same module settings can be set per-user, outside the repository, in ~/.config/dagger/config.toml. See User configuration.