{"id":37730229,"url":"https://github.com/kvnlnt/spawn","last_synced_at":"2026-01-16T13:49:09.984Z","repository":{"id":57125936,"uuid":"128011711","full_name":"kvnlnt/spawn","owner":"kvnlnt","description":"The super simple cli lib I always wanted.","archived":false,"fork":false,"pushed_at":"2018-10-17T02:08:54.000Z","size":70,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-10T04:03:13.118Z","etag":null,"topics":["cli","command-line","command-line-parser","command-line-tool","command-line-tools"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kvnlnt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-04T05:29:49.000Z","updated_at":"2018-10-17T02:08:55.000Z","dependencies_parsed_at":"2022-08-31T17:02:27.818Z","dependency_job_id":null,"html_url":"https://github.com/kvnlnt/spawn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kvnlnt/spawn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvnlnt%2Fspawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvnlnt%2Fspawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvnlnt%2Fspawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvnlnt%2Fspawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvnlnt","download_url":"https://codeload.github.com/kvnlnt/spawn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvnlnt%2Fspawn/sbom","scorecard":{"id":574557,"data":{"date":"2025-08-11","repo":{"name":"github.com/kvnlnt/spawn","commit":"cd5bcddba109d21f2af4c8d512ae2fee789b9dd2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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"}}]},"last_synced_at":"2025-08-20T17:18:04.912Z","repository_id":57125936,"created_at":"2025-08-20T17:18:04.912Z","updated_at":"2025-08-20T17:18:04.912Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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","command-line-parser","command-line-tool","command-line-tools"],"created_at":"2026-01-16T13:49:07.911Z","updated_at":"2026-01-16T13:49:09.970Z","avatar_url":"https://github.com/kvnlnt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://badge.fury.io/js/%40kvnlnt%2Fspawn\"\u003e\u003cimg src=\"https://badge.fury.io/js/%40kvnlnt%2Fspawn.svg\" alt=\"npm version\" height=\"18\"\u003e\u003c/a\u003e\r\n\r\n# Spawn\r\n\r\n## Features\r\n\r\n1. Create your own cli\r\n2. Auto generates guide for cli and individual commands\r\n3. Interactive mode (using `-i` flag)\r\n4. Argument defaults\r\n\r\n## Install\r\n\r\n```shell\r\nnpm i @kvnlnt/spawn\r\n```\r\n\r\n## Usage\r\n\r\nmycli.js\r\n\r\n```javascript\r\n// the lib\r\nconst cli = require(\"@kvnlnt/spawn\");\r\n\r\n// add a command, add an argument, a callback and an example\r\ncli\r\n  .command(\"hello\", \"Prints hello\")\r\n  .argument(\"output\", \"o\", \"Hello to\")\r\n  .callback(resp =\u003e console.log(\"Hello,\", resp.output))\r\n  .example(\"hello -o=World\", \"Prints; Hello World\");\r\n\r\n// add another\r\ncli\r\n  .command(\"goodbye\", \"Prints goodbye\")\r\n  .argument(\"output\", \"o\", \"Goodbye to\")\r\n  .callback(resp =\u003e console.log(\"Goodbye,\", resp.output))\r\n  .example(\"goodbye -o=World\", \"Prints: Goodbye World\");\r\n\r\n// set the default command\r\ncli.defaultCommand(\"help\");\r\n\r\n// run the cli\r\ncli.run();\r\n```\r\n\r\nNow set up your tool to be a cli with [npm link](https://docs.npmjs.com/cli/link) and you'll get something like this\r\n\r\n```shell\r\nmycli hello -o=You\r\n# result =\u003e Hello You\r\n```\r\n\r\n## Methods\r\n\r\nAll methods are meant to be chained. This is to support a clean api. To keep things organized it's recommended that you keep your callbacks as external scripts. It keep my in a `tasks` folder.\r\n\r\n### command(name, desc)\r\n\r\nAdds a command\r\n\r\n| Arg  | Type   | Desc                   |\r\n| ---- | ------ | ---------------------- |\r\n| name | string | name of command        |\r\n| desc | string | description of command |\r\n\r\n### argument(name, abbr, desc, def)\r\n\r\nAdds an argument to last added command\r\n\r\n| Arg  | Type     | Desc                      |\r\n| ---- | -------- | ------------------------- |\r\n| name | string   | name of argument          |\r\n| abbr | string   | abbreviated argument name |\r\n| desc | string   | description of argument   |\r\n| def  | anything | default value             |\r\n\r\n### callback(f)\r\n\r\nAdds callback to last added command\r\n\r\n| Arg | Type     | Desc                                     |\r\n| --- | -------- | ---------------------------------------- |\r\n| f   | function | function called when command is executed |\r\n\r\n### example(cmd, desc)\r\n\r\nAdds example to last added command\r\n\r\n| Arg  | Type   | Desc            |\r\n| ---- | ------ | --------------- |\r\n| cmd  | string | example command |\r\n| desc | string | description     |\r\n\r\n### defaultCommand(cmd)\r\n\r\nSets default command\r\n\r\n| Arg | Type   | Desc            |\r\n| --- | ------ | --------------- |\r\n| cmd | string | name of command |\r\n\r\n### run()\r\n\r\nRuns the cli\r\n\r\n### printGuide()\r\n\r\nThis is the auto generated guide. To use it, assign it as a callback. Something like this:\r\n\r\n```js\r\ncli.command(\"guide\", \"Prints guide\").callback(cli.printGuide);\r\n```\r\n\r\n### printCommandGuide()\r\n\r\nThis is the autogenerated guide for a command. Commands are bound to the cli instance and therefore are available inside the callback as `this.printCommandGuide`. Just pass in the string name of the command. Here's an example:\r\n\r\n```js\r\n// your callback\r\nfunction myCallback(resp) {\r\n  if (resp.help === true) return this.printCommandGuide(\"myCallback\");\r\n  console.log(resp.output);\r\n}\r\n\r\n// your cli\r\ncli\r\n  .command(\"myCallback\", \"does stuff\")\r\n  .argument(\"help\", \"h\", \"Output help\", false)\r\n  .callback(myCallback);\r\n```\r\n\r\nThe following will output the command's guide:\r\n\r\n```shell\r\nmycli myCallback -h\r\n```\r\n\r\n## Flags\r\n\r\n### -i, Interactive Mode\r\n\r\nYou can pass the `-i` flag without a command and use your tool interactively, like this:\r\n\r\n```shell\r\nmycli -i\r\n```\r\n\r\n## Examples\r\n\r\nAll examples are in the [Examples](examples) folder.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvnlnt%2Fspawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvnlnt%2Fspawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvnlnt%2Fspawn/lists"}