Skip to content

Configuration

Configuration is optional. With no configuration, trellis uses the git repository root as the workspace root. Every non-gitignored gleam.toml outside build/ marks a member. You can start with a Gleam monorepo or a single-package repository.

Add a [tools.trellis] table to the root gleam.toml when you need to change a setting. The table identifies the workspace root; you do not need a separate configuration file. The root manifest can describe a Gleam package or contain only configuration.

gleam.toml
[tools.trellis]

Every key is optional. Omit members to keep auto-discovery while configuring other settings. To add a custom task:

gleam.toml
[tools.trellis.tasks.lint]
command = "gleam run -m glinter"
needs_deps = true

needs_deps = true runs gleam deps download first if dependencies are not cached. Built-in tasks such as build, test, and format need no declaration. See Task running for task selection and execution.

A member is a directory with its own gleam.toml: a Gleam package that belongs to the workspace. Path dependencies define the graph. Trellis rejects cycles and path dependencies that escape the workspace.

Run trellis init to write the table at the repository root. It creates a config-only gleam.toml if the root is not a package, or adds the table to the existing manifest.

Terminal window
$ trellis init
created /repo/gleam.toml
members are auto-discovered; found 2:
packages/a
packages/b

The generated table keeps auto-discovery: init writes comments about available settings rather than a members list. It reports the packages it found and finishes by running doctor.

init refuses to run if the repository is already a trellis workspace or if a member manifest contains a [tools.trellis] table.

You do not need init to use trellis. Run it when you want to configure a setting or make the workspace root explicit.

members accepts paths relative to the workspace root. An entry containing *, ?, or [ is a wildcard member pattern; any other entry is literal.

gleam.toml
[tools.trellis]
members = ["packages/core", "examples/**"]

In a Git repository, wildcard discovery honors nested .gitignore files and .git/info/exclude. It does not honor global core.excludesFile, generic .ignore files, or automatically hide dot paths. Outside a Git repository, Git ignore rules do not apply.

Wildcard traversal follows symlinks but does not enter .git. Only matching directories that contain a gleam.toml become members. Literal entries bypass ignore status and are resolved directly, even when Git ignores the path.

[tools.trellis.exclude] is a separate post-discovery filter. It can drop packages from task or release sets, but it never prunes traversal.

A [tools.trellis] table in a member manifest is a doctor error because it would change root discovery. Trellis walks up from the current directory to the first manifest with that table, as git and cargo do for their roots.

Use [tools.trellis.adapter] for packages with non-Gleam manifests, such as Claude Code plugins or APM packages. Set the manifest path and the fields that contain each package’s name and version. You can then use trellis’s changelog, version, tag, release PR, and CI commands.

trellis.toml
[tools.trellis]
members = ["plugins/*"]
[tools.trellis.adapter]
# Relative to each member directory. Its presence is what marks a member.
# Supported formats: .toml, .json, .yaml, or .yml.
manifest = ".claude-plugin/plugin.json"
# Dotted field paths. Both default to what is shown, so a manifest spelling
# them `name` and `version` needs neither key.
name = "name"
version = "version"
[tools.trellis.publish]
package_tags = ["exact", "major"] # moving `v1` tags are how git-ref
exact_tag_format = "{name}-v{version}" # consumers pin a release
series_tag_format = "{name}-v{series}"

Put the adapter’s [tools.trellis] table in trellis.toml at the workspace root, or in gleam.toml. Trellis walks up to the first directory with either file containing the table, checking trellis.toml first. Defining the table in both files is an error.

The native Gleam backend requires [tools.trellis] in gleam.toml. Configuration in trellis.toml without [tools.trellis.adapter] is an error in doctor and normal commands. Move the [tools.trellis] table and its subtables into gleam.toml; create a config-only gleam.toml if the workspace root is not a package. Configless Gleam workspaces still work.

An adapter workspace may have an unrelated gleam.toml beside trellis.toml, provided only one root file contains [tools.trellis].

Omit members to auto-discover packages, including a package at the workspace root. A package’s name does not need to match its directory name.

JSON manifests must be valid JSON, with strings at the configured name and version paths. Duplicate keys that make either path ambiguous are errors.

version apply updates only the field named by adapter.version, preserving comments, key order, indentation, and quote style. A missing field is an error; trellis does not insert it.

Area Behavior
Discovery, list, info, graph, ci matrix Globs and manifest presence select packages. Omit members to auto-discover.
Changelog, version, tag, release pr, GitHub Releases Unchanged, except that the bump is written to the adapter’s version field.
Dependency graph Flat. An adapter declares no dependency edges, so topological order is member order and a workspace dependency never ripple-bumps.
publish.lifecycle Defaults to git_only; hex anywhere is a configuration error. There is no registry to publish to.
run Gleam built-in tasks are refused. Define custom tasks under [tools.trellis.tasks]; trellis exec is unaffected.
publish, lockfile refresh, pin Refused.
doctor Drops the manifest.toml, shared-dependency, and toolchain checks; adds that every member manifest declares a semver version.

Update root index files such as marketplace.json yourself. Trellis does not synchronize them with package versions.

See the configuration reference for all adapter keys and release settings.

Add a key under exclude for any built-in or custom trellis run task whose package set differs from the full workspace:

gleam.toml
[tools.trellis]
members = ["packages/*", "examples/*", "benchmarks/*"]
exclude = { docs = ["examples/*", "benchmarks/*"], "@release" = ["examples/*", "benchmarks/*"] }

Inline TOML is concise for a small map. The equivalent table form is easier to scan as more tasks gain exclusions:

gleam.toml
[tools.trellis.exclude]
docs = ["examples/*", "benchmarks/*"]
"@release" = ["examples/*", "benchmarks/*"]

Patterns match member paths relative to the workspace root, not package names. A task exclusion applies after package selection, including packages named explicitly or selected through --since.

Key What it excludes
docs Matching packages from trellis run docs, without overriding its command.
Any custom task name Matching packages from that trellis run <name> invocation.
@release Matching packages from changelog, version, tag, publish, and release CI operations. This selects the workspace release lifecycle. Explicit changelog creation and publishing are rejected.
@members Matching directories from workspace membership itself. No command parses or uses them.

Release-excluded packages remain in the graph and participate in list, graph, exec, and tasks that do not exclude them. info and JSON output expose releasable: false; list --releasable returns the git_only and hex packages:

Terminal window
$ trellis list --releasable
lat_core hex
lat_mid hex
lat_cli hex

trellis doctor reports exclusion globs that match no member. For packages that need versions and git tags without publishing to Hex, configure their release lifecycle.

Run trellis doctor after any configuration change:

Terminal window
trellis doctor

It checks member discovery, the dependency graph, task exclusions, release boundaries, tag uniqueness, locked versions, changelogs, dependency pins, shared dependencies, and unrecognized keys. It exits non-zero on an error.

The configuration reference contains all keys, defaults, release settings, and migration rules.