Module

utils.rich_console

Rich console wrapper with profile-aware output.

Provides a singleton console instance that respects:

  • Build profiles (Writer/Theme-Dev/Developer)
  • Terminal capabilities
  • CI/CD environments

Functions

get_console
Get singleton rich console instance.
0 Console
def get_console() -> Console

Get singleton rich console instance.

Returns

Console

Configured Console instance

should_use_rich
Determine if we should use rich features.
0 bool
def should_use_rich() -> bool

Determine if we should use rich features.

Returns

bool

True if rich features should be enabled

detect_environment
Detect terminal and environment capabilities.
0 dict[str, bool | st…
def detect_environment() -> dict[str, bool | str | int | None]

Detect terminal and environment capabilities.

Returns

dict[str, bool | str | int | None]

Dictionary with environment info

reset_console
Reset the console singleton (mainly for testing).
0 None
def reset_console() -> None

Reset the console singleton (mainly for testing).

is_live_display_active
Check if a Live display is currently active on the console. This function accesses the private `_l…
0 bool
def is_live_display_active() -> bool

Check if a Live display is currently active on the console.

This function accesses the private_liveattribute usinggetattr() to safely handle cases where it might not exist, with a fallback that assumes no Live display is active if an exception occurs.

Returns

bool

True if a Live display is currently active, False otherwise