96 lines
7.5 KiB
Markdown
96 lines
7.5 KiB
Markdown
---
|
|
title: cookiecutter/cookiecutter — Jinja2 변수 기반 프로젝트 templating 도구
|
|
source_type: official-doc
|
|
url: https://github.com/cookiecutter/cookiecutter
|
|
archive_url:
|
|
status: raw
|
|
confidence: high
|
|
tags: [ca-tmpl, scaffolding, sample-removal, cookiecutter, template-engine, official-doc]
|
|
related_projects: [ca-tmpl]
|
|
related_branches: [feature-sample-removal-adoption-contract]
|
|
created: 2026-05-22
|
|
last_reviewed: 2026-05-27
|
|
---
|
|
|
|
# cookiecutter/cookiecutter — Jinja2 변수 기반 프로젝트 templating 도구
|
|
|
|
> Layer: `raw/official-docs/` — Python 진영 reference scaffolding 도구 `cookiecutter/cookiecutter` 의 GitHub README 발췌. ca-tmpl Group H — Sample removal / adoption 의 대안 2 (generator + Jinja2 변수 모델) 1차 근거.
|
|
|
|
## Parent / 활용 branch (필수)
|
|
|
|
| Branch | 이 자료가 정당화하는 결정 |
|
|
|---|---|
|
|
| [[raw/branch-notes/feature-sample-removal-adoption-contract]] | Group H 대안 2 — Cookiecutter generator 모델이 sample-on/off 를 generate-time 단일 결정으로 환원한다는 비교점의 근거 |
|
|
|
|
상위 프로젝트: [[raw/project-notes/ca-skeleton-operational-contract]].
|
|
|
|
## 컨텍스트 / 왜 저장했는지
|
|
|
|
ca-tmpl sample removal / adoption 결정 대안 2. Cookiecutter는 "template 변수를 채워 한 번에 sample 없는 프로젝트 생성" 모델 — ca-tmpl의 "removal step" 자체가 필요 없는 generator 접근. 두 모델의 비교점.
|
|
|
|
## 출처 / Source
|
|
|
|
- 원본 URL: https://github.com/cookiecutter/cookiecutter
|
|
- 문서: https://cookiecutter.readthedocs.io/
|
|
- 아카이브 URL: (미수집)
|
|
- 저자/조직: Audrey M. Roy Greenfeld 외 cookiecutter org
|
|
- Star 수: 23,000+
|
|
- 라이선스: BSD-3-Clause
|
|
- 마지막 확인일: 2026-05-27
|
|
|
|
## 핵심 인용 / Key quotes (verbatim)
|
|
|
|
> [§README — Definition] "A cross-platform command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, C projects."
|
|
|
|
> [§README — Cross-platform] "Cross-platform: Windows, Mac, and Linux are officially supported. You can generate a project in any language or markup format."
|
|
|
|
> [§README — Template languages] "Templates can be in any programming language or markup format: Python, JavaScript, Ruby, CoffeeScript, RST, Markdown, CSS, HTML, etc."
|
|
|
|
> [§README — How it works] "Simply create a project template with a cookiecutter.json file in the root. Use Jinja2 templating in any file or directory name."
|
|
|
|
## Claims Extracted / 추출된 주장
|
|
|
|
| Claim ID | Claim (이 자료가 직접 말하는 것) | Evidence quote | Strength | Applies to | Does not prove |
|
|
|---|---|---|---|---|---|
|
|
| SCAF-CC-C1 | Cookiecutter 는 cross-platform CLI 유틸리티로, "cookiecutters" 라 부르는 project template 으로부터 프로젝트를 생성한다 (예: Python package, C 프로젝트) | [§README — Definition] "A cross-platform command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, C projects." | `official-vendor-doc` | 일반 CLI scaffolding 도구 선택 | 모든 언어/프레임워크의 best-practice 라는 뜻은 아님 |
|
|
| SCAF-CC-C2 | Cookiecutter 는 Windows / Mac / Linux 를 공식 지원하며 어떤 언어/markup 포맷의 프로젝트도 생성 가능하다 | [§README — Cross-platform] "Cross-platform: Windows, Mac, and Linux are officially supported. You can generate a project in any language or markup format." | `official-vendor-doc` | OS / 언어 무관 scaffolding 도입 검토 | "any language" 가 모든 언어에서 동일한 ergonomics 라는 뜻은 아님 |
|
|
| SCAF-CC-C3 | Template 은 Python, JavaScript, Ruby, CoffeeScript, RST, Markdown, CSS, HTML 등 어떤 프로그래밍 언어/markup 포맷이든 가능 | [§README — Template languages] "Templates can be in any programming language or markup format: Python, JavaScript, Ruby, CoffeeScript, RST, Markdown, CSS, HTML, etc." | `official-vendor-doc` | 다양한 출력 포맷 template | Java/Kotlin/Spring Boot 같은 JVM 진영에서도 동일하게 권장된다는 뜻은 아님 (인용 목록은 예시) |
|
|
| SCAF-CC-C4 | Template 작성은 root 에 `cookiecutter.json` 을 두고, 파일/디렉토리 이름에 Jinja2 templating 을 사용하면 된다 | [§README — How it works] "Simply create a project template with a cookiecutter.json file in the root. Use Jinja2 templating in any file or directory name." | `official-vendor-doc` | Cookiecutter template 저자 | Jinja2 placeholder 가 들어간 template 코드를 그대로 compile/test 가능하다는 뜻은 아님 (generator 시점에 치환됨) |
|
|
|
|
## Usage Boundaries / 적용 경계
|
|
|
|
- **이 자료가 직접 증명하는 것**:
|
|
- `SCAF-CC-C1`: cookiecutter 의 정체성 (cross-platform CLI generator)
|
|
- `SCAF-CC-C2`: 공식 OS 지원 범위 (Windows / Mac / Linux)
|
|
- `SCAF-CC-C3`: 출력 가능한 언어/포맷의 광범위함
|
|
- `SCAF-CC-C4`: template 작성 메커니즘 (`cookiecutter.json` + Jinja2 placeholder)
|
|
- **이 자료가 증명하지 않는 것**:
|
|
- Jinja2 placeholder 가 들어간 template repo 자체를 직접 빌드/테스트하는 dual-mode CI 가 가능하다는 뜻 아님 (ca-tmpl 의 sample-on/off matrix 모델과 호환 불가능 가능성)
|
|
- ca-tmpl 의 7-step adoption checklist (domain rename, package rename, profile cleanup 등) 가 모두 Cookiecutter prompt 변수로 환원된다는 뜻은 아님
|
|
- JVM/Spring Boot 진영에서 Cookiecutter 가 reference 도구로 사용된다는 뜻은 아님 (예시 목록에 Python/C 만 명시)
|
|
- **내 프로젝트에 적용하려면 추가 확인이 필요한 것**:
|
|
- Spring Boot Java 코드에 Jinja2 placeholder 를 삽입했을 때 IDE 빌드/테스트 가능성
|
|
- ca-tmpl sample-ticket 을 `{% if cookiecutter.include_sample == 'yes' %}` 같은 옵셔널 블록으로 표현했을 때 검증 fixture 로서의 역할이 보존되는지
|
|
- Cookiecutter generator 시점에 dual-mode CI matrix 를 외부에서 별도로 유지할 수 있는지
|
|
|
|
## 메모
|
|
|
|
- 동작 모델: `cookiecutter.json`에 변수 정의 → `{{cookiecutter.project_name}}` 같은 Jinja2 placeholder를 파일/디렉토리에 사용 → CLI prompt로 값 받아 결과 생성.
|
|
- ca-tmpl과의 차이: Cookiecutter는 "generate-time customization"이라 sample-ticket을 변수로 옵셔널화 가능(`{% if cookiecutter.include_sample == 'yes' %}`). 즉 ca-tmpl의 dual-mode CI matrix(sample-on / sample-off)를 generator 시점에 단일 결정으로 환원.
|
|
- 장점: removal step 0개. 생성 직후 바로 적용 가능. Python 생태계 표준.
|
|
- 단점: **Jinja2 placeholder가 들어간 코드는 generator template 상태에서 compile/test 불가**. ca-tmpl이 채택한 "sample-on CI matrix에서 skeleton 자체를 빌드/테스트한다"가 Cookiecutter에선 어려움.
|
|
- 추가 단점: ca-tmpl의 7-step adoption checklist(domain rename, package rename, profile cleanup 등)는 Cookiecutter prompt 변수로는 표현이 부족 — 도입 후 코드 적응이 필요한 항목이 남음.
|
|
- 신뢰도: official-doc. Python 진영 reference.
|
|
|
|
## Related / 관련
|
|
|
|
- 같은 주제 다른 official-doc (Group H — Sample removal / adoption 대안 5종):
|
|
- [[raw/official-docs/scaffolding-spring-initializr]] — 대안 4 (Spring Initializr)
|
|
- [[raw/official-docs/scaffolding-degit-svelte-github]] — 대안 3 (degit)
|
|
- [[raw/official-docs/scaffolding-github-template-repository]] — 대안 5 (GitHub Template Repository)
|
|
- 인용하는 branch:
|
|
- [[raw/branch-notes/feature-sample-removal-adoption-contract]]
|
|
- canonical contract 섹션:
|
|
- [[raw/project-notes/ca-skeleton-operational-contract#Sample Removal / Project Adoption]]
|
|
- 인용하는 wiki: (미작성)
|