Optique 0.8.0: Conditional parsing, pass-through options, and LogTape integration

洪 民憙 (Hong Minhee) @hongminhee@hackers.pub

Optique 0.8.0 enhances TypeScript CLI development with new functional parsing primitives that prioritize type safety and expressiveness. A new conditional combinator brings first-class support for discriminated union patterns, enabling developers to define mutually exclusive option sets that activate based on specific discriminator values. For those building proxy or wrapper tools, the pass-through parser efficiently captures unrecognized arguments in various formats without triggering validation errors. Integration with the LogTape ecosystem arrives via a dedicated package, allowing for streamlined logging configuration through verbosity flags and output destination parameters. The release also includes a key bug fix for the integer value parser, which now correctly accepts negative values to ensure consistency across numeric types. These additions strengthen the ability to compose complex CLI logic while maintaining full type inference and backward compatibility. This update provides essential tools for developers looking to build robust, professional-grade command-line applications with minimal boilerplate and maximum reliability.

Read more →
5

If you have a fediverse account, you can quote this article from your own instance. Search https://hackers.pub/ap/articles/019b016f-8e15-7fd7-958b-506f9cf3f0b1 on your instance and quote it. (Note that quoting is not supported in Mastodon.)

Released Optique 0.8.0, a type-safe CLI parser for TypeScript.

This version adds conditional() for branching based on a discriminator option, passThrough() for forwarding unknown options to underlying tools, and a new @optique/logtape package for configuring LogTape via CLI.

https://hackers.pub/@hongminhee/2025/optique-080

4