How lukeed/sade works
Sade is a small CLI framework for defining commands, options, aliases, and handlers, then parsing argv, validating arguments, and invoking the selected handler. It also generates command and program help, reports errors, and supports version output. The Node implementation and a Deno variant have separate runtime modules and utility helpers. The README documents capabilities beyond the sampled code, including single-command mode and subcommands; those links are cited to the README rather than treated as independently inspected implementation.
Main entry points: index.js Argument Parsing · mod.js Deno Parsing · src/utils.js Help Generation · deno/utils.js Deno Help and Errors
Components 18
CLI Definition
- Node CLI API
src/index.js - Command Registry
src/index.js - Option Configuration
src/index.js - Deno CLI API
deno/mod.js
Parsing and Execution
- Argument Parsing
src/index.js - Command Resolution
src/index.js - Argument Validation
src/index.js - Command Handler
- Deno Parsing
deno/mod.js
Help and Feedback
- Help Generation
src/utils.js - Help Formatting
src/utils.js - Error Reporting
src/utils.js - Version Output
src/index.js - Deno Help and Errors
deno/utils.js
Other components
- CLI App Author
- CLI User
- mri Parser
- Deno Flags Parser
Connections 16
- CLI App Author → Node CLI API: defines CLI
readme.md - Node CLI API → Command Registry: registers commands
src/index.js - CLI App Author → Option Configuration: defines options
readme.md - Node CLI API → Option Configuration: configures flags
src/index.js - CLI App Author → Deno CLI API: defines CLI
- CLI User → Argument Parsing: provides argv
readme.md - Argument Parsing → mri Parser: parses flags
src/index.js - Argument Parsing → Command Resolution: resolves command
src/index.js - Argument Parsing → Argument Validation: checks arguments
src/index.js - Argument Parsing → Command Handler: invokes handler
src/index.js - Argument Parsing → Help Generation: shows help
src/index.js - Argument Parsing → Error Reporting: reports errors
src/index.js - Argument Parsing → Version Output: prints version
src/index.js - Deno Parsing → Deno Flags Parser: parses flags
deno/mod.js - Deno Parsing → Deno Help and Errors: uses output helpers
deno/mod.js - Help Generation → Help Formatting: formats sections
src/utils.js