Pipelines

A pipeline is an ordered list of stages, and a stage is a set of items: converters (a profile run over its source tree) and snippets (shell commands). Running tern executes every pipeline.

Where pipelines come from

Templates declare pipelines in their tern.toml (reference Templates); tern -u installs them as <template>/<pipeline>:

[[pipelines]]
name = "convert"

[[pipelines.stages]]
name = "convert"
converters = ["pandoc"]
snippets = ["sh .tern/data/pandoc-template/setup.sh"]

converters names profiles of the same template; snippets are commands run from the project root.

Profiles created locally in the TUI get one single-stage pipeline each, generated the first time tern runs with profiles but no pipelines and recorded in .tern/pipelines.toml.

Execution

Nothing is printed while work is in flight. Each pipeline collects a report, and one build summary is printed after all of them finish, so parallel output never interleaves.

Cancellation — Ctrl+C makes converters stop taking new files and each pipeline stop at its next stage boundary, then tern exits cleanly. Stages that never ran are reported as skipped.

Build summary

A run ends with one summary tree, one line per node with a status word and a duration:

Build Summary: 2/2 pipelines succeeded; 40 files converted
pandoc/docs/convert success 7.2s
└─ pandoc/docs/convert success 7.2s
   ├─ pandoc/docs/pandoc 22 converted success 7.2s
   └─ sh .tern/data/pandoc/docs/setup.sh success 7.2s
pandoc/readme/convert success 7.4s
└─ pandoc/readme/convert success 7.4s
   ├─ pandoc/readme/pandoc 18 converted success 7.4s
   └─ sh .tern/data/pandoc/readme/setup.sh success 7.4s
Status Meaning
success Work ran and succeeded
cached Nothing to do, every output was up to date
failure At least one error was recorded
skipped Cancelled before running

A converter shows <changed> converted when every processed file changed, and <changed>/<processed> converted when some did not. A converter that reports a file as unchanged instead of raising an error hides a failure here, reference Converters.

Only failing items expand, with their errors and captured output indented beneath:

Build Summary: 0/1 pipeline succeeded; 1 error
pandoc/docs/convert failure 2.2s
└─ pandoc/docs/convert failure 2.2s
   └─ sh .tern/data/pandoc/docs/setup.sh failure 2.2s
      error: exited with code 127
      sh: .tern/data/pandoc/docs/setup.sh: No such file or directory

Pipelines are listed in name order, so repeated runs diff cleanly. Colour is used only when stdout is a terminal, and never when NO_COLOR is set.