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)
| 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 | ) |
| 511 | def 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 |
nothing calls this directly
no test coverage detected