viash config view

View the viash config file after parsing.

Usage:

viash config view config.vsh.yaml

Arguments

–config

A Viash config file (example: config.vsh.yaml). This argument can also be a script with the config as a header.

-c, --config_mod

Modify a viash config at runtime using a custom DSL.

-f, --format

Which output format to use. Choices: yaml, json

-p, --platform

Specifies which platform amongst those specified in the viash config to use. If this is not provided, the first platform will be used. If no platforms are defined in the viash config, the native platform will be used. In addition, the path to a platform yaml file can also be specified.

-h, --help

Show help message

Examples

The config view command prints a parsed version of a config file to the terminal. This includes all fields, even those that were not given values in the config file itself:

viash config view config.vsh.yaml

For the hello_world example config file, this prints out the following:

functionality:
  name: "hello_world"
  authors: []
  arguments:
  - type: "string"
    name: "input"
    alternatives: []
    required: false
    direction: "Input"
    multiple: true
    multiple_sep: " "
  - type: "string"
    name: "--greeter"
    alternatives: []
    default: "Hello world!"
    required: false
    direction: "Input"
    multiple: false
    multiple_sep: ":"
  resources:
  - type: "bash_script"
    path: "script.sh"
    is_executable: true
    parent: "file:///home/user/hello_world/config.vsh.yaml"
  description: "A very simple 'Hello world' component."
  tests:
  - type: "bash_script"
    path: "test.sh"
    is_executable: true
    parent: "file:///home/user/hello_world/config.vsh.yaml"
  info: {}
platforms:
- type: "native"
  id: "native"
  setup: []
- type: "docker"
  id: "docker"
  image: "bash:4.0"
  namespace_separator: "_"
  resolve_volume: "Automatic"
  chown: true
  setup_strategy: "alwayscachedbuild"
  push_strategy: "pushifnotpresent"
  privileged: false
  setup: []
- type: "docker"
  id: "alpine"
  image: "alpine"
  namespace_separator: "_"
  resolve_volume: "Automatic"
  chown: true
  setup_strategy: "alwayscachedbuild"
  push_strategy: "pushifnotpresent"
  privileged: false
  setup:
  - type: "apk"
    packages:
    - "bash"

Override a config with config mods

Prints out what a parsed Viash component config would look like while using a config mod to override the config file.

viash config view config.vsh.yaml \
-c '.platforms[.type == "docker"].setup_strategy := "pull"' \
-c '.platforms[.type == "docker"].image := "bash:latest"'

See also