Skip to content

Options

rn_forge.cli.options

Standard CLI options and value parsers.

CliOptions(quiet=False, json_output=False, dry_run=False, yes=False) dataclass

Resolved standard flags stored on the root ctx.obj.

apply(ctx)

Validate this combination, set the console mode, and persist onto ctx.

Returns:

Type Description
Self

self, so the call chains off :meth:from_context.

Raises:

Type Description
BadParameter

Both --quiet and --json are set, from either level.

from_context(ctx, *, quiet=False, json_output=False, dry_run=False, yes=False) classmethod

Return the options for this command: the root callback's, merged with these.

A flag set on either the root callback or the command is retained.

Pure — nothing is written to ctx and no console mode is changed. Chain :meth:apply for that.

LogLevel

Bases: StrEnum

CLI-facing log level names. Values are lowercase for clean --help output.

to_int()

Return the matching :class:~rn_forge.commons.logging.AppLogger level constant.

parse_overrides(values)

Parse ["a.b=1", "c=[1,2]"] into a nested mapping with typed scalars.

Values are parsed as JSON, then as TOML scalars, and otherwise retained as strings. Dotted keys create nested mappings.

Raises:

Type Description
BadParameter

An entry has no =, an empty key, or a dotted path that collides with a scalar set by an earlier entry.