{"id":13851679,"url":"https://github.com/mattvagni/cookiecutter","last_synced_at":"2026-01-28T09:39:54.723Z","repository":{"id":51348418,"uuid":"91581272","full_name":"mattvagni/cookiecutter","owner":"mattvagni","description":"CLI for quickly creating boilerplate files based on templates you provide.","archived":false,"fork":false,"pushed_at":"2024-06-11T19:26:39.000Z","size":3752,"stargazers_count":37,"open_issues_count":10,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-01T12:13:04.687Z","etag":null,"topics":["boilerplate","cli","dx","node","npm","productivity"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattvagni.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-17T13:45:11.000Z","updated_at":"2025-10-28T21:21:07.000Z","dependencies_parsed_at":"2024-06-21T04:18:02.756Z","dependency_job_id":"ea13dc5e-4162-4847-9fbc-61f9efe1b757","html_url":"https://github.com/mattvagni/cookiecutter","commit_stats":{"total_commits":54,"total_committers":7,"mean_commits":7.714285714285714,"dds":0.2222222222222222,"last_synced_commit":"b8ad9b8a19bc84839c48051680be2062bfb55f91"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mattvagni/cookiecutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattvagni%2Fcookiecutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattvagni%2Fcookiecutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattvagni%2Fcookiecutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattvagni%2Fcookiecutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattvagni","download_url":"https://codeload.github.com/mattvagni/cookiecutter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattvagni%2Fcookiecutter/sbom","scorecard":{"id":628147,"data":{"date":"2025-08-11","repo":{"name":"github.com/mattvagni/cookiecutter","commit":"b8ad9b8a19bc84839c48051680be2062bfb55f91"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 2/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"75 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-4hpf-3wq7-5rpr","Warn: Project is vulnerable to: GHSA-f522-ffg8-j8r6","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T07:05:09.482Z","repository_id":51348418,"created_at":"2025-08-21T07:05:09.482Z","updated_at":"2025-08-21T07:05:09.482Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","cli","dx","node","npm","productivity"],"created_at":"2024-08-04T22:00:37.940Z","updated_at":"2026-01-28T09:39:54.702Z","avatar_url":"https://github.com/mattvagni.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# cookiecutter :cookie: :scissors:\n\n[![CircleCI](https://circleci.com/gh/mattvagni/cookiecutter/tree/master.svg?style=svg)](https://circleci.com/gh/mattvagni/cookiecutter/tree/master) [![Greenkeeper badge](https://badges.greenkeeper.io/mattvagni/cookiecutter.svg)](https://greenkeeper.io/) [![npm version](https://badge.fury.io/js/cookiecutter.svg)](https://badge.fury.io/js/cookiecutter)\n\nA CLI for creating boilerplate files/folders based on templates you provide. Like [Yeoman](http://yeoman.io/) or Python's [Cookiecutter](https://github.com/audreyr/cookiecutter) but much, much simpler.\n\nShow me:\n\n![Example with Error](./images/WithError.gif)\n\nIt is designed for existing projects where you want an easy way to create boilerplate files - instead of having to copy paste an existing file \u0026 then remember to make the necessary changes.\n\nA good use-case for cookiecutter is, for example, creating a new Redux connected React component within a project. Not hard... but also not fun.\n\n:white_check_mark: Cookiecutter supports:\n\n- Multiple templates with the ability to pick which template to use via the CLI.\n- Multiple fields per template with the ability to specify them from the CLI.\n- Custom validation \u0026 error messages for fields.\n- Any type of file or folder structure.\n\n:x: Cookiecutter **doesn't** support:\n\n- Conditionals or any other logic in templates. You can however achieve similar things by having multiple templates).\n- Bootstrapping a project from scratch (i.e I have no code but need to set a project up)\n- Adding code to existing files\n- Lots of other things Yeoman _does_ support. If your use-case is complex, cookiecutter might not cut it.\n\n## Quick Setup\n\nFirst `npm install --save-dev cookiecutter`. You can also install this globally if you prefer.\n\nThe add the following to your package.json (no need to do this if you are using yarn):\n\n```json\n\"scripts\": {\n    \"cookiecutter\": \"cookiecutter\"\n}\n```\n\nYou can now start creating your template. For example if you create a 'templates' folder in your root and add the following template:\n\n```js\n// templates/COMPONENT_NAME.js\nimport React from \"react\";\n\nclass COMPONENT_NAME extends React.Component {\n  render() {\n    return \u003cdiv\u003eHello World\u003c/div\u003e;\n  }\n}\n\nexport default COMPONENT_NAME;\n```\n\nYou can now configure Cookiecutter to replace the string `COMPONENT_NAME` like so by creating a file in the root of your project called `cookiecutter.config.js`. Cookiecutter will always look in your root for a file called `cookiecutter.config.js`.\n\n```js\n// cookiecutter.config.js\nmodule.exports = [\n  {\n    name: \"Normal React Component\",\n    templatePath: \"templates/COMPONENT_NAME.js\",\n    outputPath: \"src/components/\",\n    fields: [\n      {\n        templateVariable: \"COMPONENT_NAME\",\n        question: \"What is the component's name?\"\n      }\n    ]\n  }\n];\n```\n\nIf you now run `npm run cookiecutter` you will be prompted to pick which template you'd like to use. After which you will be asked to answer each field's question. It should look something like this:\n\n![Example from Tutorial](./images/ExampleComponent.gif)\n\nThat's it. Cookiecutter now created the following file:\n\n```diff\n    - src\n      - components\n+       - ExampleComponent.js\n        - OtherComponent.js\n        - Etc.js\n```\n\nCookiecutter will **never** overwrite any existing files.\n\n## Validating fields / custom validation\n\nTo do this you can add `isValid` and a custom `errorMessage` to a fields configuration.\nUsing the example above you could, for example, ensure component names follow a naming convention.\n\n```diff\n// in cookiecutter.config.js\nmodule.exports = [\n    {\n       name: \"Normal React Component\",\n        templatePath: \"templates/COMPONENT_NAME/index.js\",\n        outputPath: \"src/components/\",\n        fields: [\n            {\n                templateVariable: 'COMPONENT_NAME',\n                question: \"What is the component's name?\",\n+               errorMessage: 'A component must be in PascalCase and can only include letters.',\n+               isValid(value) {\n+                   return !!value.match(/^[A-Z][a-z]+(?:[A-Z][a-z]+)*$/g);\n+               }\n            }\n        ]\n    }\n];\n\n```\n\n## Select style options at the field level\n\nSet the `options` key in the `fields` object to enable user-selectable responses to the template variables.\n\n```diff\n// in cookiecutter.config.js\nmodule.exports = [\n    {\n       name: \"Normal React Component\",\n        templatePath: \"templates/COMPONENT_NAME/index.js\",\n        outputPath: \"src/components/\",\n        fields: [\n            {\n                templateVariable: 'COMPONENT_NAME',\n                question: \"What is the component's name?\",\n+               choices: [\"CoolComponent\", \"BigComponent\", \"TestComponent\"],\n            }\n        ]\n    }\n];\n\n```\n\n## Multiple templates\n\nYou can configure multiple templates and Cookiecutter will let you pick which template to use. The template's 'name' is what will be used in the CLI when asking which template to use.\n\nYou can specify multiple templates like so:\n\n```js\n// in cookiecutter.config.js\nmodule.exports = [\n  {\n    // Configuration for the 1st template\n  },\n  {\n    // Configuration for the 2nd template\n  }\n];\n```\n\n## Templates with folders\n\nIf you specify a folder as a template, then the folder will be created in the output directory as well. This is useful if you have a folder structure such as:\n\n```\n- ComponentName\n    - index.js\n    - styles.css\n```\n\nCookiecutter will recursively copy all files within your templates folder and replace any occurrences of your specified fields.\n\nIf you don't want this behavior, specify a file as your template's `templatePath`.\n\n## Custom config location\n\nIf you would like your config to be somewhere else you can use the `-c=path/to/your/config.js` flag when you call cookiecutter.\n\n## Contributing\n\nAfter cloning the repo `yarn install`.\n\nYou can play with the cli in the 'playground' folder. To do this, `cd` into it and run `. run.sh`. This is like running the cli once it's published and on npm but allows you to work on it locally.\n\nTo run tests run `yarn test`.\nTo lint files (this will also happen in CircleCI when you open a PR): `yarn lint`\n\n## Roadmap/Plans\n\n- Offer a set of helpers for validation user input. Esp. for common 'cases' such as snake_case, PascalCase etc.\n- Allow users to specify a custom path for their config.\n- Offer the ability for people to show a message that is only shown AFTER a template is successfully rendered. This could be helpful for things such as help-text such as: 'You can import this component like so: ...'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattvagni%2Fcookiecutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattvagni%2Fcookiecutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattvagni%2Fcookiecutter/lists"}