sacli
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.3 • Public • Published

    sacli

    Elegant and modern CLI builder for Node.js applications.

    Features

    • Multiple commands at any depth.
    • Automatic nicely formatted command help.
    • Type safe across commands.

    Get it now:

    npm i sacli

    Example

    const git = Command.new()
      .optional("dir", String)
      .required("id", Number)
      .repeated("flags", String);
    
    git
      .subcommand("status")
      .boolean("verbose", {description: "Show full details"})
      .repeated("folders", String, {alias: "F"})
      .repeated("files", String, {default: true})
      .action((args) => {
        args.dir === undefined;
        args.id === 78;
        args.flags.length === 0;
        args.verbose === false;
        arrayEquals(args.folders, ["a/", "b/"]);
        arrayEquals(args.files, ["a", "b", "c"]);
      });
    
    git.eval(["--id", "78", "status", "-F", "a/", "b/", "--", "a", "b", "c"]);

    Install

    npm i sacli

    DownloadsWeekly Downloads

    94

    Version

    4.0.3

    License

    MIT

    Unpacked Size

    13.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • wilsonzlin