A composable command-line parser for Scala, inspired by optparse-applicative and built on cats.
Decline is a command-line parsing library for Scala that provides a functional, composable API for building CLI applications. It allows developers to define options, flags, arguments, and subcommands in a type-safe manner, automatically generating help text and handling parsing logic. The library is designed to simplify the creation of robust command-line interfaces while leveraging Scala's strengths in functional programming.
Scala developers building command-line tools, applications, or scripts who want a type-safe, functional alternative to traditional CLI parsing libraries. It's particularly suited for projects already using Cats or functional programming patterns.
Decline offers a declarative, composable approach to CLI parsing that reduces boilerplate and improves correctness through type safety. Unlike imperative parsers, it enables building complex parsers from simple, reusable components and integrates seamlessly with the Cats ecosystem.
A composable command-line parser for Scala.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables building complex parsers from smaller, reusable components using functional combinators, as demonstrated in the README example where options are combined with .mapN for concise logic.
Leverages Scala's type system to ensure command-line arguments are parsed and validated correctly, reducing runtime errors and improving reliability, as highlighted in the project's philosophy.
Generates comprehensive and well-formatted help text automatically based on parser definitions, saving development time on documentation, a key feature mentioned in the README.
Facilitates building CLI tools with nested commands, similar to git or docker, making it suitable for complex applications with hierarchical interfaces.
Seamlessly integrates with the Cats functional programming library, providing consistent abstractions for projects already in the Typelevel ecosystem, as noted in the features.
Requires the Cats library, which can add unnecessary bloat and complexity for Scala projects not already using functional programming libraries or those seeking minimal dependencies.
The functional, composable approach may be challenging for developers unfamiliar with Cats or functional programming, despite documentation, potentially slowing onboarding for imperative-focused teams.
Only supports Scala, making it unsuitable for polyglot projects or environments where CLI tools need to integrate with multiple languages, unlike some cross-platform alternatives.
Focuses primarily on command-line argument parsing without native support for environment variables, requiring additional handling or libraries for full configuration management.