{"id":17882166,"url":"https://github.com/nao1215/mkgoprj","last_synced_at":"2025-10-04T09:32:26.669Z","repository":{"id":37581411,"uuid":"445988727","full_name":"nao1215/mkgoprj","owner":"nao1215","description":"mkgoprj - Golang project template generator","archived":false,"fork":false,"pushed_at":"2025-02-21T04:55:04.000Z","size":469,"stargazers_count":21,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T11:04:54.631Z","etag":null,"topics":["cli-app","generator","go","golang","golang-development","template-project"],"latest_commit_sha":null,"homepage":"","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/nao1215.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-09T04:02:52.000Z","updated_at":"2025-03-17T08:41:14.000Z","dependencies_parsed_at":"2024-06-19T06:12:52.108Z","dependency_job_id":"1cc7e695-1f44-40e5-863f-cec92216b2bf","html_url":"https://github.com/nao1215/mkgoprj","commit_stats":null,"previous_names":["nao1215/ubume"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fmkgoprj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fmkgoprj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fmkgoprj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nao1215%2Fmkgoprj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nao1215","download_url":"https://codeload.github.com/nao1215/mkgoprj/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959443,"owners_count":20538625,"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":["cli-app","generator","go","golang","golang-development","template-project"],"created_at":"2024-10-28T12:48:28.600Z","updated_at":"2025-10-04T09:32:26.581Z","avatar_url":"https://github.com/nao1215.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/nao1215/mkgoprj/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/nao1215/mkgoprj/v2/actions/workflows/build.yml)\n[![reviewdog](https://github.com/nao1215/mkgoprj/actions/workflows/review_dog.yml/badge.svg)](https://github.com/nao1215/mkgoprj/v2/actions/workflows/review_dog.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nao1215/mkgoprj/v2)](https://goreportcard.com/report/github.com/nao1215/mkgoprj/v2)   \n[[日本語]](./doc/README.ja.md)\n# mkgoprj - Golang project template generator\n![Screenshot](./doc/images/demo.gif) \n  \nmkgoprj command generate golang project template at current directory. The following three projects can be created.\n- Library project\n- Command Line Interface project with [cobra](https://github.com/spf13/cobra)\n\nThe automatically generated files include \"Makefile for easy project management\" and \"GitHub Actions files (build, unit test, review-dog, goreleaser, dependabot)\". However, it does not run \"$ git init\". mkgoprj is cross-platform software that runs on Windows, Mac and Linux. [The release page](https://github.com/nao1215/mkgoprj/releases) contains packages in .deb, .rpm, and .apk formats.   \n  \n# How to install\n## Step1. Install golang\nIf you don't install golang in your system, please install Golang first. Check the [Go official website](https://go.dev/doc/install) for how to install golang.\n## Step2. Install mkgoprj\n```\n$ go install github.com/nao1215/mkgoprj/v2@latest\n```\n  \n# How to use\n## Generate application project\nIn the following example, the mkgoprj command will generate a sample project. The binary name will be sample, and build using Makefile.\n```\n$ mkgoprj cli github.com/nao1215/sample  ※ Argument is same as \"$ go mod init\"\nmkgoprj starts creating the 'sample' application project (import path='github.com/nao1215/sample')\n\n[START] check if mkgoprj can create the project\n[START] create directories\n[START] create files\n        sample (your project root)\n         ├─ CODE_OF_CONDUCT.md\n         ├─ main.go\n         ├─ Makefile\n         ├─ Changelog.md\n         ├─ .goreleaser.yml\n         ├─ cmd\n         │  ├─ version.go\n         │  └─ root.go\n         ├─ .github\n         │  ├─ dependabot.yml\n         │  ├─ ISSUE_TEMPLATE\n         │  │  ├─ issue.md\n         │  │  └─ bug_report.md\n         │  └─ workflows\n         │     ├─ reviewdog.yml\n         │     ├─ build.yml\n         │     ├─ unit_test.yml\n         │     ├─ release.yml\n         │     └─ contributors.yml\n         └─ internal\n            ├─ cmdinfo\n            │  └─ cmdinfo.go\n            ├─ completion\n            │  └─ completion.go\n            └─ print\n               └─ print.go\n[START] Execute 'go mod init github.com/nao1215/sample'\n[START] Execute 'go mod tidy'\n\nBUILD SUCCESSFUL in 2485[ms]\n\n$ cd sample\n$ make build\n$ ls\nCODE_OF_CONDUCT.md  Changelog.md  Makefile  cmd  go.mod  go.sum  internal  main.go  sample\n```\n\n## Generate library project\n```\n$ mkgoprj library github.com/nao1215/sample\nmkgoprj starts creating the 'sample' library project (import path='github.com/nao1215/sample')\n\n[START] check if mkgoprj can create the project\n[START] create directories\n[START] create files\n        sample (your project root)\n         ├─ sample_test.go\n         ├─ CODE_OF_CONDUCT.md\n         ├─ Makefile\n         ├─ Changelog.md\n         ├─ sample.go\n         └─ .github\n            ├─ dependabot.yml\n            ├─ ISSUE_TEMPLATE\n            │  ├─ issue.md\n            │  └─ bug_report.md\n            └─ workflows\n               ├─ reviewdog.yml\n               ├─ unit_test.yml\n               └─ contributors.yml\n               \n[START] Execute 'go mod init github.com/nao1215/sample'\n\nBUILD SUCCESSFUL in 5[ms]\n\n$ cd sample/\n$ make test\nenv GOOS=linux go test -v -cover ./... -coverprofile=cover.out\n=== RUN   TestHelloWorld\n--- PASS: TestHelloWorld (0.00s)\nPASS\ncoverage: 100.0% of statements\nok      github.com/nao1215/sample       0.002s  coverage: 100.0% of statements\ngo tool cover -html=cover.out -o cover.html\n```\n\n# GitHub Actions\nmkgoprj command generates the GitHub Actions listed in the table below when creating a project.\n\n| Action name |Description|\n|:--|:--|\n|build| Build the project|\n|unit test| Run unit test|\n|reviewdog|Static Analysis |\n| release|Release projects in units of git tags |\n|contributors | Generate Contributors.md|\n\n# Self-documented Makefile\nThe Makefile generated by the mkgoprj command is [self-documenting](https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html). When you run the make command, you will see the target list that exists in the Makefile. A help message is showed next to the target name.\n```\n$ make\nbuild           Build binary \nclean           Clean project\nfmt             Format go source code \ntest            Start test\nvet             Start go vet\n```\nIf you want to add a new target, please comment with **\"##\"** next to the target. The string after \"##\" is extracted and used as a help message. An example is shown below.\n```\nbuild:  ## Build binary \n\tenv GO111MODULE=on GOOS=$(GOOS) $(GO_BUILD) $(GO_LDFLAGS) -o $(APP) cmd/sample/main.go\n\nclean: ## Clean project\n\t-rm -rf $(APP) cover.out cover.html\n```\n\n# Auto-generate shell completion file (for bash, zsh, fish)\nmkgoprj command automatically generates shell completion files for bash, zsh, and fish. After the user executes mkgoprj, if the shell completion file does not exist in the system, the auto-generation process will begin. To activate the completion feature, restart the shell.\n\n```\n$ mkgoprj \nmkgoprj:INFO : append bash-completion file: /home/nao/.bash_completion\nmkgoprj:INFO : create fish-completion file: /home/nao/.config/fish/completions/mkgoprj.fish\nmkgoprj:INFO : create zsh-completion file: /home/nao/.zsh/completion/_mkgoprj\n```\n\n# Contributing\nFirst off, thanks for taking the time to contribute! ❤️  See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.\nContributions are not only related to development. For example, GitHub Star motivates me to develop!\n[![Star History Chart](https://api.star-history.com/svg?repos=nao1215/mkgoprj\u0026type=Date)](https://star-history.com/#nao1215/mkgoprj\u0026Date)\n\n# Contact\nIf you would like to send comments such as \"find a bug\" or \"request for additional features\" to the developer, please use one of the following contacts.\n\n- [GitHub Issue](https://github.com/nao1215/mkgoprj/v2/issues)\n\n# LICENSE\nThe mkgoprj project is licensed under the terms of [the Apache License 2.0](./LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnao1215%2Fmkgoprj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnao1215%2Fmkgoprj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnao1215%2Fmkgoprj/lists"}