{"id":26290009,"url":"https://github.com/unsafe-risk/broccoli","last_synced_at":"2025-05-07T22:44:23.115Z","repository":{"id":56871287,"uuid":"526562091","full_name":"unsafe-risk/broccoli","owner":"unsafe-risk","description":"Broccoli: CLI Package for Go","archived":false,"fork":false,"pushed_at":"2023-02-27T06:32:21.000Z","size":77,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T22:44:09.525Z","etag":null,"topics":["cli","command-line","golang","zero-dependencies"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/gopkg.eu.org/broccoli","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unsafe-risk.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":"2022-08-19T10:27:06.000Z","updated_at":"2025-03-31T03:42:15.000Z","dependencies_parsed_at":"2024-06-20T11:13:00.742Z","dependency_job_id":"b1b56622-836f-4342-8a9f-4b87f683847f","html_url":"https://github.com/unsafe-risk/broccoli","commit_stats":{"total_commits":35,"total_committers":1,"mean_commits":35.0,"dds":0.0,"last_synced_commit":"b54e11a5d846c913672ab9f7735fe6a292aa2e4a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsafe-risk%2Fbroccoli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsafe-risk%2Fbroccoli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsafe-risk%2Fbroccoli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unsafe-risk%2Fbroccoli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unsafe-risk","download_url":"https://codeload.github.com/unsafe-risk/broccoli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252967974,"owners_count":21833245,"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","command-line","golang","zero-dependencies"],"created_at":"2025-03-14T23:17:41.095Z","updated_at":"2025-05-07T22:44:23.095Z","avatar_url":"https://github.com/unsafe-risk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub](https://img.shields.io/github/license/unsafe-risk/broccoli?style=for-the-badge)](https://github.com/unsafe-risk/broccoli/blob/main/LICENSE)\n[![GitHub Workflow Status (event)](https://img.shields.io/github/actions/workflow/status/unsafe-risk/broccoli/go-test.yml?event=push\u0026style=for-the-badge)](https://github.com/unsafe-risk/broccoli/actions/workflows/go-test.yml)\n[![Go Reference](https://img.shields.io/badge/go-reference-%23007d9c?style=for-the-badge\u0026logo=go)](https://pkg.go.dev/gopkg.eu.org/broccoli)\n\n# broccoli\n\nBroccoli: [CLI](https://en.wikipedia.org/wiki/Command-line_interface) Package for Go\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"gopkg.eu.org/broccoli\"\n)\n\ntype Config struct {\n\t_    struct{} `version:\"0.0.1\" command:\"hello\" about:\"Test App\"`\n\tName string   `flag:\"name\" alias:\"n\" required:\"true\" about:\"Your name\"`\n\n\tSub *SubCommand `subcommand:\"sub\"`\n}\n\ntype SubCommand struct {\n\t_    struct{} `command:\"sub\" longabout:\"Test Sub Command\"`\n\tName string   `flag:\"name\" alias:\"n\" required:\"true\" about:\"Your name\"`\n}\n\nfunc main() {\n\tvar cfg Config\n\t_ = broccoli.BindOSArgs(\u0026cfg)\n\n\tif cfg.Sub != nil {\n\t\tfmt.Printf(\"Hello %s from sub command\\n\", cfg.Sub.Name)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Hello %s from main command\\n\", cfg.Name)\n}\n```\n\n```\n$ hello --help\nhello 0.0.1\nTest App\n\nUsage:\n        hello \u003cCOMMAND\u003e [OPTIONS] --name \u003cNAME\u003e [ARGUEMENTS]\n\nOptions:\n        -n, --name     Your name  (required)\n        -h, --help     Print this help message and exit\n\nCommands:\n        sub    Test Sub Command\n\n$ hello --name World\nHello World from main command\n\n$ hello sub --name World\nHello World from sub command\n```\n\n## Installation\n\n```bash\ngo get -u gopkg.eu.org/broccoli\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funsafe-risk%2Fbroccoli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funsafe-risk%2Fbroccoli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funsafe-risk%2Fbroccoli/lists"}