Features¶
Handling Existing Projects¶
- Overwrite Prompt: Copier intelligently handles existing directories and files. If you run
copier copyin an existing project directory, it will prompt you before overwriting files. - Skip Files: Use the
_copy_without_renderlist incopier.yamlto 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 incopier.yamlindicates 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.yamlto 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.yamlfor typos or incorrect types. - Debugging: Run
copier copy --debugto get detailed output, which can help diagnose issues during project generation.
Example Commands¶
Here are a few example commands for common Copier tasks: