//! Arguments for `mcptest inspect`.

use clap::Args;

/// Connect to an MCP server and drop into an interactive REPL.
///
/// Target the server either over streamable HTTP with `--url`, or over stdio
/// by passing the server command after the flags:
///
/// ```text
/// mcptest inspect --url https://example.test/mcp
/// mcptest inspect -- npx -y @modelcontextprotocol/server-everything
/// ```
///
/// Exactly one of the two forms must be given. The REPL reads commands from
/// stdin (`help` lists them), so it also accepts a piped script for scripted
/// exploration in CI.
#[derive(Debug, Args)]
pub struct InspectCliArgs {
    /// Streamable HTTP URL of the MCP server. Mutually exclusive with a
    /// trailing stdio command.
    #[arg(long, value_name = "URL")]
    pub url: Option<String>,

    /// Read a bearer token from this env var and send it as
    /// `Authorization: Bearer <value>` on the HTTP target.
    #[arg(long = "bearer-token-env", value_name = "NAME")]
    pub bearer_token_env: Option<String>,

    /// Stdio server command and its arguments, used when `--url` is absent.
    /// Everything after the flags is the command, e.g.
    /// `mcptest inspect -- ./my-server --flag`.
    #[arg(
        trailing_var_arg = true,
        allow_hyphen_values = true,
        value_name = "COMMAND"
    )]
    pub command: Vec<String>,
}
