{"id":29118758,"url":"https://github.com/napalu/goopt","last_synced_at":"2026-04-05T11:01:19.459Z","repository":{"id":42870676,"uuid":"436199466","full_name":"napalu/goopt","owner":"napalu","description":"A flexible and powerful command-line parser for go","archived":false,"fork":false,"pushed_at":"2026-01-26T17:15:25.000Z","size":13008,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-27T05:33:02.833Z","etag":null,"topics":["cli","command-line","commands","flags","shell-completion"],"latest_commit_sha":null,"homepage":"https://napalu.github.io/goopt/","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/napalu.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-08T10:04:41.000Z","updated_at":"2026-01-26T17:16:07.000Z","dependencies_parsed_at":"2024-09-17T16:28:12.789Z","dependency_job_id":"21a9cfb0-2bf0-4d9b-ad12-32016fd7c92f","html_url":"https://github.com/napalu/goopt","commit_stats":null,"previous_names":[],"tags_count":110,"template":false,"template_full_name":null,"purl":"pkg:github/napalu/goopt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napalu%2Fgoopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napalu%2Fgoopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napalu%2Fgoopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napalu%2Fgoopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/napalu","download_url":"https://codeload.github.com/napalu/goopt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/napalu%2Fgoopt/sbom","scorecard":{"id":1239564,"data":{"date":"2025-05-29T20:53:06Z","repo":{"name":"github.com/napalu/goopt","commit":"95c5a036a1c410a7edcbda456771506aa2481ec9"},"scorecard":{"version":"v5.1.1","commit":"cd152cb6742c5b8f2f3d2b5193b41d9c50905198"},"score":7.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":9,"reason":"dependency not pinned by hash detected -- score normalized to 9","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/scorecard.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/napalu/goopt/scorecard.yml/main?enable=pin","Info:   6 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   5 out of   5 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/test.yml:50","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18","Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:5","Warn: topLevel 'statuses' permission set to 'write': .github/workflows/test.yml:9"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#maintained"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: all commits (21) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#sast"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: GoBuiltInFuzzer integration found: goopt_fuzz_test.go:14","Info: GoBuiltInFuzzer integration found: goopt_fuzz_test.go:92","Info: GoBuiltInFuzzer integration found: goopt_fuzz_test.go:114","Info: GoBuiltInFuzzer integration found: goopt_fuzz_test.go:137","Info: GoBuiltInFuzzer integration found: v2/goopt_fuzz_test.go:14","Info: GoBuiltInFuzzer integration found: v2/goopt_fuzz_test.go:92","Info: GoBuiltInFuzzer integration found: v2/goopt_fuzz_test.go:114","Info: GoBuiltInFuzzer integration found: v2/goopt_fuzz_test.go:137"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#signed-releases"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: :0"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#dependency-update-tool"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#branch-protection"}},{"name":"Contributors","score":3,"reason":"project has 1 contributing companies or organizations -- score normalized to 3","details":["Info: found contributions from: heyworth technologies gmbh"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#contributors"}},{"name":"CI-Tests","score":10,"reason":"7 out of 7 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/cd152cb6742c5b8f2f3d2b5193b41d9c50905198/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-11-07T16:23:21.176Z","repository_id":42870676,"created_at":"2025-11-07T16:23:21.176Z","updated_at":"2025-11-07T16:23:21.176Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31433044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","command-line","commands","flags","shell-completion"],"created_at":"2025-06-29T13:02:36.967Z","updated_at":"2026-04-05T11:01:19.453Z","avatar_url":"https://github.com/napalu.png","language":"Go","funding_links":[],"categories":["Command Line","命令行","Build Automation"],"sub_categories":["Standard CLI","标准CLI"],"readme":"# goopt: a flexible and powerful command-line parser\n\n[![Coverage](https://codecov.io/gh/napalu/goopt/branch/main/graph/badge.svg)](https://app.codecov.io/gh/napalu/goopt)\n[![Go Reference v1](https://pkg.go.dev/badge/github.com/napalu/goopt.svg)](https://pkg.go.dev/github.com/napalu/goopt)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/napalu/goopt)\n[![Go Report Card](https://goreportcard.com/badge/github.com/napalu/goopt)](https://goreportcard.com/report/github.com/napalu/goopt)\n\n`goopt` is a flexible and powerful command-line option parser for Go. It provides a declarative, struct-first approach to building CLIs that are robust, maintainable, and user-friendly.\n\nThe library is designed to be intuitive for simple tools and scalable for complex applications, with \"batteries-included\" features like an **advanced help system**, a **composable validation engine**, **command lifecycle hooks**, and comprehensive **internationalization (i18n)** support.\n\n**Looking for the latest version?** `goopt v2` is here with major improvements!\n\u003e 👉 [Check out v2 on GitHub](https://github.com/napalu/goopt/tree/main/v2) or [📚 read the full docs](https://napalu.github.io/goopt)\n\n---\n\n## Installation (v2)\n\nVersion 2 is the recommended version for all new projects.\n\n```bash\ngo get github.com/napalu/goopt/v2\n```\n\n## Quick Start (v2)\n\nDefine your entire CLI structure—commands, flags, and descriptions—using a single Go struct.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n    \"github.com/napalu/goopt/v2\"\n)\n\ntype Config struct {\n    // Global flags\n    Verbose bool `goopt:\"short:v;desc:Enable verbose output\"`\n\n    // 'create' command with a subcommand\n    Create struct {\n        Force bool `goopt:\"short:f;desc:Force creation\"`\n        User struct {\n            Username string `goopt:\"short:u;desc:Username;required:true\"`\n            Password string `goopt:\"short:p;desc:Password;secure:true\"`\n        } `goopt:\"kind:command;name:user;desc:Create user\"`\n    } `goopt:\"kind:command;name:create;desc:Create resources\"`\n}\n\nfunc main() {\n    cfg := \u0026Config{}\n    // Note: In v2, the parser type is simply `Parser`\n    parser, err := goopt.NewParserFromStruct(cfg)\n    if err != nil {\n        fmt.Fprintf(os.Stderr, \"Error creating parser: %v\\n\", err)\n        os.Exit(1)\n    }\n\n    // Parse returns false on failure or if --help was requested\n    if !parser.Parse(os.Args) {\n        // goopt handles printing errors and help text by default\n        os.Exit(1)\n    }\n\n    // Your application logic here...\n    if parser.HasCommand(\"create\", \"user\") {\n        fmt.Printf(\"Creating user: %s\\n\", cfg.Create.User.Username)\n    }\n}\n```\n\nFor more examples and advanced guides, please visit the [**v2 Documentation Site**](https://napalu.github.io/goopt/).\n\n---\n\n## Legacy Version (v1.x)\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand information for goopt v1.x\u003c/summary\u003e\n\nThis version is in maintenance mode. For new projects, please use **[goopt v2](https://github.com/napalu/goopt/tree/main/v2)**.\n\n- **Installation (v1):** `go get github.com/napalu/goopt@v1`\n- **[Documentation (v1)](https://napalu.github.io/goopt/)**\n- **[Migration Guide to v2](https://napalu.github.io/goopt/v2/migration/)**\n\n### Quick Start (v1)\n\n```go\npackage main\n\nimport (\n    \"os\"\n    \"fmt\"\n    \"github.comcom/napalu/goopt\"\n)\n\n// ...Config struct is identical to v2 example...\n\nfunc main() {\n    cfg := \u0026Config{}\n    parser, _:= goopt.NewCmdLineFromStruct(cfg)\n    if !parser.Parse(os.Args) {\n        parser.PrintUsage(os.Stdout)\n        return\n    }\n}\n```\n\n\u003c/details\u003e\n\n---\n\n## License\n\n`goopt` is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Contributions should be based on open issues (feel free to open one).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnapalu%2Fgoopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnapalu%2Fgoopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnapalu%2Fgoopt/lists"}