{"id":13459093,"url":"https://github.com/lukeed/sade","last_synced_at":"2025-05-14T02:08:08.092Z","repository":{"id":44415139,"uuid":"112714241","full_name":"lukeed/sade","owner":"lukeed","description":"Smooth (CLI) Operator 🎶","archived":false,"fork":false,"pushed_at":"2024-09-27T00:48:27.000Z","size":111,"stargazers_count":1058,"open_issues_count":15,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-05T16:04:35.522Z","etag":null,"topics":["argv","cli","cli-app","command-line","commander","yargs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/lukeed.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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":"lukeed"}},"created_at":"2017-12-01T08:24:56.000Z","updated_at":"2025-05-04T23:00:11.000Z","dependencies_parsed_at":"2024-06-18T12:14:37.172Z","dependency_job_id":"ab613497-24c8-49f4-b610-e1794d14904f","html_url":"https://github.com/lukeed/sade","commit_stats":{"total_commits":113,"total_committers":6,"mean_commits":"18.833333333333332","dds":0.04424778761061943,"last_synced_commit":"8aa4a69e95fbfba88cf49082713900ecbe27f183"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fsade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fsade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fsade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fsade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/sade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847480,"owners_count":21813452,"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","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":["argv","cli","cli-app","command-line","commander","yargs"],"created_at":"2024-07-31T09:01:03.546Z","updated_at":"2025-05-14T02:08:03.079Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","readme":"# sade [![CI](https://github.com/lukeed/sade/workflows/CI/badge.svg)](https://github.com/lukeed/sade/actions?query=workflow%3ACI) [![licenses](https://licenses.dev/b/npm/sade)](https://licenses.dev/npm/sade)\n\n\u003e Smooth (CLI) Operator 🎶\n\nSade is a small but powerful tool for building command-line interface (CLI) applications for Node.js that are fast, responsive, and helpful!\n\nIt enables default commands, git-like subcommands, option flags with aliases, default option values with type-casting, required-vs-optional argument handling, command validation, and automated help text generation!\n\nYour app's UX will be as smooth as butter... just like [Sade's voice](https://www.youtube.com/watch?v=4TYv2PhG89A). 😉\n\n\n## Install\n\n```\n$ npm install --save sade\n```\n\n\n## Usage\n\n***Input:***\n\n```js\n#!/usr/bin/env node\n\nconst sade = require('sade');\n\nconst prog = sade('my-cli');\n\nprog\n  .version('1.0.5')\n  .option('--global, -g', 'An example global flag')\n  .option('-c, --config', 'Provide path to custom config', 'foo.config.js');\n\nprog\n  .command('build \u003csrc\u003e \u003cdest\u003e')\n  .describe('Build the source directory. Expects an `index.js` entry file.')\n  .option('-o, --output', 'Change the name of the output file', 'bundle.js')\n  .example('build src build --global --config my-conf.js')\n  .example('build app public -o main.js')\n  .action((src, dest, opts) =\u003e {\n    console.log(`\u003e building from ${src} to ${dest}`);\n    console.log('\u003e these are extra opts', opts);\n  });\n\nprog.parse(process.argv);\n```\n\n***Output:***\n\n```a\n$ my-cli --help\n\n  Usage\n    $ my-cli \u003ccommand\u003e [options]\n\n  Available Commands\n    build    Build the source directory.\n\n  For more info, run any command with the `--help` flag\n    $ my-cli build --help\n\n  Options\n    -v, --version    Displays current version\n    -g, --global     An example global flag\n    -c, --config     Provide path to custom config  (default foo.config.js)\n    -h, --help       Displays this message\n\n\n$ my-cli build --help\n\n  Description\n    Build the source directory.\n    Expects an `index.js` entry file.\n\n  Usage\n    $ my-cli build \u003csrc\u003e [options]\n\n  Options\n    -o, --output    Change the name of the output file  (default bundle.js)\n    -g, --global    An example global flag\n    -c, --config    Provide path to custom config  (default foo.config.js)\n    -h, --help      Displays this message\n\n  Examples\n    $ my-cli build src build --global --config my-conf.js\n    $ my-cli build app public -o main.js\n```\n\n## Tips\n\n- **Define your global/program-wide version, options, description, and/or examples first.**\u003cbr\u003e\n  _Once you define a Command, you can't access the global-scope again._\n\n- **Define all commands \u0026 options in the order that you want them to appear.**\u003cbr\u003e\n  _Sade will not mutate or sort your CLI for you. Global options print before local options._\n\n- **Required arguments without values will error \u0026 exit**\u003cbr\u003e\n  _An `Insufficient arguments!` error will be displayed along with a help prompt._\n\n- **Don't worry about manually displaying help~!**\u003cbr\u003e\n  _Your help text is displayed automatically... including command-specific help text!_\n\n- **Automatic default/basic patterns**\u003cbr\u003e\n  _Usage text will always append `[options]` \u0026 `--help` and `--version` are done for you._\n\n- **Only define what you want to display!**\u003cbr\u003e\n  _Help text sections (example, options, etc) will only display if you provide values._\n\n\n## Subcommands\n\nSubcommands are defined \u0026 parsed like any other command! When defining their [`usage`](#usage-1), everything up until the first argument (`[foo]` or `\u003cfoo\u003e`) is interpreted as the command string.\n\nThey should be defined in the order that you want them to appear in your general `--help` output.\n\nLastly, it is _not_ necessary to define the subcommand's \"base\" as an additional command. However, if you choose to do so, it's recommended that you define it first for better visibility.\n\n```js\nconst prog = sade('git');\n\n// Not necessary for subcommands to work, but it's here anyway!\nprog\n  .command('remote')\n  .describe('Manage set of tracked repositories')\n  .action(opts =\u003e {\n    console.log('~\u003e Print current remotes...');\n  });\n\nprog\n  .command('remote add \u003cname\u003e \u003curl\u003e', 'Demo...')\n  .action((name, url, opts) =\u003e {\n    console.log(`~\u003e Adding a new remote (${name}) to ${url}`);\n  });\n\nprog\n  .command('remote rename \u003cold\u003e \u003cnew\u003e', 'Demo...')\n  .action((old, nxt, opts) =\u003e {\n    console.log(`~\u003e Renaming from ${old} to ${nxt}~!`);\n  });\n```\n\n\n## Single Command Mode\n\nIn certain circumstances, you may only need `sade` for a single-command CLI application.\n\n\u003e **Note:** Until `v1.6.0`, this made for an awkward pairing.\n\nTo enable this, you may make use of the [`isSingle`](#issingle) argument. Doing so allows you to pass the program's entire [`usage` text](#usage-1) into the `name` argument.\n\nWith \"Single Command Mode\" enabled, your entire binary operates as one command. This means that any [`prog.command`](#progcommandusage-desc-opts) calls are disallowed \u0026 will instead throw an Error. Of course, you may still define a program version, a description, an example or two, and declare options. You are customizing the program's attributes as a whole.\u003csup\u003e*\u003c/sup\u003e\n\n\u003e \u003csup\u003e*\u003c/sup\u003e This is true for multi-command applications, too, up until your first `prog.command()` call!\n\n***Example***\n\nLet's reconstruct [`sirv-cli`](https://github.com/lukeed/sirv), which is a single-command application that (optionally) accepts a directory from which to serve files. It also offers a slew of option flags:\n\n```js\nsade('sirv [dir]', true)\n  .version('1.0.0')\n  .describe('Run a static file server')\n  .example('public -qeim 31536000')\n  .example('--port 8080 --etag')\n  .example('my-app --dev')\n  .option('-D, --dev', 'Enable \"dev\" mode')\n  .option('-e, --etag', 'Enable \"Etag\" header')\n  // There are a lot...\n  .option('-H, --host', 'Hostname to bind', 'localhost')\n  .option('-p, --port', 'Port to bind', 5000)\n  .action((dir, opts) =\u003e {\n    // Program handler\n  })\n  .parse(process.argv);\n```\n\nWhen `sirv --help` is run, the generated help text is trimmed, fully aware that there's only one command in this program:\n\n```\n  Description\n    Run a static file server\n\n  Usage\n    $ sirv [dir] [options]\n\n  Options\n    -D, --dev        Enable \"dev\" mode\n    -e, --etag       Enable \"Etag\" header\n    -H, --host       Hostname to bind  (default localhost)\n    -p, --port       Port to bind  (default 5000)\n    -v, --version    Displays current version\n    -h, --help       Displays this message\n\n  Examples\n    $ sirv public -qeim 31536000\n    $ sirv --port 8080 --etag\n    $ sirv my-app --dev\n```\n\n## Command Aliases\n\nCommand aliases are alternative names (aliases) for a command. They are often used as shortcuts or as typo relief!\n\nThe aliased names do not appear in the general help text.\u003cbr\u003e\nInstead, they only appear within the Command-specific help text under an \"Aliases\" section.\n\n***Limitations***\n\n* You cannot assign aliases while in [Single Command Mode](#single-command-mode)\n* You cannot call [`prog.alias()`](#progaliasnames) before defining any Commands (via `prog.commmand()`)\n* You, the developer, must keep track of which aliases have already been used and/or exist as Command names\n\n***Example***\n\nLet's reconstruct the `npm install` command as a Sade program:\n\n```js\nsade('npm')\n  // ...\n  .command('install [package]', 'Install a package', {\n    alias: ['i', 'add', 'isntall']\n  })\n  .option('-P, --save-prod', 'Package will appear in your dependencies.')\n  .option('-D, --save-dev', 'Package will appear in your devDependencies.')\n  .option('-O, --save-optional', 'Package will appear in your optionalDependencies')\n  .option('-E, --save-exact', 'Save exact versions instead of using a semver range operator')\n  // ...\n```\n\nWhen we run `npm --help` we'll see this general help text:\n\n```\n  Usage\n    $ npm \u003ccommand\u003e [options]\n\n  Available Commands\n    install    Install a package\n\n  For more info, run any command with the `--help` flag\n    $ npm install --help\n\n  Options\n    -v, --version    Displays current version\n    -h, --help       Displays this message\n```\n\nWhen we run `npm install --help` \u0026mdash; ***or*** the help flag with any of `install`'s aliases \u0026mdash; we'll see this command-specific help text:\n\n```\n  Description\n    Install a package\n\n  Usage\n    $ npm install [package] [options]\n\n  Aliases\n    $ npm i\n    $ npm add\n    $ npm isntall\n\n  Options\n    -P, --save-prod        Package will appear in your dependencies.\n    -D, --save-dev         Package will appear in your devDependencies.\n    -O, --save-optional    Package will appear in your optionalDependencies\n    -E, --save-exact       Save exact versions instead of using a semver range operator\n    -h, --help             Displays this message\n```\n\n\n\n## API\n\n### sade(name, isSingle)\nReturns: `Program`\n\nReturns your chainable Sade instance, aka your `Program`.\n\n#### name\nType: `String`\u003cbr\u003e\nRequired: `true`\n\nThe name of your `Program` / binary application.\n\n#### isSingle\nType: `Boolean`\u003cbr\u003e\nDefault: `name.includes(' ');`\n\nIf your `Program` is meant to have ***only one command***.\u003cbr\u003e\nWhen `true`, this simplifies your generated `--help` output such that:\n\n* the \"root-level help\" is your _only_ help text\n* the \"root-level help\" does not display an `Available Commands` section\n* the \"root-level help\" does not inject `$ name \u003ccommand\u003e` into the `Usage` section\n* the \"root-level help\" does not display `For more info, run any command with the `--help` flag` text\n\nYou may customize the `Usage` of your command by modifying the `name` argument directly.\u003cbr\u003e\nPlease read [Single Command Mode](#single-command-mode) for an example and more information.\n\n\u003e **Important:** Whenever `name` includes a custom usage, then `isSingle` is automatically assumed and enforced!\n\n### prog.command(usage, desc, opts)\n\nCreate a new Command for your Program. This changes the current state of your Program.\n\nAll configuration methods (`prog.describe`, `prog.action`, etc) will apply to this Command until another Command has been created!\n\n#### usage\n\nType: `String`\n\nThe usage pattern for your current Command. This will be included in the general or command-specific `--help` output.\n\n_Required_ arguments are wrapped with `\u003c` and `\u003e` characters; for example, `\u003cfoo\u003e` and `\u003cbar\u003e`.\n\n_Optional_ arguments are wrapped with `[` and `]` characters; for example, `[foo]` and `[bar]`.\n\nAll arguments are ***positionally important***, which means they are passed to your current Command's [`handler`](#handler) function in the order that they were defined.\n\nWhen optional arguments are defined but don't receive a value, their positionally-equivalent function parameter will be `undefined`.\n\n\u003e **Important:** You **must** define \u0026 expect required arguments _before_ optional arguments!\n\n```js\nsade('foo')\n\n  .command('greet \u003cadjective\u003e \u003cnoun\u003e')\n  .action((adjective, noun, opts) =\u003e {\n    console.log(`Hello, ${adjective} ${noun}!`);\n  })\n\n  .command('drive \u003cvehicle\u003e [color] [speed]')\n  .action((vehicle, color, speed, opts) =\u003e {\n    let arr = ['Driving my'];\n    arr.push(color ? `${color} ${vehicle}` : vehicle);\n    speed \u0026\u0026 arr.push(`at ${speed}`);\n    opts.yolo \u0026\u0026 arr.push('...YOLO!!');\n    let str = arr.join(' ');\n    console.log(str);\n  });\n```\n\n```sh\n$ foo greet beautiful person\n# //=\u003e Hello, beautiful person!\n\n$ foo drive car\n# //=\u003e Driving my car\n\n$ foo drive car red\n# //=\u003e Driving my red card\n\n$ foo drive car blue 100mph --yolo\n# //=\u003e Driving my blue car at 100mph ...YOLO!!\n```\n\n\n#### desc\n\nType: `String`\u003cbr\u003e\nDefault: `''`\n\nThe Command's description. The value is passed directly to [`prog.describe`](#progdescribetext).\n\n#### opts\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\n##### opts.alias\nType: `String|Array`\n\nOptionally define one or more aliases for the current Command.\u003cbr\u003e\nWhen declared, the `opts.alias` value is passed _directly_ to the [`prog.alias`](#progaliasnames) method.\n\n```js\n// Program A is equivalent to Program B\n// ---\n\nconst A = sade('bin')\n  .command('build', 'My build command', { alias: 'b' })\n  .command('watch', 'My watch command', { alias: ['w', 'dev'] });\n\nconst B = sade('bin')\n  .command('build', 'My build command').alias('b')\n  .command('watch', 'My watch command').alias('w', 'dev');\n```\n\n\n##### opts.default\n\nType: `Boolean`\n\nManually set/force the current Command to be the Program's default command. This ensures that the current Command will run if no command was specified.\n\n\u003e **Important:** If you run your Program without a Command _and_ without specifying a default command, your Program will exit with a `No command specified` error.\n\n```js\nconst prog = sade('greet');\n\nprog.command('hello');\n//=\u003e only runs if :: `$ greet hello`\n\n// $ greet\n//=\u003e error: No command specified.\n\nprog.command('howdy', '', { default:true });\n//=\u003e runs as `$ greet` OR `$ greet howdy`\n\n// $ greet\n//=\u003e runs 'howdy' handler\n\n// $ greet foobar\n//=\u003e error: Invalid command\n```\n\n\n### prog.describe(text)\n\nAdd a description to the current Command.\n\n#### text\n\nType: `String|Array`\n\nThe description text for the current Command. This will be included in the general or command-specific `--help` output.\n\nInternally, your description will be separated into an `Array` of sentences.\n\nFor general `--help` output, ***only*** the first sentence will be displayed. However, **all sentences** will be printed for command-specific `--help` text.\n\n\u003e **Note:** Pass an `Array` if you don't want internal assumptions. However, the first item is _always_ displayed in general help, so it's recommended to keep it short.\n\n\n### prog.alias(...names)\n\nDefine one or more aliases for the current Command.\n\n\u003e **Important:** An error will be thrown if:\u003cbr\u003e1) the program is in [Single Command Mode](#single-command-mode); or\u003cbr\u003e2) `prog.alias` is called before any `prog.command`.\n\n#### names\n\nType: `String`\n\nThe list of alternative names (aliases) for the current Command.\u003cbr\u003e\nFor example, you may want to define shortcuts and/or common typos for the Command's full name.\n\n\u003e **Important:** Sade _does not_ check if the incoming `names` are already in use by other Commands or their aliases.\u003cbr\u003eDuring conflicts, the Command with the same `name` is given priority, otherwise the first Command (according to Program order) with `name` as an alias is chosen.\n\nThe `prog.alias()` is append-only, so calling it multiple times within a Command context will _keep_ all aliases, including those initially passed via [`opts.alias`](#optsdefault).\n\n```js\nsade('bin')\n  .command('hello \u003cname\u003e', 'Greet someone by their name', {\n    alias: ['hey', 'yo']\n  })\n  .alias('hi', 'howdy')\n  .alias('hola', 'oi');\n//=\u003e hello aliases: hey, yo, hi, howdy, hola, oi\n```\n\n\n### prog.action(handler)\n\nAttach a callback to the current Command.\n\n#### handler\n\nType: `Function`\n\nThe function to run when the current Command is executed.\n\nIts parameters are based (positionally) on your Command's [`usage`](#usage-1) definition.\n\nAll options, flags, and extra/unknown values are included as the last parameter.\n\n\u003e **Note:** Optional arguments are also passed as parameters \u0026 may be `undefined`!\n\n```js\nsade('foo')\n  .command('cp \u003csrc\u003e \u003cdest\u003e')\n  .option('-f, --force', 'Overwrite without confirmation')\n  .option('-c, --clone-dir', 'Copy files to additional directory')\n  .option('-v, --verbose', 'Enable verbose output')\n  .action((src, dest, opts) =\u003e {\n    console.log(`Copying files from ${src} --\u003e ${dest}`);\n    opts.c \u0026\u0026 console.log(`ALSO copying files from ${src} --\u003e ${opts['clone-dir']}`);\n    console.log('My options:', opts);\n  })\n\n// $ foo cp original my-copy -v\n//=\u003e Copying files from original --\u003e my-copy\n//=\u003e My options: { _:[], v:true, verbose:true }\n\n// $ foo cp original my-copy --clone-dir my-backup\n//=\u003e Copying files from original --\u003e my-copy\n//=\u003e ALSO copying files from original --\u003e my-backup\n//=\u003e My options: { _:[], c:'my-backup', 'clone-dir':'my-backup' }\n```\n\n\n### prog.example(str)\n\nAdd an example for the current Command.\n\n#### str\n\nType: `String`\n\nThe example string to add. This will be included in the general or command-specific `--help` output.\n\n\u003e **Note:** Your example's `str` will be prefixed with your Program's [`name`](#sadename).\n\n\n### prog.option(flags, desc, value)\n\nAdd an Option to the current Command.\n\n#### flags\n\nType: `String`\n\nThe Option's flags, which may optionally include an alias.\n\nYou may use a comma (`,`) or a space (` `) to separate the flags.\n\n\u003e **Note:** The short \u0026 long flags can be declared in any order. However, the alias will always be displayed first.\n\n\u003e **Important:** If using hyphenated flag names, they will be accessible **as declared** within your [`action()`](#progactionhandler) handler!\n\n```js\nprog.option('--global'); // no alias\nprog.option('-g, --global'); // alias first, comma\nprog.option('--global -g'); // alias last, space\n// etc...\n```\n\n#### desc\n\nType: `String`\n\nThe description for the Option.\n\n#### value\n\nType: `String`\n\nThe **default** value for the Option.\n\nFlags and aliases, if parsed, are `true` by default. See [`mri`](https://github.com/lukeed/mri#minimist) for more info.\n\n\u003e **Note:** You probably only want to define a default `value` if you're expecting a `String` or `Number` value type.\n\nIf you _do_ pass a `String` or `Number` value type, your flag value will be casted to the same type. See [`mri#options.default`](https://github.com/lukeed/mri#optionsdefault) for info~!\n\n\n### prog.version(str)\n\nThe `--version` and `-v` flags will automatically output the Program version.\n\n#### str\n\nType: `String`\u003cbr\u003e\nDefault: `0.0.0`\n\nThe new version number for your Program.\n\n\u003e **Note:** Your Program `version` is `0.0.0` until you change it.\n\n### prog.parse(arr, opts)\n\nParse a set of CLI arguments.\n\n#### arr\n\nType: `Array`\n\nYour Program's `process.argv` input.\n\n\u003e **Important:** Do not `.slice(2)`! Doing so will break parsing~!\n\n#### opts\n\nType: `Object`\u003cbr\u003e\nDefault: `{}`\n\nAdditional `process.argv` parsing config. See [`mri`'s options](https://github.com/lukeed/mri#mriargs-options) for details.\n\n\u003e **Important:** These values _override_ any internal values!\n\n```js\nprog\n  .command('hello')\n  .option('-f, --force', 'My flag');\n//=\u003e currently has alias pair: f \u003c--\u003e force\n\nprog.parse(process.argv, {\n  alias: {\n    f: ['foo', 'fizz']\n  },\n  default: {\n    abc: 123\n  }\n});\n//=\u003e ADDS alias pair: f \u003c--\u003e foo\n//=\u003e REMOVES alias pair: f \u003c--\u003e force\n//=\u003e ADDS alias pair: f \u003c--\u003e fizz\n//=\u003e ADDS default: abc -\u003e 123 (number)\n```\n\n#### opts.unknown\n\nType: `Function`\u003cbr\u003e\nDefault: `undefined`\n\nCallback to run when an unspecified option flag has been found. This is [passed directly to `mri`](https://github.com/lukeed/mri#optionsunknown).\n\nYour handler will receive the unknown flag (string) as its only argument.\u003cbr\u003e\nYou may return a string, which will be used as a custom error message. Otherwise, a default message is displayed.\n\n```js\nsade('sirv')\n  .command('start [dir]')\n  .parse(process.argv, {\n    unknown: arg =\u003e `Custom error message: ${arg}`\n  });\n\n/*\n$ sirv start --foobar\n\n  ERROR\n    Custom error message: --foobar\n\n  Run `$ sirv --help` for more info.\n*/\n```\n\n#### opts.lazy\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nIf true, Sade will not immediately execute the `action` handler. Instead, `parse()` will return an object of `{ name, args, handler }` shape, wherein the `name` is the command name, `args` is all arguments that _would be_ passed to the action handler, and `handler` is the function itself.\n\nFrom this, you may choose when to run the `handler` function. You also have the option to further modify the `args` for any reason, if needed.\n\n```js\nlet { name, args, handler } = prog.parse(process.argv, { lazy:true });\nconsole.log('\u003e Received command: ', name);\n\n// later on...\nhandler.apply(null, args);\n```\n\n### prog.help(cmd)\n\nManually display the help text for a given command. If no command name is provided, the general/global help is printed.\n\nYour general and command-specific help text is automatically attached to the `--help` and `-h` flags.\n\n\u003e **Note:** You don't have to call this directly! It's automatically run when you `bin --help`\n\n#### cmd\nType: `String`\u003cbr\u003e\nDefault: `null`\n\nThe name of the command for which to display help. Otherwise displays the general help.\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","funding_links":["https://github.com/sponsors/lukeed"],"categories":["JavaScript","Packages","Utilities","cli","Creating CLI apps","Node.js / JavaScript 🟨"],"sub_categories":["CLI (TTY etc..)","Command Line Interfaces (CLI)","Server-rendered React"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fsade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Fsade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fsade/lists"}