@fedify/init builds its CLI on Optique (@optique/core, @optique/run), but the interactive prompts in packages/init/src/ask/ still use @inquirer/prompts and inquirer-toggle directly. @optique/inquirer wraps an Optique parser so that an Inquirer.js prompt fires only when no CLI value is provided—exactly the options.x ?? await askX() fallback pattern every fill* function in src/ask/ implements by hand.
Motivation
- The option-parsing layer already uses Optique extensively; moving prompts into the parser removes the hand-written CLI-value/prompt fallback logic in every
fill* function.
inquirer-toggle has had no release since April 2024 (v1.0.1) and is effectively unmaintained; the confirm prompt type covers its use cases.
- Optique and Fedify share a maintainer, so gaps found during migration can be addressed upstream quickly.
@optique/inquirer (v1.1.1) is published to both JSR and npm, matching the dual-registry dependency policy, and its prompter escape hatch enables TTY-free testing in mise test:init.
Known constraints
- Package manager choices depend on the selected web framework, and KV store/message queue choices depend on the selected package manager. Expressing these declaratively needs an upstream feature (choices derived from other parsed values).
- The re-prompt loops (package manager availability, KV/MQ compatibility) and the non-empty-directory trash confirmation flow in dir.ts run after parsing, so they remain application logic outside the parser.
Please add features for these, @dahlia! 🙏
Scope
Most of the modifications will be in packages/init/, especially packages/init/src/ask/.
@fedify/initbuilds its CLI on Optique (@optique/core,@optique/run), but the interactive prompts in packages/init/src/ask/ still use@inquirer/promptsandinquirer-toggledirectly.@optique/inquirerwraps an Optique parser so that an Inquirer.js prompt fires only when no CLI value is provided—exactly theoptions.x ?? await askX()fallback pattern everyfill*function in src/ask/ implements by hand.Motivation
fill*function.inquirer-togglehas had no release since April 2024 (v1.0.1) and is effectively unmaintained; theconfirmprompt type covers its use cases.@optique/inquirer(v1.1.1) is published to both JSR and npm, matching the dual-registry dependency policy, and itsprompterescape hatch enables TTY-free testing inmise test:init.Known constraints
Please add features for these, @dahlia! 🙏
Scope
Most of the modifications will be in packages/init/, especially packages/init/src/ask/.