Skip to content

Features

Handling Existing Projects

  • Overwrite Prompt: Copier intelligently handles existing directories and files. If you run copier copy in an existing project directory, it will prompt you before overwriting files.
  • Skip Files: Use the _copy_without_render list in copier.yaml to specify files or patterns that should not be processed by Copier.

Template Versioning

  • Version Control: Copier can manage template versions, making it easy to upgrade projects to newer versions of the template.
  • _copier_template: This field in copier.yaml indicates the template source path, helping Copier track which template version your project uses.

Advanced Features

  • Dynamic Prompts: You can add dynamic prompts and validations in copier.yaml to gather more specific inputs from users.
  • Complex Templating: Copier supports complex Jinja2 templating, allowing for conditionals, loops, and other logic directly within your template files.

Additional Commands

  • copier diff: Shows the differences between the current project and the template.
  • copier update: Applies the latest changes from the template to the existing project.

Troubleshooting

  • Validation Errors: If Copier encounters issues with template variables or formatting, check copier.yaml for typos or incorrect types.
  • Debugging: Run copier copy --debug to get detailed output, which can help diagnose issues during project generation.

Example Commands

Here are a few example commands for common Copier tasks:

# Create a new project
copier copy git+https://dev.azure.com/initions-consulting/CLOE/_git/cloe-package-template-py new_project

# Update an existing project
cd existing_project
copier update

# Preview changes before applying
copier diff