modular_cli_sdk 0.2.0
modular_cli_sdk: ^0.2.0 copied to clipboard
Command-centric SDK for building modular CLIs with Dart — Command/Input/Output contract, structured errors, output formatting, and automatic TTY detection. Built on cli_router.
Changelog #
All notable changes to this project will be documented in this file.
The format loosely follows Keep a Changelog and the project adheres to Semantic Versioning.
0.2.0 #
Added #
ModularCli.command<I, O>()— register root-level commands without a module prefix- Root commands reuse the full
Command<I, O>lifecycle (validate → execute → format) - Root commands honor
--json,--quiet,CommandException, and semantic exit codes - Example
versionroot command inexample/commands/version.dart - 4 new integration tests for root commands
0.1.0 #
Added #
ModularCli— entry point that orchestrates modules, global flags, and TTY detectionModuleBuilder— per-module command registration viacommand()Command<I, O>— abstract unit of work withvalidate()andexecute()lifecycleInput— abstract inbound DTO (deserialize fromCliRequestflags/params)Output— abstract outbound DTO withtoJson()andexitCodeCommandException— structured error withcode,message,details,isRetryableExitCode— semantic exit code constants (0, 1, 2, 4, 5, 6, 7, 64)CliOutput/JsonCliOutput/TextCliOutput— output formatting abstraction--jsonglobal flag — machine-readable JSON output--quiet/-qglobal flag — suppress informational messages- Working example with two modules (greetings + math)
- Full test suite (unit + integration)