From five optional fields to a discriminated union: CLI parsing with Optique 1.0
Summary
Optique 1.0 reframes CLI parsing by modeling mutually exclusive option sets as a discriminated union, enabling the type system to track which fields exist for each chosen branch. It adds multi-source input from argv, environment, config, and prompts with a single reconciliation model and runtime validation. The article contrasts this with Commander.js and Yargs and explains when Optique pays off, plus notes on 1.0's improvements and usage guidance.