Skip to content

Cookiecutter/Jinja Support for Remote Templates? #464

@dcernag

Description

@dcernag

Problem statement

When using the remote templates feature, files provided by the remote template (such as pyproject.toml) are currently treated as a literal overlay. This means that dynamic templating using Cookiecutter/Jinja variables (e.g., {{ cookiecutter.project_name }}) is not processed within these files.

I've experienced a couple pain points when authoring/using remote templates:

  • Static pyproject.toml content: Key fields like project.name cannot be dynamically set based on user input during create. Additionally, other configurations within pyproject.toml (e.g., tool.agent-starter-pack settings, dependencies) cannot be conditionally templated based on selected options.
  • Inconsistent Experience: This behavior differs significantly from how built-in templates are processed, where pyproject.toml is dynamically generated and fully customized.

Current Workaround

Currently, I'm asking users to manually update their pyproject.toml after project creation.

Proposed Solution / Question

Is there any plan to support full Cookiecutter/Jinja2 templating for all files within remote templates? This would allow for dynamic configuration and eliminate the need for manual post-creation edits, providing a much smoother and more consistent user experience.

If full templating is not planned in the near future, are there any recommended workarounds or best practices for remote template creators to achieve dynamic pyproject.toml generation or other conditional file content based on create command options?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions