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 projects.
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 '.functionality.version := "0.3.0"'

Change the registry of a docker container:

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

Add an author to the list:

viash build -c '.functionality.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 '.functionality.version := "0.3.0"' \
  -c '.platforms[.type == "docker"].container_registry := "url-to-registry"' \
  -c '.functionality.authors += { name: "Mr. T", role: "sponsor" }'