optparse-applicative review
A composable, typed toolkit for building Haskell command-line interfaces.
Reviewed by iTechGuides Editors · Editorial team · Updated Nov 2026
optparse-applicative is an open-source Haskell library for developers building command-line applications. Its applicative parser API handles command-line options, positional arguments, and validation while returning typed results through Haskell types. The library also generates usage lines and help screens, making it suitable for teams that want command definitions and user guidance to live together in code. Commands and sub-parsers extend the same model to multi-function command-line interfaces.
The parser-composition model is the standout feature. Applicative combinators let teams assemble option and argument parsers into structured results, while custom option readers and completers accommodate application-specific input rules. The package includes completion support for Bash, Zsh, and Fish, and its runners can generate completion scripts for options and arguments. These capabilities give Haskell teams a consistent path from parsing and validation to shell interaction without leaving the library's typed approach.
optparse-applicative is distributed through Hackage under the BSD-3-Clause license and is free to use as open-source software. Its scope is focused: it is a Haskell library rather than a general-purpose, cross-language CLI framework, so teams working outside Haskell should choose a tool aligned with their language stack. Support is centered on documentation, and there are no AI features. Pick it when typed parser composition, generated help, nested commands, and shell completions are priorities; consider an alternative when your project is not written in Haskell or requires capabilities beyond this focused parser library.
optparse-applicative pros and cons
- Where it wins
- Applicative combinators produce typed parser results
- Generated help plus Bash, Zsh, and Fish completions
- Commands and sub-parsers support multi-function CLIs
- Where it doesn't
- Applicative API is specific to Haskell development
- Support is provided through documentation
- No AI features are included
optparse-applicative fact sheet, pricing and score →
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update