Skip to content

CLI

CLI for koality.

cli(ctx, config_path)

CLI for koality. Besides config_path and project_id, additional arguments can be provided that will overrule the global default configuration.

Parameters:

Name Type Description Default
ctx

Context of command line invocation (contains extra args)

required
config_path Path

Path to koality configuration file

required
Source code in src/koality/cli.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@click.command(context_settings={"ignore_unknown_options": True, "allow_extra_args": True})
@click.option("--config_path", required=True, type=click.Path(exists=True, dir_okay=False))
@click.pass_context
def cli(ctx, config_path: Path) -> None:
    """
    CLI for koality. Besides config_path and project_id, additional arguments
    can be provided that will overrule the global default configuration.

    Args:
        ctx: Context of command line invocation (contains extra args)
        config_path: Path to koality configuration file
    """
    kwargs = {ctx.args[i].lstrip("-"): ctx.args[i + 1] for i in range(0, len(ctx.args), 2)}

    for key, val in kwargs.items():
        kwargs[key] = parse_arg(val)

    config = parse_yaml_raw_as(Config, Path(config_path).read_text())

    check_executor = CheckExecutor(config=config, **kwargs)
    _ = check_executor()