MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / config_validate

Function config_validate

codewiki/cli/commands/config.py:476–694  ·  view source on GitHub ↗

Validate configuration and test LLM API connectivity. Checks: • Configuration file exists and is valid • API key is present • API settings are correctly formatted • (Optional) API connectivity test Examples: \b # Full validation with API te

(quick: bool, verbose: bool)

Source from the content-addressed store, hash-verified

474 click.echo()
475 click.secho("Agent Instructions", fg="cyan", bold=True)
476 if config and config.agent_instructions and not config.agent_instructions.is_empty():
477 agent = config.agent_instructions
478 if agent.include_patterns:
479 click.echo(f" Include patterns: {', '.join(agent.include_patterns)}")
480 if agent.exclude_patterns:
481 click.echo(f" Exclude patterns: {', '.join(agent.exclude_patterns)}")
482 if agent.focus_modules:
483 click.echo(f" Focus modules: {', '.join(agent.focus_modules)}")
484 if agent.doc_type:
485 click.echo(f" Doc type: {agent.doc_type}")
486 if agent.custom_instructions:
487 click.echo(f" Custom instructions: {agent.custom_instructions[:50]}...")
488 else:
489 click.secho(" Using defaults (no custom settings)", fg="yellow")
490
491 click.echo()
492 click.echo(f"Configuration file: {manager.config_file_path}")
493 click.echo()
494
495 except Exception as e:
496 sys.exit(handle_error(e))
497
498
499@config_group.command(name="validate")
500@click.option(
501 "--quick",
502 is_flag=True,
503 help="Skip API connectivity test"
504)
505@click.option(
506 "--verbose",
507 "-v",
508 is_flag=True,
509 help="Show detailed validation steps"
510)
511def config_validate(quick: bool, verbose: bool):
512 """
513 Validate configuration and test LLM API connectivity.
514
515 Checks:
516 • Configuration file exists and is valid
517 • API key is present
518 • API settings are correctly formatted
519 • (Optional) API connectivity test
520
521 Examples:
522
523 \b
524 # Full validation with API test
525 $ codewiki config validate
526
527 \b
528 # Quick validation (config only)
529 $ codewiki config validate --quick
530
531 \b
532 # Verbose output
533 $ codewiki config validate --verbose

Callers

nothing calls this directly

Calls 8

loadMethod · 0.95
get_configMethod · 0.95
get_api_keyMethod · 0.95
ConfigManagerClass · 0.90
is_caw_providerFunction · 0.90
validate_urlFunction · 0.90
is_top_tier_modelFunction · 0.90
handle_errorFunction · 0.90

Tested by

no test coverage detected