{"id":31006151,"url":"https://github.com/akito0107/catacli","last_synced_at":"2025-09-13T02:08:03.470Z","repository":{"id":34932049,"uuid":"190302600","full_name":"akito0107/catacli","owner":"akito0107","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-27T16:10:29.000Z","size":2743,"stargazers_count":43,"open_issues_count":15,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-28T01:27:56.099Z","etag":null,"topics":["cli","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akito0107.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}},"created_at":"2019-06-05T01:07:10.000Z","updated_at":"2024-11-06T06:09:33.000Z","dependencies_parsed_at":"2023-10-11T05:02:36.200Z","dependency_job_id":"adacd3d6-4b6a-44c6-a47f-05a2140d3841","html_url":"https://github.com/akito0107/catacli","commit_stats":{"total_commits":597,"total_committers":6,"mean_commits":99.5,"dds":"0.30820770519262985","last_synced_commit":"9b461a73da6f1e2d4c77207beac363991bf49ef6"},"previous_names":["akito0107/marron-glace"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/akito0107/catacli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akito0107%2Fcatacli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akito0107%2Fcatacli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akito0107%2Fcatacli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akito0107%2Fcatacli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akito0107","download_url":"https://codeload.github.com/akito0107/catacli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akito0107%2Fcatacli/sbom","scorecard":{"id":176217,"data":{"date":"2025-08-11","repo":{"name":"github.com/akito0107/catacli","commit":"f0af62bb1148d1a3f11e0a0024d21ef4ed476fb6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"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/pr.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/akito0107/catacli/pr.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/akito0107/catacli/pr.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pr.yml:1","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":"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: Apache License 2.0: 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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 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":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-16T17:44:12.147Z","repository_id":34932049,"created_at":"2025-08-16T17:44:12.147Z","updated_at":"2025-08-16T17:44:12.147Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274907841,"owners_count":25371822,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","typescript"],"created_at":"2025-09-13T02:05:41.983Z","updated_at":"2025-09-13T02:08:03.450Z","avatar_url":"https://github.com/akito0107.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# catacli\n\nSuper TypeScript-friendly commander helper.\n\n[![Build Status](https://dev.azure.com/akito01070362/catacli/_apis/build/status/akito0107.catacli?branchName=master)](https://dev.azure.com/akito01070362/catacli/_build/latest?definitionId=4\u0026branchName=master)\n[![npm version](https://badge.fury.io/js/catacli.svg)](https://badge.fury.io/js/catacli) [![Greenkeeper badge](https://badges.greenkeeper.io/akito0107/catacli.svg)](https://greenkeeper.io/)\n\n## install\n\n```$xslt\n$ npm install catacli\n```\n\n## usage\n\n### Simple Command\n\nUsing `reduceFlag`, `makePositionalArguments` and `makeCommand`, you can implements handler functions with typed args.\n\n```ts\nimport {\n  makeBooleanFlag,\n  makeNumberFlag,\n  makeStringFlag,\n  makeCommand,\n  reduceFlag,\n  makeStringArgument,\n  makePositionalArguments\n} from \"catacli\";\n\nconst booleanFlag = makeBooleanFlag(\"opts1\", {\n  usage: \"boolean example\"\n});\nconst numberFlag = makeNumberFlag(\"opts2\", {\n  default: 1, // you can pass default value,\n  usage: \"number example\"\n});\nconst stringFlag = makeStringFlag(\"opts3\", {\n  alias: \"a\", // you can specify alias (short-hand flag)\n  usage: \"string example\"\n});\n\nconst stringArg = makeStringArgument(\"arg1\");\n\nconst flags = reduceFlag(booleanFlag, numberFlag, stringFlag);\nconst args = makePositionalArguments(stringArg);\n\nconst command = makeCommand({\n  name: \"example\",\n  description: \"catacli is typescript-friendly commander tool\",\n  version: \"0.0.1\",\n  usage: \"simple [OPTIONS] arg1\",\n  flag: flags,\n  positionalArguments: args,\n  handler: (args, opts) =\u003e {\n    /* YOUR COMMAND LOGIC IS HERE */\n    console.log(\"positionalArgs: \", args.arg1.value); // ok and inferred as string type\n    console.log(\"flag opts1: \", opts.opts1.value); // ok and inferred as boolean type\n    console.log(\"flag opts2: \", opts.opts2.value); // ok and inferred as number type\n    console.log(\"flag opts3: \", opts.opts3.value); // ok and inferred as string type\n    // opts.arg4; // ng compile error\n  }\n});\n\ncommand(process.argv.splice(2));\n```\n\nrunning with [ts-node](https://github.com/TypeStrong/ts-node)\n\n```$xslt\n$ ts-node main.ts --opts1 --opts2 123 --opts3 test args\n```\n\nand got these outputs.\n\n```$xslt\npositionalArgs:  args\nflag opts1:  true\nflag opts2:  123\nflag opts3:  test\n```\n\n#### Short-hand flag\n\n`--opts3` is also acceptable with `-a` flag.\n\n```$xslt\n% ts-node main.ts --opts1 --opts2 123 -a test args\npositionalArgs:  args\nflag opts1:  true\nflag opts2:  123\nflag opts3:  test\n```\n\n#### with Help\n\nYou can show rich help texts with `--help` flag by default.\n\n```$xslt\n$ ts-node main.ts --opts1 -a test --opts3 123 args --help\nNAME:\n   example - catacli is typescript-friendly commander tool\n\nUSAGE:\n   simple [OPTIONS] arg1\n\nVERSION:\n  0.0.1\n\nARGUMENTS:\n\t arg1\n\nOPTIONS:\n\t--help  \t show help\n\t--opts1  \t boolean example\n\t--opts2  \t number example\tdefault=1\n\t--opts3, -a  \t string example\n```\n\n### SubCommands\n\nYou can create subcommnds with `makeSubCommandHandler`.\n\n```ts\nimport {\n  makeBooleanFlag,\n  makeNumberFlag,\n  makeStringFlag,\n  makeCommand,\n  reduceFlag,\n  makeStringArgument,\n  makePositionalArguments,\n  makeSubCommandHandler,\n  makeSubCommandNameArgument\n} from \"catacli\";\n\nconst booleanFlag = makeBooleanFlag(\"opts1\", {\n  usage: \"boolean example\"\n});\nconst numberFlag = makeNumberFlag(\"opts2\", {\n  default: 1, // you can pass default value,\n  usage: \"number example\"\n});\nconst stringFlag = makeStringFlag(\"opts3\", {\n  alias: \"a\", // you can specify alias value\n  usage: \"string example\"\n});\n\nconst flags = reduceFlag(booleanFlag, numberFlag, stringFlag);\nconst sub1Flag = reduceFlag(flags, makeStringFlag(\"subflag1\"));\n\nconst stringArg = makeStringArgument(\"arg1\");\nconst args = makePositionalArguments(stringArg);\n\nconst subCommand1 = makeCommand({\n  name: \"sub1\",\n  description: \"catacli subcommand example (sub1)\",\n  version: \"0.0.1\",\n  usage: \"example [OPTIONS] sub1 [SUB COMMAND OPTIONS]\",\n  flag: sub1Flag,\n  positionalArguments: args,\n  handler: (args, flags) =\u003e {\n    console.log(\"arg1: \", args.arg1.value);\n    console.log(\"opts1: \", flags.opts1.value);\n    console.log(\"opts2: \", flags.opts2.value);\n    console.log(\"opts3: \", flags.opts3.value);\n    console.log(\"subflag1: \", flags.subflag1.value); // inffered as a string type\n  }\n});\n\nconst sub2Flag = reduceFlag(flags, makeStringFlag(\"subflag2\"));\n\nconst subCommand2 = makeCommand({\n  name: \"sub2\",\n  description: \"catacli subcommand example (sub2)\",\n  version: \"0.0.1\",\n  usage: \"example [OPTIONS] sub2 [SUB COMMAND OPTIONS]\",\n  flag: sub2Flag,\n  handler: (_, flags) =\u003e {\n    console.log(\"subflag2: \", flags.subflag2.value);\n  }\n});\n\nconst commandNames = makePositionalArguments(\n  makeSubCommandNameArgument(\"sub1\", \"sub2\")\n);\n\nconst command = makeCommand({\n  name: \"example\",\n  description: \"catacli is typescript-friendly commander tool\",\n  version: \"0.0.1\",\n  usage: \"simple [OPTIONS] [COMMAND_NAME] [SUB COMMAND OPTIONS]\",\n  flag: flags,\n  /* YOU MUST SPECIFY positionalArguments with `makeSubCommandNameArgument` */\n  positionalArguments: commandNames /* YOU MUST SPECIFY positionalArguments with `makeSubCommandNameArgument` */,\n  /* passing sub commands with commandName to `makeSubCommandHandler()` */\n  handler: makeSubCommandHandler(\n    { name: \"sub1\", command: subCommand1 },\n    { name: \"sub2\", command: subCommand2 }\n  )\n});\n\ncommand(process.argv.splice(2));\n```\n\nrunning with [ts-node](https://github.com/TypeStrong/ts-node)\n\n```\n$ ts-node main.ts  --opts1 --opts2 123 --opts3 test  sub1  --subflag1 test sub-positional-args\narg1:  sub-positional-args\nopts1:  true\nopts2:  123\nopts3:  test\nsubflag1:  test\n```\n\nand also shows rich help texts with `--help`.\n\n```$xslt\n% ts-node main.ts  --opts1 --opts2 123 --opts3 test  sub1  --subflag1 test sub-positional-args --help\n\nNAME:\n   example sub1 - catacli subcommand example (sub1)\n\nUSAGE:\n   example [OPTIONS] sub1 [SUB COMMAND OPTIONS]\n\nVERSION:\n  0.0.1\n\nARGUMENTS:\n\t arg1\n\nOPTIONS:\n\t--opts3, -a  \t string example\n\t--opts2  \t number example\tdefault=1\n\t--opts1  \t boolean example\n\nSUB OPTIONS:\n\t--subflag1\n\t--help  \t show help\n```\n\n## License\n\nThis project is licensed under the Apache License 2.0 License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakito0107%2Fcatacli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakito0107%2Fcatacli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakito0107%2Fcatacli/lists"}