API reference
Exports of @sigx/args v0.6.2.
Exports
| Export | What it is |
|---|---|
command(name) | Start a fluent command chain — .describe() / .version() / .aliases() / .hidden() / .allowUnknownFlags() / .args() / .subcommands() / .run(). See the command chain. |
a | The arg-builder namespace: a.string(), a.number(), a.boolean(), a.enum([...]), a.positional(), a.rest(), refined with .required() / .default() / .multiple() / .alias() / .negatable() / .describe() / .valueHint() / .hidden(). See arg builders and refiners. |
runMain(cmd, opts?) | Parse process.argv, run the matched handler, print errors/help and set process.exitCode. See embedding. |
runCommand(cmd, opts) | Like runMain but throws instead of printing — for hosts that render errors themselves. |
parseArgs(argv, shape) | Headless parsing against a record of builders, no command needed. See headless parsing. |
buildHelpCatalog(cmd) / renderHelp(catalog) | The structured HelpCatalog model plus the plain-text renderer. See headless help catalog. |
ParseError / DefinitionError | Typed errors with machine-readable code + structured detail. See errors. |
The companion types AnyArg, ArgsShape and InferArgs are exported alongside the
builders. See the package source for the complete typed surface.
