Dynamic Config Modding

Viash can modify a viash config at runtime using a custom Domain Specific Language (DSL). This allows making dynamic changes to your components or packages.
All Viash subcommands have support for the DSL through the -c|--config_mod parameter. The format for these is as follows:

viash COMMAND -c '.SECTION.PROPERTY := VALUE'

Multiple config mods can be added by adding more -c|--config_mod parameters:

viash COMMAND \
  -c '.SECTION.PROPERTY := VALUE' \
  -c '.SECTION.PROPERTY := VALUE'

Examples

Change the version of a component:

viash build -c '.version := "0.3.0"'

Change the registry of a docker container:

viash build -c \
  '.engines[.type == "docker"].registry := "url-to-registry"'

Add an author to the list:

viash build -c '.authors += { name: "Mr. T", role: "sponsor" }'

You can use dynamic config modding to alter the config of multiple components at once:

viash ns build \
  -c '.version := "0.3.0"' \
  -c '.engines[.type == "docker"].registry := "url-to-registry"' \
  -c '.authors += { name: "Mr. T", role: "sponsor" }'