Guides
Working with Outputs
Outputs represent the values produced by a run—such as resource identifiers, computed data, or results generated by your module.
This guide shows how to inspect, filter, and format outputs using the rt output command.
Overview
The rt output command prints outputs from a past run. You can target a specific run by ID or automatically select the most recent run for a given module path.
Outputs can be printed in full, filtered by expression, and formatted in several output types for downstream automation.
Targeting Runs
You can provide one of the following as the first argument:
- Run ID — prints outputs from a specific run.
- Module path — prints outputs from the most recent run of that module.
Examples:
rt output RUN123rt output ./modules/example.rt.hcl target
Working With Expressions
Expressions let you print a specific output instead of the full output set.
- If you provide an expression, only that output value is printed.
- If you omit the expression, all outputs are printed.
When printing all outputs, the command also emits the run trace to stderr to help you understand where the output came from.
Use --no-trace to suppress the trace.
Examples:
rt output RUN123 results[0]rt output RUN123 --no-trace
Output Formats
Outputs can be printed in several formats depending on your needs:
- hcl (default)
- json
- yaml
Use the -o / --output flag to choose a format.
Examples:
rt output RUN123 results -o jsonrt output RUN123 -o yaml
Usage
rt output <run|path> [expr] [--flags]
Examples
# Show all outputs from a run (trace printed to stderr)
rt output RUN123
# Show all outputs without the run trace
rt output RUN123 --no-trace
# Show one output by expression (first element of "results")
rt output RUN123 results[0]
# Show an output in JSON
rt output RUN123 results -o json
# Show an output from the last run of a module
rt output ./modules/example.rt.hcl target
Flags
-h, --help— Help for output-T, --no-trace— Do not print the run trace to stderr when showing all outputs-o, --output— Output format:hcl,json, oryaml
