//! Optional `gh` wrapper, capability-detected. Absence degrades gracefully.

use std::process::Command;
use std::sync::OnceLock;

static AVAILABLE: OnceLock<bool> = OnceLock::new();

pub fn available() -> bool {
    *AVAILABLE.get_or_init(|| {
        Command::new("gh")
            .arg("--version")
            .output()
            .map(|o| o.status.success())
            .unwrap_or(false)
    })
}
