7.5 Generating templates with --print-config
Use a command's --print-config option to write an annotated starting file for the installed nlmx version:
nlmx power --print-config study.power
The command validates the filename extension, writes comments and representative keys, then stops. It does not run the analysis. This separation makes template creation safe to include in project setup.
Existing files are protected
nlmx refuses to replace an existing template destination unless --overwrite is explicitly supplied. Prefer generating to a new name, reviewing the result and using version control. --overwrite should be an intentional regeneration step because locally curated comments or values may be lost.
Templates are reference material, not proof of effective defaults. A commented example can describe an option without activating it, and some values are computed or validated in command code. The executable's help, generated template, retained effective-settings file and command documentation form a complementary set.
A disciplined workflow
- Check
nlmx versionand record it. - Generate a template with the command's required extension.
- Copy or rename it to a study-specific name.
- Delete unused optional sections only when their omission semantics are understood.
- Set paths relative to the settings file where practical.
- Validate with a small or dry workflow before launching an expensive run.
- Commit the reviewed file, not a secret-bearing or machine-specific derivative.
The canonical annotated example is documents/ch07/power-template.power. On reruns, the Chapter 7 harness generates a fresh template inside the selected results directory so it never overwrites that example. The compact worked configuration, documents/ch07/roundtrip.power, intentionally contains only the fields needed for its example. Both are useful: the first is a discoverability aid; the second is reviewed intent.
Schema is related but narrower
nlmx schema exports the covariate configuration schema in supported text/TOML/JSON forms, including JSON Schema. It should not be described as a universal schema generator for every command-specific file. For other commands, use their template and parser validation.
Common mistakes
- Expecting template generation to start an analysis.
- Overwriting an edited file without reviewing the diff.
- Treating every commented template value as active.
- Assuming
nlmx schemacovers all command families.
Checklist
- Use the correct extension.
- Retain the software version alongside the generated template.
- Review regenerated templates after upgrades.
Further reading
See TOML syntax, validation and configuration review.