Skip to main content

Consuming build outputs

After heph run resolves a target, its artifacts live in the cache. A few flags let you surface those artifacts into your local workflow.

List output paths

Print each output file path to stdout, one per line:

terminal
heph run //app:bundle --list-out

Stream the contents of every output artifact to stdout:

terminal
heph run //app:bundle --cat-out

--cat-out and --list-out are mutually exclusive.

Copy outputs to a directory

Copy all output artifacts into a local directory, creating it if it does not exist:

terminal
heph run //app:bundle --copy-out dist/

Relative paths resolve against the current directory; absolute paths are used as-is. The copied tree mirrors the workspace-relative artifact paths — the same layout --list-out prints.

Selecting specific output groups

When a target declares multiple named output groups, use --output to restrict any of the above flags to one or more groups:

BUILD
target(
name = "compile",
driver = "bash",
run = "go build -o $OUT_BIN .; go doc . > $OUT_DOC",
out = {"bin": "app", "doc": "app.txt"},
)
terminal
heph run //app:compile --output bin --copy-out dist/
heph run //app:compile --output bin --output doc --list-out

--output is repeatable. When omitted, all groups are included. Requesting a name the target does not declare is an error.