{"id":20516653,"url":"https://github.com/block/scaffolder","last_synced_at":"2026-02-04T14:11:16.542Z","repository":{"id":203639124,"uuid":"709708215","full_name":"block/scaffolder","owner":"block","description":"A general-purpose project scaffolding tool inspired by cookiecutter","archived":false,"fork":false,"pushed_at":"2025-01-14T17:52:14.000Z","size":114,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T19:17:06.977Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/block.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-25T08:35:10.000Z","updated_at":"2024-11-25T02:01:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"9978a0b1-6c38-49c8-b34a-a3cd79d2c712","html_url":"https://github.com/block/scaffolder","commit_stats":null,"previous_names":["tbd54566975/scaffolder","block-open-source/scaffolder"],"tags_count":24,"template":false,"template_full_name":"TBD54566975/tbd-project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Fscaffolder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Fscaffolder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Fscaffolder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Fscaffolder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/block","download_url":"https://codeload.github.com/block/scaffolder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234178410,"owners_count":18791725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-15T21:29:59.881Z","updated_at":"2026-02-04T14:11:16.536Z","avatar_url":"https://github.com/block.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A general-purpose project scaffolding library and tool inspired by [cookiecutter](https://github.com/cookiecutter/cookiecutter)\n\n[![stability-experimental](https://img.shields.io/badge/stability-experimental-orange.svg)](https://github.com/mkenney/software-guides/blob/master/STABILITY-BADGES.md#experimental) [![Go Reference](https://pkg.go.dev/badge/github.com/block/scaffolder.svg)](https://pkg.go.dev/github.com/block/scaffolder) [![CI](https://github.com/block/scaffolder/actions/workflows/ci.yml/badge.svg)](https://github.com/block/scaffolder/actions/workflows/ci.yml)\n\n\u003c!-- Note that everything after in this README is used to generate the --help documentation for the command line tool. --\u003e\n\n---\n\nScaffolder recursively evaluates a directory hierarchy of templates into a destination using JSON as the template context. It follows these rules:\n\n- Templates are evaluated using the Go template engine.\n- Both path names and file contents are evaluated.\n- If a file name ends with \".tmpl\", the \".tmpl\" suffix will be removed.\n- If a file or directory name evalutes to the empty string it will be excluded.\n- If a file named \"template.js\" exists in the root of the template directory,\n  all functions defined in this file will be available as Go template functions.\n- Directory and file names in templates can be expanded multiple times\n  using the \"push\" function. This function takes two arguments, the\n  file/directory name and the context to use when evaluating templates within\n  the file/directory.\n- The following functions are available as Go template functions: \"snake\", \"screamingSnake\", \"camel\", \"lowerCamel\",\n  \"kebab\", \"screamingKebab\", \"upper\", \"lower\", \"title\",\n\n\nFor example, given the following files and directories as the template:\n\n\ttemplate/\n\t  {{ range .modules }}{{ push .name  . }}{{ end }}/\n\t    file.txt\n\nAnd the context \"context.json\":\n\n    {\n      \"modules\": [\n        {\"name\": \"module1\", \"path\": \"path1\"},\n        {\"name\": \"module2\", \"path\": \"path2\"}\n      ]\n    }\n\nRunning scaffolder with:\n\n    scaffolder --json context.json --template template --dest dest\n\nThe output \"dest\" directory will contain the following files and directories:\n\n    module1/\n      file.txt\n    module2/\n      file.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock%2Fscaffolder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblock%2Fscaffolder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock%2Fscaffolder/lists"}