hive-c0re: cli scaffolding (stubs)
This commit is contained in:
parent
a63e9bdbfc
commit
a24dc14213
3 changed files with 87 additions and 2 deletions
|
|
@ -1,3 +1,68 @@
|
|||
fn main() {
|
||||
println!("hive-c0re placeholder");
|
||||
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-<name>`).
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue