{"id":24919740,"url":"https://github.com/steinfletcher/t8","last_synced_at":"2025-03-28T10:12:49.602Z","repository":{"id":49572234,"uuid":"136442039","full_name":"steinfletcher/t8","owner":"steinfletcher","description":":construction: A tool to create scaffolding tools","archived":false,"fork":false,"pushed_at":"2021-06-14T05:29:56.000Z","size":56,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T10:37:15.449Z","etag":null,"topics":["generator","go","golang","scaffolding","templates"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steinfletcher.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":null,"security":null,"support":null}},"created_at":"2018-06-07T07:52:49.000Z","updated_at":"2021-08-09T14:46:09.000Z","dependencies_parsed_at":"2022-08-20T05:01:32.360Z","dependency_job_id":null,"html_url":"https://github.com/steinfletcher/t8","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Ft8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Ft8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Ft8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Ft8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steinfletcher","download_url":"https://codeload.github.com/steinfletcher/t8/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246009071,"owners_count":20708881,"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":["generator","go","golang","scaffolding","templates"],"created_at":"2025-02-02T10:37:18.279Z","updated_at":"2025-03-28T10:12:49.585Z","avatar_url":"https://github.com/steinfletcher.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/steinfletcher/t8.svg?token=iwqcySR3NwvVKvZeyk52\u0026branch=master)](https://travis-ci.com/steinfletcher/t8)\n[![Go Report Card](https://goreportcard.com/badge/github.com/steinfletcher/t8)](https://goreportcard.com/report/github.com/steinfletcher/t8)\n\n*This is experimental and the API is likely to change*\n\n# t8\n\n`t8` is a simple CLI application that renders templates defined on Github (and other locations).\n\nInspired by [giter8](http://www.foundweekends.org/giter8/).\n\n## Install\n\nInstall using Go\n\n```bash\ngo get github.com/steinfletcher/t8/cmd/t8\n```\n\nOr download a prebuilt binary from github releases.\n\n## Use cases\n\n* A scaffolding tool for generating boilerplate applications (like Yeoman or sbt minus the build step)\n* Generator for microservice applications for consistency and speed \n* Automate generation of config files\n\n## Features\n\n* Uses Go templating\n* Define config as HCL or YAML\n* Interactive CLI to prompt for parameters\n* Pass input parameters as arguments (useful in CI)\n* Use [sprig](http://masterminds.github.io/sprig/) functions in templates \n\n## Usage\n\n## Interactive CLI\n\n```bash\n$ t8 new https://github.com/myOrg/myTemplate my-amazing-app\n\nEnter the required parameters to generate \"My Amazing App\".\n\nproject name[acme]: My amazing app\ngo version[1.12]: \n\nTemplate created: /home/stein/code/my-amazing-app\n```\n\n### Pass input parameters\n\n```bash\n$ t8 -ProjectName=acme -GoVersion=1.12 https://github.com/org/go-echo-template.t8 my-amazing-app\n\nTemplate created: /home/stein/code/my-amazing-app\n```\n\n## Configuration\n\nCreate a Go template and host it on github. Create a file called `t8.hcl` or `t8.yml` in the root of the project. This is the configuration file where you can configure your generator.\n\n### Templates\n\n`t8` uses Go's standard templating support. It adds some useful template functions via [sprig](http://masterminds.github.io/sprig/), which allows you to manipulate the parameters\n\n```gotemplate\nHello {{ .Parameter.Name | lower | snakecase }}\n```\n\n### Parameters\n\nA `parameter` is a variable set at runtime and is made accessible to your Go template. You can also define defaults\n\n```hcl\nparameter \"ProjectName\" {\n  type = \"string\"\n  description = \"the project name\"\n  default = \"acme\"\n}\n```\n\nIn this example the user will be prompted to enter the project name or provide it as a command line flag. If the user does not define this variable the default value is used.\n\n### Parameter Types\n\n`string` - the default type.\n\n`option` - presents an option list to the user. Example\n\n```hcl\nparameter \"SqlDialect\" {\n  type = \"option\"\n  description = \"the SQL dialect\"\n  default = [\n    \"postgresql\",\n    \"mysql\",\n  ]\n}\n``` \n\n### Exclude Paths\n\nYou can exclude the generation of files and directories using the `excludePath` variable. \n\n```hcl\nexcludePath \"Scripts\" {\n  paths = [\n    \"test.sh\",\n  ]\n}\n```\n\nThis configures an unconditional exclusion on a path pattern - the `test.sh` file will be excluded from the final generated content. You can also exclude paths based on the value of a parameter.\n\n```hcl\nexcludePath \"Postgres\" {\n  paths = [\n    \"^/postgres/.*$\"\n  ]\n  parameterName = \"SqlDialect\"\n  operator = \"notEqual\"\n  parameterValue = \"postgresql\"\n}\n```\n\nIn this example, the `/postgres` directory will not be generated if the `SqlDialect` parameter is not equal to `postgresql`. The available operators are `equal` and `notEqual`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteinfletcher%2Ft8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteinfletcher%2Ft8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteinfletcher%2Ft8/lists"}