{"id":34627936,"url":"https://github.com/jobala/commando","last_synced_at":"2025-12-24T16:13:11.482Z","repository":{"id":58536042,"uuid":"518930218","full_name":"jobala/commando","owner":"jobala","description":"An elegant Go CLI framework","archived":false,"fork":false,"pushed_at":"2022-09-17T12:07:45.000Z","size":23,"stargazers_count":6,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T03:02:38.721Z","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/jobala.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}},"created_at":"2022-07-28T17:05:34.000Z","updated_at":"2024-06-21T03:02:38.722Z","dependencies_parsed_at":"2022-09-14T02:52:52.011Z","dependency_job_id":null,"html_url":"https://github.com/jobala/commando","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jobala/commando","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fcommando","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fcommando/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fcommando/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fcommando/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jobala","download_url":"https://codeload.github.com/jobala/commando/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobala%2Fcommando/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28004519,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-12-24T16:13:10.803Z","updated_at":"2025-12-24T16:13:11.466Z","avatar_url":"https://github.com/jobala.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commando\nAn elegant CLI framework \n\n## Getting Started\n\n### Installation\n\nTo install commando simply do\n\n`go get github.com/jobala/commando`\n\n### Usage\n\nCreate a CLI instance\n\n```go\ncli := commando.NewCli(\"animals\", \"A cli app about the animal kingdom\")\n\n```\n\nCommando exposes a declarative api for grouping commands and adding commands to a command group. The code snippet below adds the following commands;\n\n1. `$animals vertebrates warm mammals bear --loudnes \u003cint\u003e`\n2. `$animals vertebrates warm mammals cow --loudness \u003cint\u003e`\n\n```go \ncli.NewCommandGroup(\"vertebrates warm mammals\").\n    WithCommand(commando.Command(\"bear\", Bear)).\n    WithCommand(commando.Command(\"cow\", Cow)).\n\nfunc Bear(args BearArgs) {\n    // do something with BearArgs and print result\n}\n\ntype BearArgs struct {\n\tLoudness int\n}\n\nfunc Cow(args CowArgs) {\n    // do something CowArgs and print result\n}\n\ntype CowArgs struct {\n\tLoudness int\n}\n```\n\nThe handler function takes a single struct as an argument and the struct fields will be used to create the command's flags. The fields **must** be public.\n\n\nTo add another command group under `vertebrates`, do the following\n\n```go\ncli.NewCommandGroup(\"vertebrates cold\").\n    WithCommand(commando.Command(\"snake\", Snake))\n\n```\nNow you'll have `$animals vertebrates cold ...` on top of the initially defined commands\n\nTo add another command group under animals, simply do the following\n\n```go\ncli.NewCommandGroup(\"invertebrates\").\n    WithCommand(commando.Command(\"leech\", handlerFunc)).\n\n```\n\nThe snippet above will add `$animals invertebrates leech`\n\nYou can use **--help** to show the available commands in a command group.\n`$animals --help` will list available sub command[group]s\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobala%2Fcommando","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjobala%2Fcommando","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobala%2Fcommando/lists"}