Add non-interactive --defaults/--data/--data-file to create and add#100
Merged
Conversation
create and add dropped into copier's interactive prompts, which cannot be answered in non-tty environments (Claude Code, CI). Expose the existing data passthrough on the CLI: - --defaults: use template defaults for unasked questions (no prompts) - -d/--data KEY=VALUE: pre-fill a single answer (repeatable) - --data-file PATH: load answers from a YAML/JSON file (-d overrides) Update the bundled skill to drive plonecli non-interactively instead of hand-rolling subtemplate output. Add tests covering the new flags and a test verifying every template's settings are answerable via data. Co-Authored-By: MrTango <md@derico.de>
_all_templates() is evaluated at collection time inside @parametrize, so it must not call pytest.skip. Yield nothing when no templates dir exists, leaving an empty parameter set; keep pytest.skip in _templates_dir() for runtime use inside tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--defaults,-d/--data KEY=VALUE(repeatable), and--data-file PATH(YAML/JSON) options toplonecli createandplonecli add, so copier can be driven without interactive prompts (Claude Code / CI). Inline-doverrides matching keys from--data-file.defaultsflag throughrun_create/run_addinto copier'sdefaults=so unanswered questions fall back to template defaults instead of prompting.InterspersedCommandworkaround so flags can follow positional args on the chained CLI group, and apply it tocreate/add.plonecliskill (SKILL.md, reference/add.md, reference/create.md) to instruct non-interactive usage and never hand-write files copier would generate.Test plan
uv run pytest tests/test_plonecli.py— covers non-interactiveadd/create, data-file merge precedence, missing data-file, and malformedKEY=VALUE.uv run pytest tests/test_all_templates_data.py— asserts every template question is answerable viadata; opt-inintegrationmarker generates each template non-interactively.