JSON output
Every JSON payload, except the GitHub Actions formats from
ci matrix and ci outputs, includes a schema field
naming the payload and its major version:
{ "schema": "trellis.list/1", "packages": [ { "name": "lat_core", "version": "1.2.0", "path": "packages/lat_core", "lifecycle": "hex", "releasable": true, "dependencies": [], "dependents": ["lat_mid", "lat_cli"] } ]}An unrecognized schema means an unsupported version, so assert on it.
What “stable” permits
Section titled “What “stable” permits”| Change | Allowed? |
|---|---|
| Adding a field | Yes, without a version bump. Ignore fields you don’t know. |
| Adding an array element | Yes, per the command’s documented selection rules. |
Renaming, removing, or retyping a field; changing a documented enum’s values (kind, action, tag_kind) |
No. Bumps the major (trellis.list/1 → /2). |
Not guaranteed: key order (parse as JSON) or whitespace (some commands pretty-print, some emit one line for shell-variable capture).
Human-readable output isn’t covered. It’s written for a terminal, is
TTY-dependent, and changes freely. Use --json if you’re parsing.
The payloads
Section titled “The payloads”| Command | Schema and top-level keys |
|---|---|
list --json |
trellis.list/1{schema, packages[]} |
info <pkg> --json |
trellis.info/1{schema, name, version, path, lifecycle, releasable, dependencies[], dependents[]} |
graph --format json |
trellis.graph/1{schema, nodes[], edges[]} |
run <task> --json |
trellis.run/1{schema, ok, task, target?, results[]} |
exec --json -- <cmd> |
trellis.exec/1{schema, ok, command[], results[]} |
changelog check --format json |
trellis.changelog_check/2{schema, ok, strictness, has_entries, needs_entry, invalid_fragments[], packages[], preview} |
version plan --json |
trellis.version_plan/1{schema, bumped[], fragments_retained} |
version apply --json |
trellis.version_apply/1{schema, bumped[], lockfiles[], adopted[], fragments_retained} |
release pr --json |
trellis.release_pr/1{schema, outcome, base, branch, pr_number?, pr_url?, pr_action?, bumped[]} |
tag plan --json |
trellis.tag_plan/2{schema, tags[]} |
ci tag-package --json |
trellis.ci_tag_package/1{schema, name, path, version, tag_kind, tag_version | tag_series} |
doctor --format json |
trellis.doctor/1{schema, ok, packages, configless, auto_members, findings[], fixes[], applied[], package_lifecycles[]} |
Notes:
list’spackages[]entries andinfo’s top level use the same fields.lifecycleis the resolved release lifecycle (workspace,git_only, orhex);releasableis true forgit_onlyandhexpackages.graphnodes also include both fields.version plan/version applyuse the samebumped[]fields (name,current,next,fragments,updated_dependencies[]).fragmentscounts the source entries to render, including archived candidates on promotion.fragments_retainedis true when the plan includes a prerelease: trellis archives its fragments for the final rollup and removes them fromunreleased. This also applies to a prerelease version specified with--set.release pruses the samebumped[]fields.outcomeisprepared,unchanged, orno_changes. A prepared result includespr_action: createdorupdatedand PR identity. An unchanged result has nopr_actionand reports the evaluated, unapplied plan; a no-change result has an emptybumped. Optional identity fields are absent when unknown. Errors do not emit a success payload. See CI outcomes for the equivalent--github-outputkeys.run/execuse the sameresults[]fields:package,path,status(success|failed|skipped),duration_ms. A failed entry also includesexit_codeandcommand.duration_ms’s presence is stable, its value isn’t.ci tag-packagereportstag_kind: exactwithtag_version, ortag_kind: serieswithtag_series. The other key is absent, not null.tag planentries usekind: repository_seriesfor an anchored repository tag. The entry retains the anchor package’snameandversion; this kind is never returned by package-orientedci tag-package.changelog check’spreviewfield is always present and a string, but its Markdown prose can change without a version bump.needs_entryreports whether an entry is missing;okreports whatchangelog.strictnessmade of that, and matches the exit code. Select this payload with--format json.
--json moves package output to stderr. run/exec normally stream
package output to stdout; under --json it moves to stderr so stdout
contains only the payload. -q suppresses the stream.
doctor findings
Section titled “doctor findings”package_lifecycles is an array of {name, lifecycle}, one per member in
workspace order, alongside the numeric packages count. doctor’s text
summary renders the same data as compact counts:
ok: 4 package(s) (1 workspace, 0 git_only, 3 hex), 0 warning(s).
findings[] contains one entry per problem:
{ "check": "lockfile_drift", "severity": "error", "message": "packages/lat_mid/manifest.toml locks `lat_core` at 1.1.0 …", "file": "packages/lat_mid/manifest.toml", "package": "lat_mid", "fixable": true}severity is error or warning (only error fails the run). file/
package are absent, not null, when a finding isn’t tied to one file.
message is prose, not stable, so branch on check:
check |
Raised when |
|---|---|
member_glob |
a members glob is invalid, unreadable, or matches nothing |
package_manifest |
a package’s manifest is missing, unparseable, contains a [tools.trellis] table, or repeats another package’s name |
path_dependency |
a path dependency escapes the workspace or names no package in it |
dependency_cycle |
the graph is cyclic |
workspace_config |
the root [tools.trellis] table is itself wrong |
exclusion_glob |
a task-exclusion, tag-mode-override, or publish.lifecycle.packages glob matches no member |
release_boundary |
a package’s runtime path dependency is less capable than it is (a hex package depending on git_only/workspace, or git_only on workspace) |
tag_collision |
two releasable packages produce the same tag |
lockfile_drift |
a manifest.toml locks a workspace-internal dep at a stale version |
pinned_ref |
a pinned git dependency SHA is no longer reachable from its tracked ref, its pin comment disagrees with its ref, or the refs could not be verified (warning) |
changelog_missing |
a releasable package has no CHANGELOG.md |
changelog_unreadable |
a CHANGELOG.md exists but could not be read |
changelog_behind |
a package’s version is behind the newest one in its changelog |
changelog_adoption |
a package has pre-trellis changelog history the next release will adopt |
package_version |
a package’s version is not valid semver |
changelog_fragment |
an unreleased fragment does not parse, or names an unknown package, kind, or category |
toolchain |
the gleam on PATH disagrees with the .tool-versions pin |
shared_dependency |
packages require different versions of the same external dependency |
New check values may appear without a bump, so handle unrecognized ones by reporting them rather than dropping them.
--format github is not JSON. It emits workflow commands
(::error title=lockfile_drift,file=packages/lat_mid/manifest.toml::…) so
findings land on a PR’s Files tab. See CI recipes.
Two exceptions
Section titled “Two exceptions”ci matrix and ci outputs omit schema because they use GitHub Actions
matrix and output formats.
ci matrix emits one key, fed straight to strategy.matrix via
fromJSON():
{"include":[{"name":"lat_core","path":"packages/lat_core","version":"1.2.0"}]}A schema sibling here would be a bug: every top-level key besides
include becomes another matrix axis.
ci outputs emits key=value lines for $GITHUB_OUTPUT, each value a JSON
array of strings:
packages=["lat_core","lat_mid","lat_cli","package_a"]releasable=["lat_core","lat_mid","lat_cli"]version_files=["packages/lat_core/gleam.toml","packages/lat_mid/gleam.toml","packages/lat_cli/gleam.toml"]tags=["lat_core-v1.2.0","lat_mid-v0.5.0","lat_cli-v0.3.1"]series_tags=[]changelog check --format github emits plain scalars, JSON arrays, and the
multi-line preview in GitHub’s heredoc form. It reports the
trellis.changelog_check/2 data as output records and also omits schema.
See CI recipes for how these are consumed.
Enforcement
Section titled “Enforcement”Every payload is snapshotted in trellis’s test suite, so a change to a stable payload fails CI before it can ship.