

a framework for building node.js cli programs · rotini
source link: https://matthewgetz.github.io/rotini/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Features
Declarative Program Definitions
Define and describe your program commands, arguments, and flags. rotini will build your program and parse it; you only need to write code for your command operations.
Command, Argument, and Flag Parsing
rotini has a powerful and flexible parser. User input is checked against the program definition you write, and command operations are handed all parsed commands, arguments, and flags.
Subcommand Support
Nest commands under commands under commands under commands... Every command you define can have its own subcommands, bringing a declarative approach to program definitions.
Command Aliases
In the event that you need to deprecate a command or want to move to a better suited command name, you can supply an alias for the command that the parser will match to your command during parsing. Each command can have multiple aliases to reduce breaking changes and to help with naming migrations.
Command Force Prompting
rotini will prompt users to confirm (Y/n) commands that have a "force" flag defined in their definition, which can be helpful as a guard against destructive actions. The prompt can be bypassed if the user passes the override flag, which may also be needed in CI environments.
Value Validation
rotini argument and flag definitions can specify a type, which the parser will respect; mismatched value types passed to your program will report errors. Additionally, arguments and flags can have defined allowed values and are each provided with a callback for you to write additional validation for your argument and flag parsing.
Auto-Generated Help Output
Program and Command help output is built from the definition you provide to rotini. When a help flag is passed or when a command syntax is incorrect, rotini will output the corresponding help.
Ship Faster
rotini is a highly-opinionated framework that allows you to focus on your program code without needing to manage how your program is built or parsed. Add new commands quickly, deploy new functionality faster.
Configuration File Support
rotini returns helper functions for writing and reading a configuration file (JSON/txt) for your program when a configuration directory and file defined in the program definition.
Recommend
-
58
Building a Node JS interactive CLI “A robot named Pepper holding an iPad” by
-
33
Last week, I wrote an article about building a Node.js CLI using yargs . I introduced it saying we use cli tools everyday to simplify common t...
-
16
Turns out it’s almost shockingly easy to run Go CLI programs in the browser with WebAssembly (WASM); as an example I’ll use my uni program. Building is as easy as: G...
-
20
云音乐大前端专栏Node CLI 工具的插件方案探索2020-04-28 本文...
-
9
CLI Guidelines Aim to Help You Write Better CLI Programs Dec 17, 2020...
-
6
Writing Small CLI Programs in Common LispPosted on March 17th, 2021.I write a lot of command-line programs. For tiny programs I usually go...
-
4
安装node使用Homebrew安装# 查看node.js版本/本地是否安装node.js node -v # 指向homebrew安装node的目录 brew link node # 卸载node.js brew uninstall node # 安装node.js brew install node where node
-
62
Tailwind CSS Standalone CLI: Use Tailwind CSS without Node.js Tailwind just...
-
2
February 13, 2023 Building a simple CLI tool with modern Node.js I’m a maintainer of several dozen open source libraries. One thing I’ve always done is maintain a hand-written changelog. Here’s an example f...
-
9
Volodymyr Gubarkov
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK