Feature request: `cookiecutter list-prompts <template>` — discover template variables without generating files

Author: NevoleMarekCreated Mar 24, 2026Updated Apr 29, 2026

Add a list-prompts subcommand (or --list-prompts flag) that introspects a template and prints all variables with their default values and __prompts__ descriptions, without generating any output.

uvx cookiecutter list-prompts <template-url-or-path>

Motivation

Currently, the only way to discover what a cookiecutter template expects is to:

  1. Read cookiecutter.json manually (requires cloning or browsing the repo)
  2. Run cookiecutter interactively and read prompts one by one
  3. Use --no-input blindly and hope the defaults are sensible

This creates friction in two scenarios:

Human discovery, a user evaluating a template wants to understand what it will ask before committing to running it.

Agentic / automated use — an LLM agent or script wants to construct a non-interactive cookiecutter invocation with the right --extra-vars. Without structured introspection, the agent has to fetch and parse cookiecutter.json out-of-band.

Proposed behaviour

bash
> uvx cookiecutter list-prompts example-template

repo_name (default: "MyLibrary")
  Repository name — no spaces, becomes the GitHub repo slug and Python import
  name (e.g. 'MyAwesomeLibrary').

short_description (default: "Description of {{cookiecutter.repo_name}}")
  One-sentence description of what this library does — used in pyproject.toml,
  README, and MkDocs site.

python_version (default: "3.12")
  Target Python version (major.minor) — sets requires-python in pyproject.toml.

linter_rules_core (default: true)
  Ruff core rules: pycodestyle errors/warnings (E, W), Pyflakes (F) —
  recommended for all projects.

A machine-readable flag would make agentic use straightforward:

bash
$ uvx cookiecutter list-prompts <template> --format json

[
  {
    "key": "repo_name",
    "default": "MyLibrary",
    "prompt": "Repository name — no spaces, becomes the GitHub repo slug..."
  },
  ...
]

What it should do

  • Clone/fetch the template the same way cookiecutter already does
  • Read cookiecutter.json, resolve __prompts__ entries, and pair each variable with its description and default value
  • Print human-readable output by default; offer --format json / --format yaml for machine consumption
  • Exit cleanly without writing any files

Why this belongs in core

The template-fetching and __prompts__ resolution logic already lives in cookiecutter. Exposing it as a separate command avoids every downstream tool (IDEs, TUIs, agent frameworks) having to re-implement the same fetch-and-parse dance. It also gives prompts a practical use case beyond the interactive prompt text, which increases the incentive for template authors to write good descriptions.

Source: cookiecutter/cookiecutter