Skip to main content
Version: 1.1

Selecting multiple configs from a Config Group

ย Example


In some scenarios, one may need to select multiple configs from the same Config Group.


Use a list of config names as the value of the config group in the Defaults List or in the command line.


In this example, we configure a server. The server can host multiple websites at the same time.

Config directory
โ”œโ”€โ”€ config.yamlโ””โ”€โ”€ server    โ”œโ”€โ”€ apache.yaml    โ””โ”€โ”€ site        โ”œโ”€โ”€ amazon.yaml        โ”œโ”€โ”€ fb.yaml        โ””โ”€โ”€ google.yaml
defaults:  - server/apache

defaults:  - site:    - fb    - google
host: localhostport: 443
amazon:  domain:
fb:  domain:
google:  domain:


$ python
server:  site:    fb:      domain:    google:      domain:  host: localhost  port: 443

Override the selected sites from the command line by passing a list. e.g:

$ python 'server/site=[google,amazon]'
server:  site:    google:      domain:    amazon:      domain:  host: localhost  port: 443

Overriding packages#

You can relocate the package of all the configs in the list. e.g:

defaults:  - [email protected]:    - fb    - google

$ python
server:  https:    fb:      domain:    google:      domain:

When overriding the selected configs of config groups with overridden packages you need to use the package. e.g:

$ python server/[email protected]=amazon
server:  https:    amazon:      domain:  host: localhost  port: 443

Implementation considerations#

A nested list in the Defaults List is interpreted as a list of non-overridable configs:

defaults:  - site:    - fb    - google
Equivalent to
defaults:  - site/fb  - site/google

All default package for all the configs in server/site is This example uses an explicit nesting level inside each of the website configs to prevent them stepping over one another:

amazon:  ...