# Copier — Render Project Templates with Answers and Updates > Copier is a Python-based project scaffolding tool that renders templates from Git repositories, supports answer-driven customization, and can update previously generated projects when the template evolves. ## Install Save in your project root: # Copier — Render Project Templates with Answers and Updates ## Quick Use ```bash pipx install copier copier copy gh:user/my-template ./my-project ``` ## Introduction Copier is a command-line tool and Python library for generating projects from template repositories. It asks the user a series of questions, renders Jinja templates with the answers, and can later update generated projects when the upstream template changes — preserving local modifications. ## What Copier Does - Generates project scaffolds from Git-hosted or local template directories - Prompts users with configurable questions and validates answers with types and constraints - Renders files and directory names using Jinja2 templating with the collected answers - Updates previously generated projects by replaying template changes on top of local edits - Supports conditional file inclusion, multi-choice prompts, and computed values ## Architecture Overview Copier clones the template repository, reads a `copier.yml` configuration file that defines questions and settings, collects answers interactively or from a file, and renders all Jinja2 templates in the source tree into the destination directory. A `.copier-answers.yml` file is saved in the generated project, enabling future `copier update` runs to diff the old template version against the new one and apply changes while respecting local modifications via a three-way merge. ## Self-Hosting & Configuration - Install via pipx: `pipx install copier` (recommended) or pip: `pip install copier` - Define template questions and defaults in a `copier.yml` at the template root - Use Jinja2 syntax in filenames and file contents with `{{ variable }}` placeholders - Tag template versions with Git tags so consumers can update between specific releases - Run `copier update` in a generated project to pull in upstream template improvements ## Key Features - Template update workflow that three-way-merges upstream changes with local project edits - Rich question types including text, integer, float, boolean, choice, and multi-choice - Conditional file rendering and directory creation based on answer values - Subdirectory support for templates that live inside a larger monorepo - Extensible via pre- and post-generation tasks defined in the template configuration ## Comparison with Similar Tools - **Cookiecutter** — The original Python project templater; Copier adds template updates, richer question types, and Git-tag versioning - **Yeoman** — Node.js generator ecosystem; Copier is Python-native with built-in update support - **degit** — Copies Git repos without history; Copier adds templating, questions, and updates - **Hygen** — File generator for JavaScript projects; Copier is language-agnostic with answer-driven scaffolding - **Plop** — Micro-generator for adding files to existing projects; Copier generates full project scaffolds with lifecycle updates ## FAQ **Q: How does Copier handle template updates?** A: Copier stores your answers in `.copier-answers.yml`. Running `copier update` diffs the old and new template versions, then applies the changes to your project with a three-way merge. **Q: Can I use Copier with non-Python projects?** A: Yes. Copier is language-agnostic. Templates can generate projects in any language or framework. **Q: Does Copier support private Git repositories?** A: Yes. Copier uses Git for cloning, so any repository accessible via SSH keys or credential helpers works. **Q: How do I skip certain questions programmatically?** A: Define `when` conditions in `copier.yml` that reference previous answers. Questions with a false `when` are skipped and use their default values. ## Sources - https://github.com/copier-org/copier - https://copier.readthedocs.io/ --- Source: https://tokrepo.com/en/workflows/asset-bd98bba9 Author: AI Open Source