diff --git a/lib/crates/fabro-cli/src/commands/create.rs b/lib/crates/fabro-cli/src/commands/create.rs index a226f2c0e..d9611dd91 100644 --- a/lib/crates/fabro-cli/src/commands/create.rs +++ b/lib/crates/fabro-cli/src/commands/create.rs @@ -14,13 +14,14 @@ pub async fn create_run( args: &RunArgs, run_defaults: RunDefaults, styles: &Styles, + quiet: bool, ) -> anyhow::Result<(String, PathBuf)> { let workflow_path = args .workflow .as_ref() .ok_or_else(|| anyhow::anyhow!("--workflow is required"))?; - let prep = prepare_workflow(args, run_defaults, styles)?; + let prep = prepare_workflow(args, run_defaults, styles, quiet)?; let goal = prep.graph.goal(); diff --git a/lib/crates/fabro-cli/src/commands/run.rs b/lib/crates/fabro-cli/src/commands/run.rs index cd53fb4dd..7faa494bf 100644 --- a/lib/crates/fabro-cli/src/commands/run.rs +++ b/lib/crates/fabro-cli/src/commands/run.rs @@ -463,6 +463,7 @@ pub(crate) fn prepare_workflow( args: &RunArgs, mut run_defaults: RunDefaults, styles: &Styles, + quiet: bool, ) -> anyhow::Result { let workflow_path = args .workflow @@ -528,30 +529,32 @@ pub(crate) fn prepare_workflow( } } - eprintln!( - "{} {} {}", - styles.bold.apply_to("Workflow:"), - graph.name, - styles.dim.apply_to(format!( - "({} nodes, {} edges)", - graph.nodes.len(), - graph.edges.len() - )), - ); - eprintln!( - "{} {}", - styles.dim.apply_to("Graph:"), - styles.dim.apply_to(relative_path(&dot_path)), - ); + if !quiet { + eprintln!( + "{} {} {}", + styles.bold.apply_to("Workflow:"), + graph.name, + styles.dim.apply_to(format!( + "({} nodes, {} edges)", + graph.nodes.len(), + graph.edges.len() + )), + ); + eprintln!( + "{} {}", + styles.dim.apply_to("Graph:"), + styles.dim.apply_to(relative_path(&dot_path)), + ); - let goal = graph.goal(); - if !goal.is_empty() { - let stripped = fabro_util::text::strip_goal_decoration(goal); - eprintln!("{} {stripped}\n", styles.bold.apply_to("Goal:")); + let goal = graph.goal(); + if !goal.is_empty() { + let stripped = fabro_util::text::strip_goal_decoration(goal); + eprintln!("{} {stripped}\n", styles.bold.apply_to("Goal:")); + } + + print_diagnostics(&diagnostics, styles); } - print_diagnostics(&diagnostics, styles); - if diagnostics.iter().any(|d| d.severity == Severity::Error) { bail!("Validation failed"); } @@ -612,7 +615,7 @@ pub async fn run_command( model, provider, run_defaults, - } = prepare_workflow(&args, run_defaults, styles)?; + } = prepare_workflow(&args, run_defaults, styles, false)?; // Extract workflow slug from the workflow path argument. // If bare name (no extension, e.g. "smoke"), use it directly. diff --git a/lib/crates/fabro-cli/src/main.rs b/lib/crates/fabro-cli/src/main.rs index 7a97ddf4f..a1f13478c 100644 --- a/lib/crates/fabro-cli/src/main.rs +++ b/lib/crates/fabro-cli/src/main.rs @@ -653,7 +653,7 @@ async fn main_inner() -> (String, Result<()>) { if args.detach { // Detach mode: create + start + print run ID let (run_id, run_dir) = - commands::create::create_run(&args, cli_config.run_defaults, styles) + commands::create::create_run(&args, cli_config.run_defaults, styles, true) .await?; commands::start::start_run(&run_dir)?; println!("{run_id}"); @@ -683,7 +683,8 @@ async fn main_inner() -> (String, Result<()>) { Box::leak(Box::new(fabro_util::terminal::Styles::detect_stderr())); let cli_config = cli_config::load_cli_config(None)?; let (run_id, _run_dir) = - commands::create::create_run(&args, cli_config.run_defaults, styles).await?; + commands::create::create_run(&args, cli_config.run_defaults, styles, true) + .await?; println!("{run_id}"); } Command::Start { run } => {