{"id":15652263,"url":"https://github.com/linuxsuren/cobra-extension","last_synced_at":"2025-04-30T20:07:55.898Z","repository":{"id":39581215,"uuid":"318356568","full_name":"LinuxSuRen/cobra-extension","owner":"LinuxSuRen","description":"This is the extension of cobra which is a Commander for modern Go CLI interactions","archived":false,"fork":false,"pushed_at":"2023-03-02T19:57:32.000Z","size":122,"stargazers_count":2,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T20:07:43.639Z","etag":null,"topics":["cli","cobra","cobra-extension","hacktoberfest"],"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/LinuxSuRen.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-04T00:24:35.000Z","updated_at":"2022-05-19T02:07:42.000Z","dependencies_parsed_at":"2024-06-19T01:35:22.362Z","dependency_job_id":"fa83ba31-00f7-47ee-bd67-07ccb5248a3f","html_url":"https://github.com/LinuxSuRen/cobra-extension","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":"0.40909090909090906","last_synced_commit":"ecca19c34bfb7b759e9927662bbc1604cf2a94f4"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fcobra-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fcobra-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fcobra-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fcobra-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinuxSuRen","download_url":"https://codeload.github.com/LinuxSuRen/cobra-extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251774896,"owners_count":21641731,"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","cobra-extension","hacktoberfest"],"created_at":"2024-10-03T12:41:53.560Z","updated_at":"2025-04-30T20:07:55.877Z","avatar_url":"https://github.com/LinuxSuRen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://goreportcard.com/badge/linuxsuren/cobra-extension)](https://goreportcard.com/report/linuxsuren/cobra-extension)\n[![](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/linuxsuren/cobra-extension)\n[![Contributors](https://img.shields.io/github/contributors/linuxsuren/cobra-extension.svg)](https://github.com/linuxsuren/cobra-extension/graphs/contributors)\n[![GitHub release](https://img.shields.io/github/release/linuxsuren/cobra-extension.svg?label=release)](https://github.com/linuxsuren/cobra-extension/releases/latest)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/linuxsuren/cobra-extension)\n[![HitCount](http://hits.dwyl.com/linuxsuren/cobra-extension.svg)](http://hits.dwyl.com/linuxsuren/cobra-extension)\n\nThis project aims to provide an easy way to let you writing a plugin for your CLI project. And it based on [cobra](https://github.com/spf13/cobra).\n\n## Get started\n\n`go get github.com/linuxsuren/cobra-extension`\n\n## Friendly to the flags test\n\nYou can add some tests for the flags quickly, for instance:\n\n```go\nfunc TestFlagsValidation_Valid(t *testing.T) {\n\tboolFlag := true\n\temptyFlag := true\n\tcmd := cobra.Command{}\n\tcmd.Flags().BoolVarP(\u0026boolFlag, \"test\", \"t\", false, \"usage test\")\n\tcmd.Flags().BoolVarP(\u0026emptyFlag, \"empty\", \"\", false, \"\")\n\n\tflags := FlagsValidation{{\n\t\tName:      \"test\",\n\t\tShorthand: \"t\",\n\t}, {\n\t\tName:         \"empty\",\n\t\tUsageIsEmpty: true,\n\t}}\n\tflags.Valid(t, cmd.Flags())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxsuren%2Fcobra-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxsuren%2Fcobra-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxsuren%2Fcobra-extension/lists"}