{"id":17683022,"url":"https://github.com/shomali11/commander","last_synced_at":"2026-03-07T12:02:23.073Z","repository":{"id":46120059,"uuid":"93901701","full_name":"shomali11/commander","owner":"shomali11","description":"Command evaluator and parser","archived":false,"fork":false,"pushed_at":"2023-07-30T02:38:02.000Z","size":81,"stargazers_count":21,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T22:33:48.449Z","etag":null,"topics":["command","evaluator","parameters","parser"],"latest_commit_sha":null,"homepage":null,"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/shomali11.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":"2017-06-09T22:35:24.000Z","updated_at":"2025-03-09T04:18:43.000Z","dependencies_parsed_at":"2024-06-18T17:06:20.574Z","dependency_job_id":"8d1b1ec7-0d1a-47d4-8c89-551a6a02b865","html_url":"https://github.com/shomali11/commander","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shomali11/commander","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fcommander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fcommander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fcommander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fcommander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shomali11","download_url":"https://codeload.github.com/shomali11/commander/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fcommander/sbom","scorecard":{"id":820539,"data":{"date":"2025-08-11","repo":{"name":"github.com/shomali11/commander","commit":"0b64f620037d52140eeec29506ca52724ab82410"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 2/28 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T15:24:14.011Z","repository_id":46120059,"created_at":"2025-08-23T15:24:14.011Z","updated_at":"2025-08-23T15:24:14.011Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30212485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"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":["command","evaluator","parameters","parser"],"created_at":"2024-10-24T09:44:07.921Z","updated_at":"2026-03-07T12:02:18.060Z","avatar_url":"https://github.com/shomali11.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commander [![Build Status](https://travis-ci.com/shomali11/commander.svg?branch=master)](https://travis-ci.com/shomali11/commander) [![Go Report Card](https://goreportcard.com/badge/github.com/shomali11/commander)](https://goreportcard.com/report/github.com/shomali11/commander) [![GoDoc](https://godoc.org/github.com/shomali11/commander?status.svg)](https://godoc.org/github.com/shomali11/commander) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nCommand evaluator and parser\n\n## Features\n\n* Matches commands against provided text\n* Extracts parameters from matching input\n* Provides default values for missing parameters\n* Supports String, Integer, Float and Boolean parameters\n* Supports \"word\" {} vs \"sentence\" \u003c\u003e parameter matching\n\n## Dependencies\n\n* `proper` [github.com/shomali11/proper](https://github.com/shomali11/proper)\n\n\n# Examples\n\n## Example 1\n\nIn this example, we are matching a few strings against a command format, then parsing parameters if found or returning default values.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/shomali11/commander\"\n)\n\nfunc main() {\n\tproperties, isMatch := commander.NewCommand(\"ping\").Match(\"ping\")\n\tfmt.Println(isMatch)            // true\n\tfmt.Println(properties)         // {}\n\n\tproperties, isMatch = commander.NewCommand(\"ping\").Match(\"pong\")\n\tfmt.Println(isMatch)            // false\n\tfmt.Println(properties)         // nil\n\n\tproperties, isMatch = commander.NewCommand(\"echo {word}\").Match(\"echo hello world!\")\n\tfmt.Println(isMatch)                               // true\n\tfmt.Println(properties.StringParam(\"word\", \"\"))    // hello\n\n\tproperties, isMatch = commander.NewCommand(\"echo \u003csentence\u003e\").Match(\"echo hello world!\")\n\tfmt.Println(isMatch)                                   // true\n\tfmt.Println(properties.StringParam(\"sentence\", \"\"))    // hello world!\n\n\tproperties, isMatch = commander.NewCommand(\"repeat {word} {number}\").Match(\"repeat hey 5\")\n\tfmt.Println(isMatch)                                 // true\n\tfmt.Println(properties.StringParam(\"word\", \"\"))      // hey\n\tfmt.Println(properties.IntegerParam(\"number\", 0))    // 5\n\n\tproperties, isMatch = commander.NewCommand(\"repeat {word} {number}\").Match(\"repeat hey\")\n\tfmt.Println(isMatch)                                 // true\n\tfmt.Println(properties.StringParam(\"word\", \"\"))      // hey\n\tfmt.Println(properties.IntegerParam(\"number\", 0))    // 0\n\n\tproperties, isMatch = commander.NewCommand(\"search \u003cstuff\u003e {size}\").Match(\"search hello there everyone 10\")\n\tfmt.Println(isMatch)                                // true\n\tfmt.Println(properties.StringParam(\"stuff\", \"\"))    // hello there everyone\n\tfmt.Println(properties.IntegerParam(\"size\", 0))     // 10\n}\n```\n\n## Example 2\n\nIn this example, we are tokenizing the command format and returning each token with a number that determines whether it is a parameter (word vs sentence) or not\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/shomali11/commander\"\n)\n\nfunc main() {\n\ttokens := commander.NewCommand(\"echo {word} \u003csentence\u003e\").Tokenize()\n\tfor _, token := range tokens {\n\t\tfmt.Println(token)\n\t}\n}\n```\n\nOutput:\n```\n\u0026{echo NOT_PARAMETER}\n\u0026{word WORD_PARAMETER}\n\u0026{sentence SENTENCE_PARAMETER}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshomali11%2Fcommander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshomali11%2Fcommander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshomali11%2Fcommander/lists"}