use std::path::PathBuf; use anyhow::{Result, bail}; use clap::{Parser, Subcommand}; #[derive(Parser)] #[command(name = "hive-c0re", about = "hyperhive coordinator daemon and CLI")] struct Cli { #[command(subcommand)] cmd: Cmd, } #[derive(Subcommand)] enum Cmd { /// Run the coordinator daemon. Serve { /// Flake reference for the agent base template. #[arg(long, default_value = "/etc/hyperhive#agent-base")] agent_flake: String, /// Path to the host admin socket. #[arg(long, default_value = "/run/hyperhive/host.sock")] socket: PathBuf, }, /// Spawn a new agent container (creates `hive-agent-`). Spawn { name: String }, /// Stop a managed container (graceful). Kill { name: String }, /// Apply pending config to a managed container. Rebuild { name: String }, /// List managed containers. List, } fn main() -> Result<()> { tracing_subscriber::fmt() .with_env_filter( tracing_subscriber::EnvFilter::try_from_default_env() .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")), ) .init(); let cli = Cli::parse(); match cli.cmd { Cmd::Serve { agent_flake, socket, } => { tracing::info!(?socket, %agent_flake, "serve: not yet implemented"); bail!("serve not yet implemented"); } Cmd::Spawn { name } => { tracing::info!(%name, "spawn: not yet implemented"); bail!("spawn not yet implemented"); } Cmd::Kill { name } => { tracing::info!(%name, "kill: not yet implemented"); bail!("kill not yet implemented"); } Cmd::Rebuild { name } => { tracing::info!(%name, "rebuild: not yet implemented"); bail!("rebuild not yet implemented"); } Cmd::List => { tracing::info!("list: not yet implemented"); bail!("list not yet implemented"); } } }