Module

cli.commands.config

Config management commands.

Provides introspection and management commands for Bengal configuration:

  • show: Display merged config
  • doctor: Validate and lint config
  • diff: Compare configurations
  • init: Scaffold config structure

Functions

config_cli
⚙️ Configuration management and introspection. Commands: show Display merged configuratio…
0 None
def config_cli() -> None

⚙️ Configuration management and introspection.

Commands:

show     Display merged configuration
doctor   Validate and lint configuration
diff     Compare configurations
init     Initialize config structure
show
📋 Display merged configuration. Shows the effective configuration after merging defaults, environm…
6 None
def show(environment: str | None, profile: str | None, origin: bool, section: str | None, format: str, source: str) -> None

📋 Display merged configuration.

Shows the effective configuration after merging defaults, environment, and profile settings.

Use --origin to see which file contributed each config key, useful for debugging configuration issues.

Parameters 6

Name Type Default Description
environment str | None
profile str | None
origin bool
section str | None
format str
source str
doctor
🩺 Validate and lint configuration. Checks for: - Valid YAML syntax - Type errors (bool, int, str) …
2 None
def doctor(environment: str | None, source: str) -> None

🩺 Validate and lint configuration.

Checks for:

  • Valid YAML syntax
  • Type errors (bool, int, str)
  • Unknown keys (typo detection)
  • Required fields
  • Value ranges
  • Deprecated keys

Run this before deploying to catch configuration errors early. Exits with non-zero code if errors are found (useful for CI/CD).

Parameters 2

Name Type Default Description
environment str | None
source str
diff
🔍 Compare configurations. Shows differences between two configurations (environments, profiles, or…
3 None
def diff(against: str, environment: str | None, source: str) -> None

🔍 Compare configurations.

Shows differences between two configurations (environments, profiles, or files). Useful for verifying that production settings differ correctly from local/preview.

Parameters 3

Name Type Default Description
against str
environment str | None
source str
_compute_diff
Recursively compute diff between two configs.
3 list[dict[str, Any]]
def _compute_diff(config1: dict[str, Any], config2: dict[str, Any], path: list[str]) -> list[dict[str, Any]]

Recursively compute diff between two configs.

Parameters 3

Name Type Default Description
config1 dict[str, Any]
config2 dict[str, Any]
path list[str]

Returns

list[dict[str, Any]]

init
✨ Initialize configuration structure. Creates config directory with examples, or a single config f…
4 None
def init(init_type: str, template: str, force: bool, source: str) -> None

✨ Initialize configuration structure.

Creates config directory with examples, or a single config file. Use --template to choose a preset (docs, blog, minimal).

Parameters 4

Name Type Default Description
init_type str
template str
force bool
source str
_create_directory_structure
Create config directory structure.
3 None
def _create_directory_structure(config_dir: Path, template: str, cli: CLIOutput) -> None

Create config directory structure.

Parameters 3

Name Type Default Description
config_dir Path
template str
cli CLIOutput
_create_single_file
Create single bengal.yaml file.
3 None
def _create_single_file(root_path: Path, template: str, cli: CLIOutput) -> None

Create single bengal.yaml file.

Parameters 3

Name Type Default Description
root_path Path
template str
cli CLIOutput