Skip to content

Consider adding --list-variables option to show available template variables #880

@audreyfeldroy

Description

@audreyfeldroy

Summary

Users automating package creation with key=value arguments need to know which variables are available. Right now they have to either run interactively first or read cookiecutter.json.

Proposal

Add a --list-variables flag that shows available template variables and their defaults:

$ uvx cookiecutter-pypackage --list-variables
Available template variables:
  full_name (default: "Audrey M. Roy Greenfeld")
  email (default: "audreyfeldroy@example.com")
  github_username (default: "audreyfeldroy")
  pypi_package_name (default: "python-boilerplate")
  ...

Implementation considerations

  • Would need to read and parse cookiecutter.json
  • Could be a separate command instead of a flag: cookiecutter-pypackage show-variables
  • Needs to be maintained if template variables change
  • Alternatively, could just document the variables in README and link to that

Priority

Low. The interactive flow already shows all variables, and we can document them in the README. This would be nice-to-have for automation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions