{"id":30846245,"url":"https://github.com/kusionstack/kusion-templates","last_synced_at":"2025-09-07T00:06:12.936Z","repository":{"id":37932583,"uuid":"488890698","full_name":"KusionStack/kusion-templates","owner":"KusionStack","description":"Templates used by `kusion init --online`","archived":false,"fork":false,"pushed_at":"2024-10-11T03:22:38.000Z","size":44,"stargazers_count":2,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-19T18:42:59.868Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"AMPL","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/KusionStack.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}},"created_at":"2022-05-05T08:30:06.000Z","updated_at":"2024-10-11T03:22:42.000Z","dependencies_parsed_at":"2024-01-30T12:52:27.791Z","dependency_job_id":null,"html_url":"https://github.com/KusionStack/kusion-templates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KusionStack/kusion-templates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KusionStack%2Fkusion-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KusionStack%2Fkusion-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KusionStack%2Fkusion-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KusionStack%2Fkusion-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KusionStack","download_url":"https://codeload.github.com/KusionStack/kusion-templates/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KusionStack%2Fkusion-templates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273978867,"owners_count":25201413,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-07T00:06:07.074Z","updated_at":"2025-09-07T00:06:12.865Z","avatar_url":"https://github.com/KusionStack.png","language":"AMPL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kusion Templates\n\nThis repo contains the templates for `kusion init`, which make it easy to quickly get started building new Kusion projects.\n\n## Adding a new template\n\n 1. Create a new directory for the template, e.g. `my-template-single-stack`. By convention, hyphens are used to separate words and the stack mode is included as a suffix.\n\n 2. Add template files in the new directory.\n\n 3. Write a default configuration set file, aka, `kusion.yaml`.\n\n## Text replacement\n\nKusion templates use [go template](https://pkg.go.dev/text/template) rules to generate output, which is described in `kusion.yaml`.\n\n`kusion.yaml` contains all configurations, including project level and stack level. \n\n- `projectFields` represents project level configurations, which can be covered by stack ones.\n- `stacks` represents stacks level configurations, which is specific to each stack.\n\nEvery field type should be one of these two kinds -- one is primitive, anthor is composite. For example:\n- Primitive\n  - string\n  - int\n  - float\n  - bool\n- Composite\n  - array\n  - map\n  - struct\n  - any\n\nAll variables defined in template shall have an explaination, for example:\n\nGo template: \n```go\nname: {{ .Name }}\nage: {{ .Age }}\ngender: {{- if .Sex }} Male {{- else}} Female {{ end }}\nHobbies: {{ range .Hobbies }}{{\"\\n\"}}- {{.}}{{ end }}\nAdditional: {{ range $k, $v := .Additional }}{{\"\\n\"}}  {{ $k }}: {{ $v }}{{ end }}\n```\n\nField explainations:\n```yaml\n- name: Name\n  type: string\n  default: Tom\n- name: Age\n  type: int\n  default: 8\n- name: Sex\n  type: bool\n  default: true\n- name: Hobbies\n  type: array\n  elem: \n    type: string \n  default: \n    - singing\n    - dancing\n- name: Additional\n  type: map\n  key:\n    type: string\n  value: \n    type: string\n  default:\n    Country: China\n    Language: Simple Chinese\n```\n\nOutput is similar to: \n```yaml\nname: Tom\nage: 8\ngender: Male\nHobbies: \n- dancing\n- singing\nAdditional: \n  Country: China\n  Language: Simple Chinese\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkusionstack%2Fkusion-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkusionstack%2Fkusion-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkusionstack%2Fkusion-templates/lists"}