Lightweight, extensible, and validated configuration loading in Scala. The core library is dependency-free, while modules provide integrations with external libraries.
The name comes from being an abbreviation of the word configurations. Ciris' logo was inspired by the epyllion Ciris from Appendix Vergiliana.
The Ciris is an epyllion in 541 hexameters describing the myth of Nisus, the king of Megara and his daughter Scylla.
After the city falls and Scylla is taken prisoner on the Cretan ships, Amphitrite transforms her into the ciris seabird.
Ciris is a new project under active development. Feedback and contributions are welcome.
Ciris is a configuration as code library for compile-time safe configurations. For the configuration values which cannot reside in code, Ciris helps you to load and decode values from various sources, while dealing with effects and errors. Validation is encoded by using appropriate data types, with integrations to libraries such as enumeratum, refined, spire, and squants.
Ciris is an alternative to configuration files in situations where it's easy to change and deploy software. Ciris aims to make it easy, safe, and secure to work with configurations, by eliminating many common configuration errors, by preventing errors from occurring as early as possible, and by loading secret configuration values directly from vault services.
For a more detailed introduction, please refer to the usage guide.
println( s""" |```scala |val cirisVersion = "$latestVersion" | |libraryDependencies ++= Seq( | "$organization" %% "$catsModuleName", | "$organization" %% "$catsEffectModuleName", | "$organization" %% "$coreModuleName", | "$organization" %% "$enumeratumModuleName", | "$organization" %% "$genericModuleName", | "$organization" %% "$refinedModuleName", | "$organization" %% "$spireModuleName", | "$organization" %% "$squantsModuleName" |).map(_ % cirisVersion) |``` """.stripMargin.trim )
Libraries are published for Scala 2.12 and 2.13, and Java 8 where possible. For changes between versions, please see the release notes.
Refer to the table below for platform and version support across modules.
||cats 2.0.0-RC2||✓ 2.12, 2.13|
||cats-effect 2.0.0-RC1||✓ 2.12, 2.13|
||𐄂||✓ 2.12, 2.13|
||enumeratum 1.5.13||✓ 2.12, 2.13|
||shapeless 2.3.3||✓ 2.12, 2.13|
||refined 0.9.9||✓ 2.12, 2.13|
||spire 0.17.0-M1||✓ 2.12, 2.13|
||squants 1.4.0||✓ 2.12|
Backwards binary compatibility for the library is guaranteed between patch versions. For example,
0.13.x is backwards binary compatible with
0.13.y for any
x > y. More recent patch versions are drop-in replacements for earlier patch versions.
ciris-catsmodule provides type classes and type class instances from cats.
ciris-cats-effectmodule provides effect type classes from cats-effect.
ciris-enumeratummodule allows loading enumeratum enumerations.
ciris-genericmodule allows loading more types with shapeless.
ciris-refinedmodule allows loading refined refinement types.
ciris-spiremodule allows loading spire number types.
ciris-squantsmodule allows loading squants data types.
scalacOptions += "-Ypartial-unification"
To start an Ammonite REPL with Ciris loaded and imported, simply run the following.
curl -Ls try.cir.is | sh
You will need to have a JDK installed. The script will then:
- download and install the latest available version of coursier,
- use coursier to fetch Ammonite and the latest Ciris version,
- start an Ammonite REPL with Ciris already imported.
To use Typelevel Scala with literal types enabled, instead use the following.
curl -Ls try.cir.is/typelevel | sh
If you already have the Ammonite REPL installed, you can load Ciris using the following commands.
println( s""" |```scala |import $$ivy.`$organization::$catsModuleName:$latestVersion`, ciris.cats._ |import $$ivy.`$organization::$catsEffectModuleName:$latestVersion`, ciris.cats.effect._, ciris.cats.effect.syntax._ |import $$ivy.`$organization::$coreModuleName:$latestVersion`, ciris._ |import $$ivy.`$organization::$enumeratumModuleName:$latestVersion`, ciris.enumeratum._ |import $$ivy.`$organization::$genericModuleName:$latestVersion`, ciris.generic._ |import $$ivy.`$organization::$refinedModuleName:$latestVersion`, ciris.refined._, ciris.refined.syntax._ |import $$ivy.`$organization::$spireModuleName:$latestVersion`, ciris.spire._ |import $$ivy.`$organization::$squantsModuleName:$latestVersion`, ciris.squants._ |``` """.stripMargin.trim )
Below is an incomplete list of third-party libraries that integrate with Ciris. If your library is not included in the list, then please open a pull request.
For an overview, with examples and explanations of the most common use cases, please refer to the usage guide. If you're looking for a more detailed code-centric overview, you can instead take a look at the API documentation. There is also a small example application available to exemplify how to use the library in an application context.
Ciris embraces pure, typeful, idiomatic functional programming in Scala, and wants to provide a safe and friendly environment for teaching, learning, and contributing as described in the Scala Code of Conduct. It is expected that participants follow the code of conduct in all official channels, including on GitHub and in the Gitter chat room.
If you would like to be involved in building Ciris, check out the contributing guide.