command()
Define a command with typed options, positionals, and a handler function.
Import from maltty.
CommandDef
Yargs-native arg format
As an alternative to Zod, commands accept a yargs-native format for options and positionals. Both produce the same typed ctx.args.
YargsArgDef
Hidden and deprecated
Both accept a static value or a function (Resolvable<T>), resolved once at registration time.
Subcommands
Commands can contain nested subcommands:
autoload()
Dynamically discover commands from a directory at runtime.