{"id":21261513,"url":"https://github.com/chenasraf/massarg","last_synced_at":"2026-01-26T11:16:04.946Z","repository":{"id":42631315,"uuid":"386102540","full_name":"chenasraf/massarg","owner":"chenasraf","description":"Command and argument parser on steroids - JS/TS","archived":false,"fork":false,"pushed_at":"2024-05-03T21:58:18.000Z","size":2347,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-10-19T10:29:51.109Z","etag":null,"topics":["args","cli","command-line","javascript","parser","shell","typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/massarg","language":"TypeScript","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/chenasraf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"chenasraf","patreon":null,"open_collective":null,"ko_fi":"casraf","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-07-14T23:29:22.000Z","updated_at":"2024-05-03T21:57:25.000Z","dependencies_parsed_at":"2024-06-21T07:10:34.828Z","dependency_job_id":"ee5b0f41-86f3-4fb1-8def-3eec3604802f","html_url":"https://github.com/chenasraf/massarg","commit_stats":{"total_commits":87,"total_committers":3,"mean_commits":29.0,"dds":"0.14942528735632188","last_synced_commit":"a00c86115f7794120e8400bc9bc2f8321929f326"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/chenasraf/massarg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fmassarg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fmassarg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fmassarg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fmassarg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenasraf","download_url":"https://codeload.github.com/chenasraf/massarg/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fmassarg/sbom","scorecard":{"id":275974,"data":{"date":"2025-08-11","repo":{"name":"github.com/chenasraf/massarg","commit":"267de909e7e095f6bd0878be72b4339fdffb6961"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"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":"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":"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/docs.yml:1","Warn: no topLevel permission defined: .github/workflows/pull_requests.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/release.yml:6","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/chenasraf/massarg/docs.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/chenasraf/massarg/docs.yml/develop?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docs.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/chenasraf/massarg/docs.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_requests.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/chenasraf/massarg/pull_requests.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_requests.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/chenasraf/massarg/pull_requests.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/chenasraf/massarg/release.yml/develop?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/chenasraf/massarg/release.yml/develop?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/docs.yml:23","Warn: npmCommand not pinned by hash: .github/workflows/pull_requests.yml:16","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:28","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   3 npmCommand 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"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":"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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.0.1 not signed: https://api.github.com/repos/chenasraf/massarg/releases/154161690","Warn: release artifact v2.0.0 not signed: https://api.github.com/repos/chenasraf/massarg/releases/139269772","Warn: release artifact v2.0.0-pre.13 not signed: https://api.github.com/repos/chenasraf/massarg/releases/139036584","Warn: release artifact v2.0.0-pre.12 not signed: https://api.github.com/repos/chenasraf/massarg/releases/139025323","Warn: release artifact v2.0.0-pre.11 not signed: https://api.github.com/repos/chenasraf/massarg/releases/138835495","Warn: release artifact v2.0.1 does not have provenance: https://api.github.com/repos/chenasraf/massarg/releases/154161690","Warn: release artifact v2.0.0 does not have provenance: https://api.github.com/repos/chenasraf/massarg/releases/139269772","Warn: release artifact v2.0.0-pre.13 does not have provenance: https://api.github.com/repos/chenasraf/massarg/releases/139036584","Warn: release artifact v2.0.0-pre.12 does not have provenance: https://api.github.com/repos/chenasraf/massarg/releases/139025323","Warn: release artifact v2.0.0-pre.11 does not have provenance: https://api.github.com/repos/chenasraf/massarg/releases/138835495"],"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 'develop'","Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'pre'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 27 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"}},{"name":"Vulnerabilities","score":0,"reason":"28 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-f7f6-9jq7-3rqj","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-m5qc-5hw7-8vg7","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-x7hr-w5r2-h6wg","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-x4c5-c7rf-jjgv","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T14:24:07.732Z","repository_id":42631315,"created_at":"2025-08-17T14:24:07.733Z","updated_at":"2025-08-17T14:24:07.733Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28776953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T09:42:00.929Z","status":"ssl_error","status_checked_at":"2026-01-26T09:42:00.591Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["args","cli","command-line","javascript","parser","shell","typescript"],"created_at":"2024-11-21T04:43:37.897Z","updated_at":"2026-01-26T11:16:04.933Z","avatar_url":"https://github.com/chenasraf.png","language":"TypeScript","readme":"# massarg\n\n\u003ch2 align=\"center\"\u003e\n\n[GitHub](https://github.com/chenasraf/massarg) |\n[Documentation](https://chenasraf.github.io/massarg) | [NPM](https://npmjs.com/package/massarg) |\n[casraf.dev](https://casraf.dev)\n\n![master](https://img.shields.io/github/package-json/v/chenasraf/massarg/master?label=master)\n![build](https://img.shields.io/github/actions/workflow/status/chenasraf/massarg/release.yml?branch=master)\n\n\u003c/h2\u003e\n\nMassarg is a modern, flexible, powerful, and simple-to-use command/argument parser for JS\napplications, allowing you to create complex but easy applications that consume command-line\narguments and commands.\n\nIt allows you to both parse argument options and flags, as well as hierarchal subcommands, both of\nwhich can be parsed into an **automatic help command or flag** that displays all the information\neasily, with customizable styles, and content.\n\nYou should only focus on actually writing the functionality of your CLI, and not waste it on writing\na way to parse the chain of commands, flags or options.\n\nAnd it should look good too, right?\n\n![Previw of shell help output](https://github.com/chenasraf/massarg/assets/167217/37dc8d4f-8e14-4040-9986-1d3113314731)\n\n## Features\n\n- Primary command to be run without args\n- Commands to be run from arg\n- Options with flexible parsing\n- Required options\n- Options with multiple values\n- Nameless options\n- Automatically generated help text:\n  - Customizable colors\n  - Customizable header and footer text\n  - Customizable usage examples\n  - Automatic text alignment\n  - Add run examples for your args\n  - Shows default value and type next to description\n- TypeScript-first package: You will always have strong types\n\n## Usage\n\n## Quick Start\n\n### Install\n\n```shell\n# pnpm\npnpm install massarg\n# npm\nnpm install massarg\n# yarn\nyarn add massarg\n```\n\n### Import\n\n```ts\nimport massarg from 'massarg'\n```\n\n### Usage\n\nCall the default export function `massarg`, or create a new instance manually using `new Massarg()`,\nand then you can start chaining commands. Use `.parse()` to do the final parsing and run the\ncommands and options.\n\nEach function and option is documented. See\n[the full documentation](https://chenasraf.github.io/massarg) for details.\n\nJSDoc comments are also provided.\n\nHere is an example with some commonly used examples to get you started.\n\n```ts\nconst parser = massarg({\n  name: 'my-cli',\n  description: \"Does really amazing stuff, you wouldn't believe!\",\n}) // or: new Massarg()\n  // The main command - runs when no commands are specified. If not provided, an error is thrown for\n  // required arguments.\n  .main((options) =\u003e console.log('main command', options))\n  // A subcommand example\n  .command({\n    name: 'foo',\n    description: 'a foo command',\n    aliases: ['f'],\n    // default prefixes:\n    optionPrefix: '--',\n    aliasPrefix: '-',\n    // The function to run for this command\n    run: (options) =\u003e console.log('foo command', options),\n  })\n  // A subcommand example, which contains its own set of options or sub commands. This is infinitely\n  // nestible.\n  .command(\n    massarg({\n      name: 'bar',\n      description: 'a bar command',\n      aliases: ['s'],\n      run: (options) =\u003e console.log('bar command', options),\n    }).option({\n      name: 'file',\n      description: 'Filename to use',\n      aliases: ['f'],\n      parse: (filename) =\u003e path.resolve(process.cwd(), filename),\n    }),\n  )\n  // A CLI option - argument with a value\n  .option({\n    name: 'my-string',\n    description: 'A string argument',\n    aliases: ['s'],\n  })\n  // A CLI flg - boolean argument with no value\n  .flag({\n    name: 'flag',\n    description: 'a flag that will be related to any command (main or sub)',\n    aliases: ['f'],\n    negatble: true,\n    negateName: 'no-flag', // Override the default negation name\n    negateAliases: ['F'], // Override the default negation aliases\n  })\n  // Usage examples for your CLI. Use this to describe various common usages or quirks.\n  .example({\n    description: 'Run the sub command',\n    input: 'my-bin --flag sub',\n    output: 'Sub command: flag is true',\n  })\n  // Configuration of the automated help section\n  .help({\n    bindCommand: true,\n    footerText: `Copyright © ${new Date().getFullYear()} Me, Myself and I`,\n    titleStyle: {\n      bold: true,\n      color: 'brightWhite',\n    },\n  })\n```\n\n## Documentation\n\nThe full documentation can be found here:\n[Massarg Documentation](https://chenasraf.github.io/massarg)\n\n- [Massarg](https://chenasraf.github.io/massarg/docs/api/classes/massarg.Massarg)\n- [MassargOption](https://chenasraf.github.io/massarg/docs/api/classes/option.MassargOption)\n- [MassargFlag](https://chenasraf.github.io/massarg/docs/api/classes/option.MassargFlag)\n- [MassargExample](https://chenasraf.github.io/massarg/docs/api/classes/example.MassargExample)\n\n## Contributing\n\nI am developing this package on my free time, so any support, whether code, issues, or just stars is\nvery helpful to sustaining its life. If you are feeling incredibly generous and would like to donate\njust a small amount to help sustain this project, I would be very very thankful!\n\n\u003ca href=\"https://ko-fi.com/casraf\" target=\"_blank\"\u003e\n  \u003cimg height=\"36\"\n    src=\"https://cdn.ko-fi.com/cdn/kofi1.png?v=3\"\n    alt=\"Buy Me a Coffee at ko-fi.com\" /\u003e\n\u003c/a\u003e\n\nI welcome any issues or pull requests on GitHub. If you find a bug, or would like a new feature,\ndon't hesitate to open an appropriate issue and I will do my best to reply promptly.\n","funding_links":["https://github.com/sponsors/chenasraf","https://ko-fi.com/casraf"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fmassarg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenasraf%2Fmassarg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fmassarg/lists"}