Skip to content

feat: read recipes from stdin and add --tasks-format - #411

Merged
josegonzalez merged 1 commit into
mainfrom
406-stdin-recipes
Aug 6, 2026
Merged

feat: read recipes from stdin and add --tasks-format#411
josegonzalez merged 1 commit into
mainfrom
406-stdin-recipes

Conversation

@josegonzalez

Copy link
Copy Markdown
Member

apply, plan, and validate now accept - as the recipe source, spelled either as --tasks - or as a bare positional argument, matching the docket fmt - that already existed. The new --tasks-format flag states the recipe format outright instead of inferring it from the file extension, which matters for stdin, for an extension that is absent or misleading, and for a flow-style YAML recipe that would otherwise be sniffed as JSON5. tasks-format joins the reserved input names.

A piped recipe behaves like any other: its inputs: still become --<name> flags, and it takes precedence over a tasks.yml in the working directory. This makes docket export --output - | docket apply - work end to end.

The flag is named --tasks-format rather than --format for two reasons. --format already means output format elsewhere in the Dokku ecosystem, sitting next to docket's own --json, and reserving the un-hyphenated format would have broken any recipe declaring an input by that name. A hyphenated input name is already rejected, so reserving tasks-format cannot break an existing recipe. This also keeps plain --format free for init and export, which infer their output format from --output and today can only emit YAML to stdout.

Closes the first half of #406. Two follow-ups are carved out of the rest: #409 for the ansible-dokku wrapper developer documentation, and #410 for a format override on init and export output.

`apply`, `plan`, and `validate` now accept `-` as the recipe source, spelled either as `--tasks -` or as a bare positional argument, matching the `docket fmt -` that already existed. The new `--tasks-format` flag states the recipe format outright instead of inferring it from the file extension, which matters for stdin, for an extension that is absent or misleading, and for a flow-style YAML recipe that would otherwise be sniffed as JSON5. `tasks-format` joins the reserved input names.
@josegonzalez
josegonzalez merged commit d231002 into main Aug 6, 2026
19 checks passed
@josegonzalez
josegonzalez deleted the 406-stdin-recipes branch August 6, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant