MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / show_config

Function show_config

src/cli.py:565–608  ·  view source on GitHub ↗

Show current configuration.

()

Source from the content-addressed store, hash-verified

563
564
565def show_config():
566 """Show current configuration."""
567 console = Console()
568
569 try:
570 from src.config import load_config, get_config_path
571
572 config = load_config()
573 config_path = get_config_path()
574
575 console.print(f"\n[bold]Configuration File:[/bold] {config_path}\n")
576 console.print("[bold]Current Configuration:[/bold]\n")
577
578 console.print(f"[cyan]Default Provider:[/cyan] {config.get('default_provider', 'Not set')}")
579
580 console.print("\n[cyan]Configured Providers:[/cyan]")
581 for provider_name, provider_config in config.get("providers", {}).items():
582 api_key = provider_config.get("api_key", "")
583 masked_key = f"{api_key[:8]}...{api_key[-4:]}" if len(api_key) > 12 else "Not set"
584
585 console.print(f"\n [yellow]{provider_name.upper()}:[/yellow]")
586 console.print(f" API Key: {masked_key}")
587 console.print(f" Base URL: {provider_config.get('base_url', 'Not set')}")
588 console.print(f" Default Model: {provider_config.get('default_model', 'Not set')}")
589
590 # Stored API keys (config "env" block, e.g. TAVILY_API_KEY). Values are
591 # masked — only the name and a hint are shown.
592 from src.secret_store import get_secret, list_secret_names
593
594 stored_names = list_secret_names()
595 if stored_names:
596 console.print("\n[cyan]Stored Keys (env):[/cyan]")
597 for name in stored_names:
598 value = get_secret(name) or ""
599 masked = f"{value[:4]}...{value[-4:]}" if len(value) > 10 else "Set"
600 console.print(f" {name}: {masked}")
601
602 console.print()
603
604 except Exception as e:
605 console.print(f"\n[red]Error loading configuration: {e}[/red]\n")
606 return 1
607
608 return 0
609
610
611if __name__ == '__main__':

Callers 1

mainFunction · 0.85

Calls 6

load_configFunction · 0.90
get_config_pathFunction · 0.90
list_secret_namesFunction · 0.90
get_secretFunction · 0.90
itemsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected