{"id":27867593,"url":"https://github.com/eteran/cligo","last_synced_at":"2025-10-30T02:20:35.800Z","repository":{"id":277897482,"uuid":"701802861","full_name":"eteran/cligo","owner":"eteran","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-19T16:51:17.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T08:44:07.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eteran.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":"2023-10-07T15:49:10.000Z","updated_at":"2025-02-19T16:51:20.000Z","dependencies_parsed_at":"2025-02-16T21:37:32.515Z","dependency_job_id":null,"html_url":"https://github.com/eteran/cligo","commit_stats":null,"previous_names":["eteran/cligo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eteran%2Fcligo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eteran%2Fcligo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eteran%2Fcligo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eteran%2Fcligo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eteran","download_url":"https://codeload.github.com/eteran/cligo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252411804,"owners_count":21743604,"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":[],"created_at":"2025-05-04T22:50:20.426Z","updated_at":"2025-10-30T02:20:30.755Z","avatar_url":"https://github.com/eteran.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cligo\n\ncligo is an opinionated argument parser library that is designed to be clean, intuitive, but powerful. It library was inspired the very robust CLI11 library, and incorporates many of its user friendly features. Go does have argument parsing in the standard library, but I've never liked how it deviates from the expected unix style. Cobra is great, but I personally find it to be a bit more heavy weight than I'd like. So cligo was born.\n\ncligo implements classic GNU style parameters with both long and short forms of arguments. It supports validation of arguments, the ability to group them, and as well as the ability to group have arguments require that others do or do not exist. Because validators are just functions, they can be of course be expanded on by consumers of the library. The following is a classic example of an application which requires a filename, and has an optional verbosity flag.\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/eteran/cligo\"\n)\n\nfunc main() {\n\n\tvar filename string\n\tvar verbose bool\n\n\tapp := cligo.NewApp()\n\tapp.AddOption(\"-f,--file\", \u0026filename, \"filename\", cligo.Required(), cligo.AddValidator(cligo.ExistingFile()))\n\tapp.AddFlag(\"-v,--verbose\", \u0026verbose, \"increase verbosity\")\n\n\tif err := app.ParseStrict(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(0)\n\n\t}\n}\n\n```\n\nIf we want, we can make the filename positional instead.\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/eteran/cligo\"\n)\n\nfunc main() {\n\n\tvar filename string\n\tvar verbose bool\n\n\tapp := cligo.NewApp()\n\tapp.AddOption(\"filename\", \u0026filename, \"filename\", cligo.Required(), cligo.AddValidator(cligo.ExistingFile()))\n\tapp.AddFlag(\"-v,--verbose\", \u0026verbose, \"increase verbosity\")\n\n\tif err := app.ParseStrict(); err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(0)\n\t}\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feteran%2Fcligo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feteran%2Fcligo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feteran%2Fcligo/lists"}