package link.socket.ampere

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.subcommands

/**
 * Parent command for headless automated tests.
 *
 * This command provides a unified entry point for running headless validation
 * tests of AMPERE's capabilities. These tests are intended for CI/CD pipelines
 * and automated validation, not interactive use.
 *
 * For interactive use with visual feedback, run `ampere` directly.
 *
 * Available tests:
 * - agent: Autonomous agent test (CodeWriterAgent + PROPEL cognitive cycle) - headless
 * - ticket: Issue creation test (GitHub issue management) - headless
 *
 * Usage:
 *   ampere test <test-name>
 *
 * Examples:
 *   ampere test agent     # Run autonomous agent test headlessly (for CI/validation)
 *   ampere test ticket    # Run Ticket Creation Test headlessly
 */
class TestCommand : CliktCommand(
    name = "test",
    help = """
        Run headless automated tests for validation.

        This command runs tests in headless mode without interactive UI,
        suitable for CI/CD pipelines and automated validation.

        For interactive use with the TUI dashboard, run:
          ampere

        Available tests:
          agent     Headless autonomous agent test (PROPEL cognitive cycle)
          ticket    Headless GitHub issue creation test

        These tests validate AMPERE functionality and are designed for
        automated environments, not interactive exploration.

        Examples:
          ampere test agent             # Headless agent test (CI/validation)
          ampere test ticket            # Headless issue test
          ampere test agent --help      # Show test options

    """.trimIndent()
) {
    init {
        subcommands(
            AgentSubcommand(),
            TicketSubcommand()
        )
    }

    override fun run() {
        // Parent command doesn't do anything on its own
        // User must specify a subcommand (agent or ticket)
    }
}
