{"library":"parse-help","title":"Parse CLI Help Output","description":"parse-help is a JavaScript utility for programmatically parsing the help output of command-line interfaces, extracting structured information about their flags, options, and aliases. It provides a structured object representation of CLI options, making it easier to analyze or process them within other tools. The current stable version is 2.0.0. The package is maintained by Sindre Sorhus, known for a high volume of small, focused utility packages, typically implying a stable but not necessarily rapid release cadence unless new features or breaking changes warrant it. A key differentiator is its focus specifically on parsing *help output* rather than building a CLI from scratch or parsing `argv` directly, making it useful for introspection or documentation generation from existing CLIs.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install parse-help"],"cli":null},"imports":["import parseHelp from 'parse-help';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import parseHelp from 'parse-help';\n\nconst helpOutput = `\n\tUsage\n\t  $ my-cli <command> [options]\n\n\tOptions\n\t  -v, --verbose    Enable verbose logging\n\t  --config <path>  Specify a configuration file (default: config.json)\n\t  -h, --help       Show help information\n\n\tExamples\n\t  $ my-cli start\n\t  $ my-cli build --config custom.json\n`;\n\nconst parsed = parseHelp(helpOutput);\n\nconsole.log('Parsed Flags:', JSON.stringify(parsed.flags, null, 2));\nconsole.log('Parsed Aliases:', JSON.stringify(parsed.aliases, null, 2));\n\n/*\nOutput would be:\nParsed Flags: {\n  \"verbose\": {\n    \"alias\": \"v\",\n    \"description\": \"Enable verbose logging\"\n  },\n  \"config\": {\n    \"description\": \"Specify a configuration file (default: config.json)\"\n  },\n  \"help\": {\n    \"alias\": \"h\",\n    \"description\": \"Show help information\"\n  }\n}\nParsed Aliases: {\n  \"v\": \"verbose\",\n  \"h\": \"help\"\n}\n*/","lang":"javascript","description":"Demonstrates how to import and use `parseHelp` to process a sample CLI help string and output the structured flags and aliases.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}