{"id":13692332,"url":"https://github.com/adobe/go-starter","last_synced_at":"2025-05-02T19:31:51.878Z","repository":{"id":57512015,"uuid":"238512407","full_name":"adobe/go-starter","owner":"adobe","description":"Bootstrap a new project from a template.","archived":true,"fork":false,"pushed_at":"2020-05-29T16:55:19.000Z","size":105,"stargazers_count":84,"open_issues_count":0,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-12T18:39:33.611Z","etag":null,"topics":[],"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/adobe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-05T17:48:37.000Z","updated_at":"2024-06-20T01:51:57.000Z","dependencies_parsed_at":"2022-08-31T08:52:18.227Z","dependency_job_id":null,"html_url":"https://github.com/adobe/go-starter","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fgo-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fgo-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fgo-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adobe%2Fgo-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adobe","download_url":"https://codeload.github.com/adobe/go-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252095288,"owners_count":21693895,"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-08-02T17:00:56.735Z","updated_at":"2025-05-02T19:31:51.537Z","avatar_url":"https://github.com/adobe.png","language":"Go","readme":"# Go Starter\n\nGo-starter allows to bootstrap a new project from a template. It uses Git repositories as templates and is shipped with batch of utilities to make bootstarpping easier.\n\n[Learn more](https://medium.com/@sergey.kolodyazhnyy/go-starter-f47daac57f44)\n\n## Installation\n\nDownload latest release from [release](https://github.com/adobe/go-starter/releases) page using one of the commands below.\n\n**Mac OS**\n\n```\ncurl https://github.com/adobe/go-starter/releases/latest/download/go-starter-darwin-amd64.tgz \\\n  -sSfL -o go-starter.tgz\n```\n\n**Linux**\n\n```\ncurl https://github.com/adobe/go-starter/releases/latest/download/go-starter-linux-amd64.tgz \\\n  -sSfL -o go-starter.tgz\n```\n\nUnpack content of the archive to a directory listed in `$PATH`. The archive includes multiple binaries shipped with `go-starter`.\n\n```\ntar -xvzf go-starter.tgz -C /usr/local/bin\nrm go-starter.tgz\n```\n\nRun `go-starter` to verify it's installed correctly.\n\n## Usage\n\nRun go-starter with template repository URL and path where you would like to create a new project, for example:\n\n```bash\ngo-starter starter-template/hello-world-starter awesome-project\n```\n\nYou can specify full GitHub URL or just repository name (like so `starter-template/hello-world-starter`). \n\nNow, go-starter will clone [hello-world-starter](https://github.com/starter-template/hello-world-starter) into `./awesome-project` directory and run tasks defined in [`.starter.yml`](https://github.com/starter-template/hello-world-starter/blob/master/.starter.yml). See \"Templates\" for more details.\n\n### Advanced usage\n\nYou can skip cloning, for example if template is already cloned, but task failed to execute by passing `-skip-clone` flag. \n\nYou can also pass additional variables (or pre-define variables instead of entering them using prompt) using `-var` flag.\n\n## Templates\n\nTemplates are regular Git repositories like this one. If you try to use go-starter with random repository it will just clone it to your computer. To make use of go-starter you would need to let it know how to \"post-process\" template repository after it has been cloned. To do so, you need to define `.starter.yml` configuration file. \n\nAfter go-starter clones repository it tries to load `.starter.yml` to execute additional actions and turn template into a project. This configuration file defines two sections:\n\n- `questions` - list of questions to be asked from user, for example: project name, binary name, team etc\n- `tasks` - list of commands to be executed (these can be globally installed binaries, or binaries packed with template itself)\n\nHere is an example of `.starter.yml`:\n\n```yaml\nquestions:\n  - message: Application name\n    name: \"application_name\"\n    type: input\n    regexp: ^[a-z0-9\\-]+$\n    help_msg: Must be lowercase characters or digits or hyphens\n  - message: GitHub owners\n    name: \"github_owners\"\n    type: input\n    regexp: ^[a-z0-9\\-]+$\n    help_msg: Must be lowercase characters or digits or hyphens\n\ntasks:\n  - command: [ \"go-starter-replace\" ]\n  - command: [ \"rm\", \".starter.yml\" ]\n```\n\nThis file defines two questions, asking user to enter `application_name` and `github_owners` variables. Then, go-starter will execute `go-starter-replace` binary (shipped with go-starter) to replace placeholders in the files of the template, turning generic tempalte into something more specific to the project. Finally it will use standard `rm ` command to remove `.starter.yml`.\n\nEach template may contain custom tasks placed in `.starter` folder. For example, you can create a bash script which would generate CODEOWNERS file and place it under `.starter/make-owners`. Then, add it as tasks in `.starter.yml` like so:\n\n```yaml\n...\n\ntasks:\n...\n  - command: [ \"./.starter/make-owners\" ]\n```\n\nCustom scripts may access variables (answers to the questions) through environment variables. They are uppercased and prefixed with `STARTER_`. Following example above, `./.starter/make-owners` may get `github_owners` variable using `STARTER_GITHUB_OWNERS` environment variable. \n\n## Build-in tasks\n\nGo-starter ships with few additional binaries which can be used as tasks in `.starter.yml`.\n\n### go-starter-replace\n\nThis binary recursively goes through files in current folder and replaces placeholders to variable values in files and their names. By default, placeholders are surrounded by `\u003c` and `\u003e`.\n\n#### Usage\n\n```bash\nUsage: go-starter-replace [flags]\n\nExample:\n    STARTER_PLACEHOLDER1=VALUE1 STARTER_PLACEHOLDER2=VALUE2 go-starter-replace\n\nFlags:\n  -prefix string\n        Placeholder prefix (default \"\u003c\")\n  -suffix string\n        Placeholder suffix (default \"\u003e\")\n```\n\n### go-starter-github\n\nThis binary automatically created GitHub repository, initiates local Git repository, adds GitHub remote and pushes changes to GitHub.\n\n#### Usage\n\n```bash\nUsage: go-starter-github [flags] \u003cgithub-org\u003e \u003cgithub-repo\u003e\n\nExample:\n    go-starter-github adobe awesome-project\n\nFlags:\n  -branch string\n        Name of the master branch (default \"master\")\n  -collaborator value\n        Add collaborators to the repository by GitHub username. You can grant permissions using following format: \u003cusername\u003e:\u003cpermission\u003e. Permission can be: pull (read only), push (read and write) or admin (everything), default is push. Can be specified multiple times. Example: --collaborator octocat:pull\n  -deploy-key string\n        Add SSH deployment key to the repository, add ':rw' suffix to grant write permissions to the key\n  -public\n        Make repository public\n  -remote string\n        Name of the remote in local repository (default \"upstream\")\n  -with-issues\n        Enable issues in GitHub\n  -with-projects\n        Enable projects in GitHub\n  -with-wiki\n        Enable wiki page in GitHub\n```\n\n### go-starter-drone\n\nThis binary configures drone integration and runs first build.\n\n#### Usage\n\n```bash\nUsage: go-starter-drone [flags] \u003cdrone-url\u003e \u003corg-name\u003e \u003crepo-name\u003e\n\nExample:\n    go-starter-drone https://cloud.drone.io adobe awesome-project\n\nFlags:\n  -pull-secret-file value\n        Create a secret from file available for pull-requests (eq. --pull-secret-file=secret_name=./path/to/file)\n  -pull-secret-literal value\n        Create a secret from literal available for pull-requests (eq. --pull-secret-literal=secret_name=value)\n  -secret-file value\n        Create a secret from file (eq. --secret-file=secret_name=./path/to/file)\n  -secret-literal value\n        Create a secret from literal (eq. --secret-literal=secret_name=value)\n```\n","funding_links":[],"categories":["开源类库","Open source library"],"sub_categories":["项目骨架","Project Skeleton"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe%2Fgo-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadobe%2Fgo-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadobe%2Fgo-starter/lists"}