@app.command(name="list")
def config_list() -> None:
"""Show current configuration."""
from ccproxy.cli._settings_help import print_settings_help
toolkit = get_rich_toolkit()
try:
container = _get_service_container()
settings = container.get_service(Settings)
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
console = Console()
# Display header panel
console.print(
Panel.fit(
f"[bold]CCProxy API Configuration[/bold]\n[dim]Version: {__version__}[/dim]",
border_style="blue",
)
)
# Use generic settings display
print_settings_help(Settings, settings)
# Display footer panel
info_text = Text()
info_text.append("Configuration loaded from: ", style="bold")
info_text.append(
"environment variables, .env file, and TOML configuration files",
style="dim",
)
console.print(
Panel(info_text, title="Configuration Sources", border_style="green")
)
except (OSError, PermissionError) as e:
logger.error("config_list_file_access_error", error=str(e), exc_info=e)
toolkit.print(f"Error accessing configuration files: {e}", tag="error")
raise typer.Exit(1) from e
except (json.JSONDecodeError, ValueError) as e:
logger.error("config_list_parsing_error", error=str(e), exc_info=e)
toolkit.print(f"Configuration parsing error: {e}", tag="error")
raise typer.Exit(1) from e
except ImportError as e:
logger.error("config_list_import_error", error=str(e), exc_info=e)
toolkit.print(f"Module import error: {e}", tag="error")
raise typer.Exit(1) from e
except Exception as e:
logger.error("config_list_unexpected_error", error=str(e), exc_info=e)
toolkit.print(f"Error loading configuration: {e}", tag="error")
raise typer.Exit(1) from e