{"id":34144310,"url":"https://github.com/abenz1267/related","last_synced_at":"2026-03-09T22:02:57.070Z","repository":{"id":57692021,"uuid":"481976501","full_name":"abenz1267/related","owner":"abenz1267","description":" Related is a simple cli utility tool to create files or a group of files.","archived":false,"fork":false,"pushed_at":"2022-05-01T17:35:39.000Z","size":73,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-10T06:22:24.866Z","etag":null,"topics":["cli","golang","productivity","tooling"],"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/abenz1267.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":"2022-04-15T14:00:03.000Z","updated_at":"2022-04-16T12:36:22.000Z","dependencies_parsed_at":"2022-08-27T18:50:21.328Z","dependency_job_id":null,"html_url":"https://github.com/abenz1267/related","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/abenz1267/related","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abenz1267%2Frelated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abenz1267%2Frelated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abenz1267%2Frelated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abenz1267%2Frelated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abenz1267","download_url":"https://codeload.github.com/abenz1267/related/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abenz1267%2Frelated/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["cli","golang","productivity","tooling"],"created_at":"2025-12-15T03:42:02.198Z","updated_at":"2026-03-09T22:02:57.065Z","avatar_url":"https://github.com/abenz1267.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/abenz1267/related)](https://goreportcard.com/report/github.com/abenz1267/related)\n\n# Related - Create files based on individual definitions or groups\n\nRelated helps with common file-creation-based tasks. You can predefine single types as well as groups. Scripts (lua, binary, javascript [needs node]) can be executed pre/post file creation as well as pre/post groups.\n\n## Installation\n\nDownload binary for your platform from the releases here or simply build from source.\n\n## Usage\n\n!! You can use either _.json or _.yaml for configuration files !!\n\nPlace a \"(.)related.json\" file in your project folder. You can also place `\u003cfile\u003e.json` files in the `.related` folder. Wherever you like. Paths should be relative to the `.related` or `config/related` folder though. Type and group names can't be ambiguous, Related will check this on start.\n\nSplitting into multiple config files can help with organization.\n\nContent example:\n\n```json\n{\n    \"types\": [\n        {\n            \"name\": \"component\",\n            \"template\": \"typescript/NextFuncComponent.tmpl\",\n            \"path\": \"\",\n            \"pre\": \"typescript/MyCustomJS.lua\",\n            \"post\": \"typescript/MyCustomPostScript.lua\",\n            \"suffix\": \".tsx\"\n        },\n        {\n            \"name\": \"cssmodule\",\n            \"path\": \"styles\",\n            \"suffix\": \".module.css\"\n        }\n    ],\n    \"groups\": [\n        {\n            \"name\": \"component\",\n            \"types\": [\"component\", \"cssmodule\"],\n            \"pre\": \"typescript/MyCustomGroupPreScript\",\n            \"post\": \"typescript/MyCustomGroupPostScript\"\n        }\n    ]\n}\n```\n\nIf no template is provided, the file will be empty.\n\n### Type-Inheritance\n\nYou can inherit types like this:\n\n```yaml\ntypes:\n    - name: parent\n      suffix: .tsx\n      path: components\n      template: typescript/rfc.tmpl\n    - name: parent/other\n      path: othercomponents\n```\n\nThe `path` will be relative to the `parent` type, so in this case the `path` of `parent/other` will be `components/othercomponents`.\nParents can be any type defined wherever. They don't have to be in the same file.\n\n**Important**: properties can be set to an empty string by overwriting it with `CLEAR`, so f.e. `path: CLEAR` will set the path to `\"\"` instead of `\"components\"`\n\n### Commands\n\n| Command                                                                  | Function                                                                                                                                   |\n| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| `list \u003cscripts,templates,groups,types\u003e \u003cparent if scripts or templates\u003e` | Lists all available template/scripts, grouped by parent-folder, or groups and types. The parent is optional for listing templates/scripts. |\n| `\u003ctype or group\u003e \u003cname\u003e \u003cfilename\u003e`                                      | Creates the file(s) based on the type or group provided                                                                                    |\n\n### Custom Files\n\nCustom files like templates or scripts can be either placed in a `.related` folder near the config or in a `related` folder in your users config directory. Templates must be placed inside `templates` and scripts inside `scripts`. You can nest further.\n\nRelated will prioritize project-level files over config ones.\n\n### Templates\n\nTemplates are vanilla Golang templates. Data passed to templates:\n\n| data              | read via          |\n| ----------------- | ----------------- |\n| working directory | `{{.workingDir}}` |\n| path              | `{{.path}}`       |\n| name              | `{{.name}}`       |\n| suffix            | `{{.suffix}}`     |\n\n### Scripts\n\nThe following types are executable: lua scripts, javascript (via node), and binaries.\n\nYou can execute scripts by settings pre- and post-scripts in the type or group definition. Related will look for the script and execute it according to the lifecycle.\n\nPassed command-line arguments:\n\n1. current working directory\n2. path\n3. filename\n4. suffix\n\n### Hints\n\n1. A failure creating a single type won't result in the whole group-creation aborting. This means if f.e. you create a single type and later want to create a group but the type has already been created, it'll simply print out an error and continue creating the rest of the types.\n2. A failures trying to execute a script will result in abortion of the type at that certain lifecycle. F.e. a failure in a script running pre-creation will stop the creation process there.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabenz1267%2Frelated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabenz1267%2Frelated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabenz1267%2Frelated/lists"}