{"id":18412050,"url":"https://github.com/elliotxx/go-cli-prototype","last_synced_at":"2025-04-12T23:45:15.418Z","repository":{"id":46247403,"uuid":"423327658","full_name":"elliotxx/go-cli-prototype","owner":"elliotxx","description":"This is a cli application with go and cobra.","archived":false,"fork":false,"pushed_at":"2022-08-04T08:25:12.000Z","size":73,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T23:44:44.157Z","etag":null,"topics":["cli","cobra","example","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/elliotxx.png","metadata":{"files":{"readme":"README-zh.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":"2021-11-01T03:39:21.000Z","updated_at":"2022-08-04T08:20:18.000Z","dependencies_parsed_at":"2022-09-07T17:35:52.225Z","dependency_job_id":null,"html_url":"https://github.com/elliotxx/go-cli-prototype","commit_stats":null,"previous_names":[],"tags_count":10,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2Fgo-cli-prototype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2Fgo-cli-prototype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2Fgo-cli-prototype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotxx%2Fgo-cli-prototype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotxx","download_url":"https://codeload.github.com/elliotxx/go-cli-prototype/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647259,"owners_count":21139081,"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","cobra","example","go","golang"],"created_at":"2024-11-06T03:39:30.972Z","updated_at":"2025-04-12T23:45:15.396Z","avatar_url":"https://github.com/elliotxx.png","language":"Shell","readme":"## 简介\n\n[![GitHub release](https://img.shields.io/github/release/elliotxx/go-cli-prototype.svg)](https://github.com/elliotxx/go-cli-prototype/releases)\n[![Github All Releases](https://img.shields.io/github/downloads/elliotxx/go-cli-prototype/total.svg)](https://github.com/elliotxx/go-cli-prototype/releases)\n[![license](https://img.shields.io/github/license/elliotxx/go-cli-prototype.svg)](https://github.com/elliotxx/go-cli-prototype/blob/master/LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/elliotxx/go-cli-prototype.svg)](https://pkg.go.dev/github.com/elliotxx/go-cli-prototype)\n[![Coverage Status](https://coveralls.io/repos/github/elliotxx/go-cli-prototype/badge.svg)](https://coveralls.io/github/elliotxx/go-cli-prototype)\n\n\u003e 这是一个用 Go 和 cobra 编写的 CLI 应用\n\n## 📜 语言\n\n[English](https://github.com/elliotxx/go-cli-prototype/blob/master/README.md) | [简体中文](https://github.com/elliotxx/go-cli-prototype/blob/master/README-zh.md)\n\n## 🛠️ 安装\n\n### Homebrew\n\n`elliotxx/tap` 有 MacOS 和 GNU/Linux 的预编译二进制版本可用:\n\n```\nbrew install elliotxx/tap/go-cli-prototype\n```\n\n### 脚本安装\n\n在 Linux 和 MacOS 环境中，`go-cli-prototype` 可以通过脚本一键安装：\n\n```bash\ncurl -sSf https://raw.githubusercontent.com/elliotxx/go-cli-prototype/master/scripts/install.sh | bash\n```\n\nOr:\n\n```bash\nwget -qO- https://raw.githubusercontent.com/elliotxx/go-cli-prototype/master/scripts/install.sh | bash\n```\n\nWindows 或者其它感兴趣的用户可以直接在 Github Release 页面中下载二进制文件。\n\n### 从源码构建\n\n使用 Go 1.17+ 版本，你可以通过 `go install` 直接从源码安装 `go-cli-prototype`:\n\n```\ngo install github.com/elliotxx/go-cli-prototype/cmd/go-cli-prototype@latest\n```\n\n*注意*: 你将基于代码仓库最新的可用版本安装 `go-cli-prototype`，尽管主分支的最新提交应该始终是一个稳定和可用的版本，但这不是安装和使用 `go-cli-prototype` 的推荐方式。通过 `go install` 安装的 `go-cli-prototype` 版本输出将显示默认版本号（default-version）。\n\n## ⚡ 使用\n\n本地启动：\n\n```\n$ go run cmd/go-cli-prototype/main.go -e hello\nhello\n$ go run cmd/go-cli-prototype/main.go -V\nv0.1.3-9312a46c\n```\n\n本地构建：\n\n```\n$ make build-all\n$ ./build/darwin/go-cli-prototype -e hello\nhello\n$ ./build/darwin/go-cli-prototype -V      \nv0.1.3-9312a46c\n```\n\n运行所有单元测试：\n\n```\nmake test\n```\n\n全部可用的 Target:\n\n```\n$ make help\nhelp                           This help message :)\ntest                           Run the tests\ncover                          Generates coverage report\ncover-html                     Generates coverage report and displays it in the browser\nformat                         Format source code\nlint                           Lint, will not fix but sets exit code on error\nlint-fix                       Lint, will try to fix errors and modify code\ndoc                            Start the documentation server with godoc\ngen-version                    Update version\nclean                          Clean build bundles\nbuild-all                      Build all platforms\nbuild-darwin                   Build for MacOS\nbuild-linux                    Build for Linux\nbuild-windows                  Build for Windows\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotxx%2Fgo-cli-prototype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotxx%2Fgo-cli-prototype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotxx%2Fgo-cli-prototype/lists"}