Task running
trellis run runs a task across workspace packages; trellis exec runs
an arbitrary command in each selected package. Both work from anywhere inside the
workspace.
trellis run <task> [pkgs...] [--since <ref>] [--with-dependents] [--path <glob>] [--exclude-path <glob>] [--target erlang|javascript|all] [--strict] [--check] [--serial] [--keep-going] [--jobs N]trellis exec [pkgs...] [--since <ref>] [--path <glob>] [--exclude-path <glob>] [--serial] [--keep-going] [--jobs N] -- <command...>Built-in tasks
Section titled “Built-in tasks”Built-in tasks run these Gleam commands without configuration:
| Task | Runs |
|---|---|
build |
gleam build. --strict adds --warnings-as-errors. |
test |
gleam test |
check |
gleam check (type check without building). |
format |
gleam format. --check verifies instead of writing. |
docs |
gleam docs build |
deps |
gleam deps download |
clean |
gleam clean |
--target erlang|javascript selects the compile target; --target all runs
the task once per target.
Custom tasks
Section titled “Custom tasks”Custom tasks live under [tools.trellis.tasks] in the root manifest and run
through trellis run <name>, with the same scheduling and package selection
as built-in tasks:
# Custom tasks for `trellis run <name>`. Built-in verbs need no declaration;# a task with a built-in's name overrides it.[tools.trellis.tasks.lint]command = "gleam run -m glinter"needs_deps = true # run `gleam deps download` first if not cachedAny built-in or custom task can omit packages through a same-named key under
exclude. See
package exclusions.
Scheduling
Section titled “Scheduling”Scheduling is graph-parallel by default: a package runs as soon as its
workspace dependencies have finished, up to --jobs N at once (default: CPU
count). Output is streamed live with a package prefix, and a summary table
names any failures:
$ trellis run testlat_core ▏ $ gleam testlat_core ▏ Compiling lat_corelat_core ▏ ...lat_mid ▏ $ gleam testlat_cli ▏ $ gleam test
package status timelat_core ok 3.2slat_mid ok 2.8slat_cli FAILED 1.4s `gleam test` failedThe exit code is non-zero when any package fails. --serial runs one package
at a time in dependency order; --keep-going continues scheduling after a
failure instead of stopping at the first one.
Selecting packages
Section titled “Selecting packages”Name packages explicitly (trellis run test lat_core) or select them from git
history or member paths. --since <ref> filters to packages owning changed files
(committed, uncommitted, and untracked), and run --with-dependents adds the
reverse-dependency closure:
# Only test what a PR touched: packages owning changed files,# plus everything that depends on them.trellis run test --since origin/main --with-dependentsUse --path to include packages by member-path glob, and --exclude-path to
omit them. Quote patterns so your shell does not expand them:
trellis exec --serial --path 'examples/*' -- gleam deps downloadtrellis run build --serial --path 'examples/*'Patterns match workspace-relative package directories, not package names or
manifest files. Use / as the separator and . for a root package. Paths stay
relative to the workspace root even when you run trellis from a package
directory. They use the same glob rules as
package exclusions.
New matching workspace members are included without recipe changes.
Both flags can be repeated. A package can match any --path pattern, but must
also pass any explicit package-name selection and --since filter. With no
--path, selection starts with the named packages or all workspace packages.
For run --with-dependents, only packages that pass these initial filters seed
the expansion. Added dependents must still match a --path pattern when one
is given. Any --exclude-path match removes a package, including an explicitly
named package or an added dependent.
Each include and exclude pattern must be valid and match at least one workspace member, or the command fails before execution. Patterns are checked against the whole workspace, before other filters. Valid filters that leave no packages produce a successful empty selection, not a fallback to all packages. Unselected packages do not run or appear in text or JSON result summaries.
Task-specific [tools.trellis.exclude] rules still apply to run after CLI
selection. exec does not infer a task from its command or apply task exclusions;
use --exclude-path to omit packages. Neither command changes workspace
membership or release lifecycle. Dependencies outside the selection are not
added automatically.
Arbitrary commands
Section titled “Arbitrary commands”trellis exec runs any command in each selected package directory. It supports
the same scheduling flags as run, but not --with-dependents:
trellis exec -- gleam deps updatetrellis exec lat_core lat_mid -- rm -rf buildUse just to combine several trellis commands into one recipe. This keeps
recipes available through just --list without writing package loops:
# Define the lint task in gleam.toml as shown above.test *ARGS: trellis run test {{ARGS}}
ci: trellis run format --check trellis run check trellis run lint trellis run test trellis run build --strict