Back to directory
zio avatar

zio-config

Easily use and document any config from anywhere in ZIO apps. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/zio/zio-config.git

244

Stars

117

Forks

13

Watchers

Apache-2.0

License

ZIO Config

ZIO Config is a ZIO-based library and act as an extension to core library ZIO's Config language.

Production Ready CI Badge Sonatype Releases Sonatype Snapshots javadoc ZIO Config

Let's enumerate some key features of this library:

  • Support for Various Sources — It can read flat or nested configurations from HOCON, JSON, YAML, TOML, XML, maps, and more. Thanks to IndexedFlat.
  • Automatic Document Generation — It can auto-generate documentation of configurations.
  • Automatic Derivation — It has built-in support for automatic derivation of readers and writers for case classes and sealed traits.
  • Type-level Constraints and Automatic Validation — because it supports Refined types, we can write type-level predicates which constrain the set of values described for data types.
  • Descriptive Errors — It accumulates all errors and reports all of them to the user rather than failing fast.
  • Integrations — Integrations with a variety of libraries

If you are only interested in automatic derivation of configuration, find the details here

Installation

In order to use this library, we need to add the following line in our build.sbt file:

libraryDependencies += "dev.zio" %% "zio-config" % "<version>" 

Sources

Add the modules you need for your config sources:

// HOCON / JSON
libraryDependencies += "dev.zio" %% "zio-config-typesafe" % "<version>"

// YAML
libraryDependencies += "dev.zio" %% "zio-config-yaml" % "<version>"

// TOML
libraryDependencies += "dev.zio" %% "zio-config-toml" % "<version>"

// XML (experimental)
libraryDependencies += "dev.zio" %% "zio-config-xml" % "<version>"

See Read from various Sources for examples of each.

Quick Start

Let's add these four lines to our build.sbt file as we are using these modules in our examples:

libraryDependencies += "dev.zio" %% "zio-config"          % "<version>"
libraryDependencies += "dev.zio" %% "zio-config-magnolia" % "<version>"
libraryDependencies += "dev.zio" %% "zio-config-typesafe" % "<version>"
libraryDependencies += "dev.zio" %% "zio-config-refined"  % "<version>"

There are many examples in here

Documentation

Learn more on the ZIO Config homepage!

Contributing

For the general guidelines, see ZIO contributor's guide.

Code of Conduct

See the Code of Conduct

Support

Come chat with us on Badge-Discord.

License

License

Releases

Jul 17, 2026

Download .zip

What's Changed

Add support for TOML, and support for nix users (#1716) @afsalthaj

Mar 18, 2026

Download .zip

What's Changed

Update scalafmt-core to 3.10.2 by @zio-scala-steward[bot] in #1626 Update zio, zio-streams, zio-test, ... to 2.1.23 by @zio-scala-steward[bot] in #1627 Update mdoc, sbt-mdoc to 2.8.1 b...

Nov 25, 2025

Download .zip

What's Changed

Update zio-sbt-website to 0.4.4 (#1625) @zio-scala-steward[bot] Update mdoc, sbt-mdoc to 2.8.0 (#1609) @zio-scala-steward[bot] Update scala-collection-compat to 2.14.0 (#1606) @zio-sca...

Sep 12, 2025

Download .zip

What's Changed

Update sbt-mdoc to 2.7.2 (#1597) @zio-scala-steward[bot] Update sbt-header to 5.11.0 (#1596) @zio-scala-steward[bot] Update sbt-ci-release to 1.11.2 (#1595) @zio-scala-steward[bot] Upd...

Mar 15, 2025

Download .zip

What's Changed

feat: publish dotty version for cross builds by @mhriemers in #1497 Table.toGithubFlavouredMarkdown: link to section heading anchors by @igneus in #1543

New Contributors

@mhriemers m...