{"id":20533558,"url":"https://github.com/joeychilson/simplecli","last_synced_at":"2025-03-06T03:13:44.442Z","repository":{"id":151693746,"uuid":"614817910","full_name":"joeychilson/simplecli","owner":"joeychilson","description":"A simple CLI library for Go.","archived":false,"fork":false,"pushed_at":"2023-03-16T11:53:57.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T13:19:38.950Z","etag":null,"topics":["cli","command-line","go","golang"],"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/joeychilson.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-03-16T11:38:12.000Z","updated_at":"2023-03-16T12:01:54.000Z","dependencies_parsed_at":"2023-06-04T04:45:29.973Z","dependency_job_id":null,"html_url":"https://github.com/joeychilson/simplecli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fsimplecli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fsimplecli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fsimplecli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Fsimplecli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeychilson","download_url":"https://codeload.github.com/joeychilson/simplecli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242138885,"owners_count":20078006,"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","go","golang"],"created_at":"2024-11-16T00:22:13.927Z","updated_at":"2025-03-06T03:13:44.424Z","avatar_url":"https://github.com/joeychilson.png","language":"Go","readme":"# simplecli\n\nA simple CLI library for Go.\n\n## Installation\n\n```bash\ngo get github.com/joeychilson/simplecli\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/joeychilson/simplecli\"\n)\n\nfunc main() {\n\tvar name string\n\n\tfs := flag.NewFlagSet(\"hellocmd\", flag.ExitOnError)\n\tfs.StringVar(\u0026name, \"name\", \"world\", \"name to say hello to\")\n\n\thelloCmd := \u0026simplecli.Command{\n\t\tName:    \"hello\",\n\t\tAliases: []string{\"hi\", \"hey\"},\n\t\tUsage:   \"say hello to someone\",\n\t\tFlagSet: fs,\n\t\tExec: func(ctx context.Context, args []string) error {\n\t\t\tfmt.Printf(\"Hello %s!\\n\", name)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\trootCmd := \u0026simplecli.Command{\n\t\tName:        \"mycli\",\n\t\tAliases:     []string{\"my\"},\n\t\tSubCommands: []*simplecli.Command{helloCmd},\n\t}\n\n\tif err := rootCmd.ParseAndExec(context.Background(), os.Args[1:]); err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Error: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeychilson%2Fsimplecli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeychilson%2Fsimplecli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeychilson%2Fsimplecli/lists"}