use std::net::SocketAddr;
use std::path::PathBuf;
use anyhow::Context;
use clap::Args;
use design::DesignOptions;
use crate::DEFAULT_CONFIG;
#[derive(Debug, Args)]
pub(crate) struct DesignArgs {
#[arg(short, long, env = "FLUSSO_CONFIG", default_value = DEFAULT_CONFIG)]
config: PathBuf,
#[arg(long, env = "FLUSSO_DESIGN_ADDRESS", default_value = "127.0.0.1:7700")]
address: SocketAddr,
#[arg(long, env = "FLUSSO_DESIGN_NO_OPEN")]
no_open: bool,
}
pub(crate) async fn execute(args: DesignArgs) -> anyhow::Result<()> {
let _tracing = crate::telemetry::init_tracing();
design::serve(DesignOptions {
config_path: args.config,
address: args.address,
open_browser: !args.no_open,
})
.await
.context("running the designer")
}