1use lean_ctx::core::editor_registry::{WriteAction, WriteOptions};
3use lean_ctx::core::portable_binary::resolve_agent_binary;
4use lean_ctx_hooks::hooks::{HookMode, recommend_hook_mode};
5
6use super::first_run::{first_run_setup_level, persist_setup_choice};
7use super::helpers::{
8 configure_plan_mode_settings, configure_premium_features, configure_tool_profile, shorten_path,
9};
10use super::index_build::spawn_index_build_background;
11use super::options::SetupOptions;
12use super::with_options::run_setup_with_options;
13
14pub fn run_setup() {
15 run_setup_with_agents(None);
16}
17
18fn choose_agents(
22 home: &std::path::Path,
23 targets: &[lean_ctx::core::editor_registry::EditorTarget],
24 explicit: Option<std::collections::BTreeSet<String>>,
25) -> std::collections::BTreeSet<String> {
26 use super::agent_selection as sel;
27
28 let detected = sel::detected_agents(home, targets);
29 let selection = match explicit {
30 Some(keys) => keys,
31 None if detected.is_empty() => return std::collections::BTreeSet::new(),
32 None => {
33 let saved = lean_ctx::core::config::Config::load_global().setup.agents;
34 let default = sel::prompt_default(&detected, saved.as_deref());
35 sel::prompt_agent_selection(&detected, &default)
36 }
37 };
38 if let Err(e) = sel::save_selection(&selection) {
39 lean_ctx::terminal_ui::print_status_warn(&e);
40 }
41 selection
42}
43
44pub fn run_setup_with_agents(agents: Option<std::collections::BTreeSet<String>>) {
46 use lean_ctx::terminal_ui;
47
48 if lean_ctx::shell::is_non_interactive() {
49 eprintln!("Non-interactive terminal detected (no TTY on stdin).");
50 eprintln!(
51 "Running in non-interactive mode (equivalent to: lean-ctx setup --non-interactive --yes)"
52 );
53 if agents.is_none() {
54 eprintln!(
55 "Connecting all detected tools (or the recorded choice); use --agents to choose."
56 );
57 }
58 eprintln!();
59 let opts = SetupOptions {
60 non_interactive: true,
61 yes: true,
62 agents,
63 ..Default::default()
64 };
65 match run_setup_with_options(&opts) {
66 Ok(report) => {
67 for w in &report.warnings {
68 tracing::warn!("{w}");
69 }
70 }
71 Err(e) => tracing::error!("Setup error: {e}"),
72 }
73 return;
74 }
75
76 let Some(home) = lean_ctx::core::home::resolve_home_dir() else {
77 tracing::error!("Cannot determine home directory");
78 std::process::exit(1);
79 };
80
81 let binary = resolve_agent_binary();
82
83 let home_str = home.to_string_lossy().to_string();
84
85 terminal_ui::print_setup_header();
86
87 let (inject_rules, inject_skills) = first_run_setup_level();
88 persist_setup_choice(inject_rules, inject_skills);
89
90 let allow_rule_steering =
91 inject_rules && !lean_ctx::core::config::Config::load().declines_rule_steering();
92
93 terminal_ui::print_step_header(1, 14, "Shell Hook");
94 crate::cli::cmd_init(&["--global".to_string()]);
95 lean_ctx::shell_hook::install_all(false);
96
97 terminal_ui::print_step_header(2, 14, "Daemon");
98 if lean_ctx::daemon::is_daemon_running() {
99 terminal_ui::print_status_ok("Daemon running — restarting with current binary…");
100 let _ = lean_ctx::daemon::stop_daemon();
101 std::thread::sleep(std::time::Duration::from_millis(500));
102 if let Err(e) = lean_ctx::daemon::start_daemon(&[]) {
103 terminal_ui::print_status_warn(&format!("Daemon restart failed: {e}"));
104 }
105 } else if let Err(e) = lean_ctx::daemon::start_daemon(&[]) {
106 terminal_ui::print_status_warn(&format!("Daemon start failed: {e}"));
107 }
108
109 terminal_ui::print_step_header(3, 14, "AI Tool Detection");
110
111 let targets = lean_ctx::core::editor_registry::build_targets(&home);
112 let selection = choose_agents(&home, &targets, agents);
113 let allows = |key: &str| selection.contains(key);
114 let mut deselected: Vec<&str> = Vec::new();
115 let update_mcp = lean_ctx::core::config::Config::load()
119 .setup
120 .should_update_mcp();
121 let mut newly_configured: Vec<&str> = Vec::new();
122 let mut already_configured: Vec<&str> = Vec::new();
123 let mut not_installed: Vec<&str> = Vec::new();
124 let mut mcp_skipped: Vec<&str> = Vec::new();
125 let mut errors: Vec<&str> = Vec::new();
126 let mut configured_integration_ids = Vec::new();
127
128 for (host, outcome) in
131 lean_ctx_hooks::hooks::governor_default::apply_for_targets(&home, &targets, &allows)
132 {
133 if outcome.ran_steps() {
134 let _ = super::agent_selection::remember_connected_agent(host.key);
135 }
136 if let Some(notice) = outcome.notice(host) {
137 terminal_ui::print_status_new(¬ice);
138 }
139 }
140
141 for target in &targets {
142 let short_path = shorten_path(&target.config_path.to_string_lossy(), &home_str);
143
144 if !target.detect_path.exists() {
145 not_installed.push(target.name);
146 continue;
147 }
148
149 if !allows(&target.agent_key) {
150 if !deselected.contains(&target.name) {
151 deselected.push(target.name);
152 }
153 continue;
154 }
155
156 if !update_mcp {
157 terminal_ui::print_status_ok(&format!(
158 "{:<20} \x1b[2mMCP registration skipped (auto_update_mcp=false)\x1b[0m",
159 target.name
160 ));
161 mcp_skipped.push(target.name);
162 continue;
163 }
164
165 let mode = lean_ctx_hooks::hooks::governor_default::display_mode(
166 &target.agent_key,
167 &home,
168 if target.agent_key.is_empty() {
169 HookMode::Mcp
170 } else {
171 recommend_hook_mode(&target.agent_key)
172 },
173 );
174
175 match lean_ctx::core::editor_registry::write_config_with_options_and_rule_steering(
176 target,
177 &binary,
178 WriteOptions {
179 overwrite_invalid: false,
180 },
181 allow_rule_steering,
182 ) {
183 Ok(res) if res.action == WriteAction::Already => {
184 terminal_ui::print_status_ok(&format!(
185 "{:<20} \x1b[36m{mode}\x1b[0m \x1b[2m{short_path}\x1b[0m",
186 target.name
187 ));
188 already_configured.push(target.name);
189 configured_integration_ids.push(target.agent_key.clone());
190 }
191 Ok(_) => {
192 terminal_ui::print_status_new(&format!(
193 "{:<20} \x1b[36m{mode}\x1b[0m \x1b[2m{short_path}\x1b[0m",
194 target.name
195 ));
196 newly_configured.push(target.name);
197 configured_integration_ids.push(target.agent_key.clone());
198 }
199 Err(e) => {
200 terminal_ui::print_status_warn(&format!("{}: {e}", target.name));
201 errors.push(target.name);
202 }
203 }
204 }
205
206 let total_ok = newly_configured.len() + already_configured.len();
207 if total_ok == 0 && errors.is_empty() && mcp_skipped.is_empty() && deselected.is_empty() {
208 terminal_ui::print_status_warn(
209 "No AI tools detected. Install one and re-run: lean-ctx setup",
210 );
211 }
212
213 if !deselected.is_empty() {
214 println!(
215 " \x1b[2m○ {} left untouched (not selected): {}\x1b[0m",
216 deselected.len(),
217 deselected.join(", ")
218 );
219 }
220 if !not_installed.is_empty() {
221 println!(
222 " \x1b[2m○ {} not detected: {}\x1b[0m",
223 not_installed.len(),
224 not_installed.join(", ")
225 );
226 }
227
228 configure_plan_mode_settings(&newly_configured, &already_configured);
229
230 terminal_ui::print_step_header(4, 14, "Agent Rules");
231 let rules_result = if inject_rules {
232 let r = lean_ctx::rules_inject::inject_rules_where(&home, &allows);
233 for name in &r.injected {
234 terminal_ui::print_status_new(&format!("{name:<20} \x1b[2mrules injected\x1b[0m"));
235 }
236 for name in &r.updated {
237 terminal_ui::print_status_new(&format!("{name:<20} \x1b[2mrules updated\x1b[0m"));
238 }
239 for name in &r.already {
240 terminal_ui::print_status_ok(&format!("{name:<20} \x1b[2mrules up-to-date\x1b[0m"));
241 }
242 for err in &r.errors {
243 terminal_ui::print_status_warn(err);
244 }
245 if !r.backed_up.is_empty() {
246 for bak in &r.backed_up {
247 println!(" \x1b[2m ↳ backup: {bak}\x1b[0m");
248 }
249 }
250 if r.injected.is_empty()
251 && r.updated.is_empty()
252 && r.already.is_empty()
253 && r.errors.is_empty()
254 {
255 terminal_ui::print_status_skip("No agent rules needed");
256 }
257 r
258 } else {
259 terminal_ui::print_status_skip(
260 "Skipped (run `lean-ctx setup` or set auto_inject_rules = true in config)",
261 );
262 lean_ctx::rules_inject::InjectResult::default()
263 };
264
265 for target in &targets {
266 if !target.detect_path.exists() || target.agent_key.is_empty() || !allows(&target.agent_key)
267 {
268 continue;
269 }
270
271 let mode = recommend_hook_mode(&target.agent_key);
272
273 if allow_rule_steering {
274 lean_ctx_hooks::hooks::install_agent_hook_with_mode(&target.agent_key, true, mode);
275 } else {
276 lean_ctx_hooks::hooks::install_agent_runtime_hook_with_mode(
277 &target.agent_key,
278 true,
279 mode,
280 );
281 }
282 }
283
284 terminal_ui::print_step_header(5, 14, "API Proxy (optional)");
285 {
286 let cfg = lean_ctx::core::config::Config::load();
287 let proxy_port = crate::proxy_setup::default_port();
288
289 match cfg.proxy_enabled {
290 Some(true) => {
291 lean_ctx::proxy_autostart::install(proxy_port, false);
292 std::thread::sleep(std::time::Duration::from_millis(500));
293 crate::proxy_setup::install_proxy_env(&home, proxy_port, false);
294 terminal_ui::print_status_ok("Proxy active (opted in)");
295 }
296 Some(false) => {
297 terminal_ui::print_status_skip(
298 "Proxy disabled (run `lean-ctx proxy enable` to change)",
299 );
300 }
301 None => {
302 println!(
303 " \x1b[2mThe API proxy routes LLM requests through lean-ctx for additional\x1b[0m"
304 );
305 println!(
306 " \x1b[2mtool-result compression and precise token analytics in the dashboard.\x1b[0m"
307 );
308 println!();
309 println!(
310 " \x1b[2mWithout it: MCP tools, shell hooks, gain tracking, and memory\x1b[0m"
311 );
312 println!(
313 " \x1b[2mall work normally. The proxy compresses API traffic on top.\x1b[0m"
314 );
315 println!();
316 print!(" Enable the API proxy? [y/N] ");
317 let _ = std::io::Write::flush(&mut std::io::stdout());
318 let mut input = String::new();
319 let _ = std::io::stdin().read_line(&mut input);
320 let answer = matches!(input.trim().to_lowercase().as_str(), "y" | "yes");
321 if let Err(e) = lean_ctx::core::config::Config::update_global(|c| {
322 c.proxy_enabled = Some(answer);
323 }) {
324 tracing::warn!("could not persist proxy choice: {e}");
325 }
326 if answer {
327 lean_ctx::proxy_autostart::install(proxy_port, false);
328 std::thread::sleep(std::time::Duration::from_millis(500));
329 crate::proxy_setup::install_proxy_env(&home, proxy_port, false);
330 terminal_ui::print_status_new("Proxy enabled");
331 } else {
332 terminal_ui::print_status_skip(
333 "Proxy skipped (run `lean-ctx proxy enable` anytime)",
334 );
335 }
336 }
337 }
338 }
339
340 terminal_ui::print_step_header(6, 14, "IDE Config Access (optional)");
341 {
342 let cfg = lean_ctx::core::config::Config::load();
343 match cfg.allow_ide_config_dirs {
344 Some(true) => {
345 terminal_ui::print_status_ok(
346 "Enabled — the agent can read your editors' config dirs",
347 );
348 }
349 Some(false) => {
350 terminal_ui::print_status_skip(
351 "Off (enable: lean-ctx config set allow_ide_config_dirs true)",
352 );
353 }
354 None => {
355 println!(
356 " \x1b[2mlean-ctx tools are jailed to the current project. Enabling this lets\x1b[0m"
357 );
358 println!(
359 " \x1b[2mthe agent read every supported editor's config dir (~/.cursor, VS Code,\x1b[0m"
360 );
361 println!(
362 " \x1b[2mCline/Roo, JetBrains, …) to manage MCP setup across editors.\x1b[0m"
363 );
364 println!();
365 println!(
366 " \x1b[33mTrade-off:\x1b[0m \x1b[2mthose dirs can hold other agents' sessions & credentials.\x1b[0m"
367 );
368 println!();
369 print!(" Allow the agent to read IDE config dirs? [y/N] ");
370 let _ = std::io::Write::flush(&mut std::io::stdout());
371 let mut input = String::new();
372 let _ = std::io::stdin().read_line(&mut input);
373 let answer = matches!(input.trim().to_lowercase().as_str(), "y" | "yes");
374 if let Err(e) = lean_ctx::core::config::Config::update_global(|c| {
375 c.allow_ide_config_dirs = Some(answer);
376 }) {
377 tracing::warn!("could not persist IDE-config-access choice: {e}");
378 }
379 if answer {
380 terminal_ui::print_status_new("IDE config access enabled");
381 } else {
382 terminal_ui::print_status_skip(
383 "Skipped (enable later: lean-ctx config set allow_ide_config_dirs true)",
384 );
385 }
386 }
387 }
388 }
389
390 terminal_ui::print_step_header(7, 14, "Skill Files");
391 if inject_skills {
392 let skill_result = lean_ctx::rules_inject::install_skills_where(&home, &allows);
393 for (name, installed) in &skill_result {
394 if *installed {
395 terminal_ui::print_status_new(&format!(
396 "{name:<20} \x1b[2mSKILL.md installed\x1b[0m"
397 ));
398 } else {
399 terminal_ui::print_status_ok(&format!(
400 "{name:<20} \x1b[2mSKILL.md up-to-date\x1b[0m"
401 ));
402 }
403 }
404 if skill_result.is_empty() {
405 terminal_ui::print_status_skip("No skill directories to install");
406 }
407 } else {
408 terminal_ui::print_status_skip(
409 "Skipped (skill files install with the rules opt-in; choose Standard/Full in `lean-ctx setup`)",
410 );
411 }
412
413 terminal_ui::print_step_header(8, 14, "Environment Check");
414 let lean_dir = lean_ctx::core::data_dir::lean_ctx_data_dir()
415 .unwrap_or_else(|_| home.join(".config/lean-ctx"));
416 if lean_dir.exists() {
417 terminal_ui::print_status_ok(&format!("{} ready", lean_dir.display()));
418 } else {
419 let _ = std::fs::create_dir_all(&lean_dir);
420 terminal_ui::print_status_new(&format!("Created {}", lean_dir.display()));
421 }
422 if let Some(report) = lean_ctx::core::data_consolidate::consolidate()
423 && report.files_moved > 0
424 {
425 terminal_ui::print_status_new(&format!(
426 "Consolidated {} file(s) from a split data dir into {}",
427 report.files_moved,
428 report.canonical.display()
429 ));
430 }
431 if let Some(report) = lean_ctx::core::config_heal::heal() {
434 match report.action {
435 lean_ctx::core::config_heal::HealAction::Adopted => {
436 terminal_ui::print_status_new(&format!(
437 "Recovered your config into {}",
438 report.to.display()
439 ));
440 }
441 lean_ctx::core::config_heal::HealAction::Superseded => {
442 terminal_ui::print_status_ok("Unified config (archived a stale data-dir copy)");
443 }
444 }
445 }
446 crate::doctor::run_compact();
447
448 lean_ctx::core::layout_pin::heal();
451
452 terminal_ui::print_step_header(9, 14, "Help Improve lean-ctx");
453 if lean_ctx::core::telemetry_consent::telemetry_would_send() {
456 for line in lean_ctx::core::telemetry_consent::hint_lines() {
457 println!(" \x1b[2m{line}\x1b[0m");
458 }
459 } else {
460 terminal_ui::print_status_skip(
461 "Telemetry is off — nothing is sent. Turn on: lean-ctx telemetry on",
462 );
463 }
464 lean_ctx::core::telemetry_consent::mark_notice_seen();
465
466 terminal_ui::print_step_header(10, 14, "Auto-Updates");
467 println!(" Keep lean-ctx up to date automatically.");
468 println!(" \x1b[1mChecks GitHub every 6h, installs only when a new release exists.\x1b[0m");
469 println!(
470 " \x1b[2mNo restarts mid-session. Change anytime: lean-ctx update --schedule off\x1b[0m"
471 );
472 println!();
473 print!(" Enable automatic updates? \x1b[1m[y/N]\x1b[0m ");
474 use std::io::Write;
475 std::io::stdout().flush().ok();
476
477 let mut auto_input = String::new();
478 let auto_update = if std::io::stdin().read_line(&mut auto_input).is_ok() {
479 let answer = auto_input.trim().to_lowercase();
480 answer == "y" || answer == "yes"
481 } else {
482 false
483 };
484
485 if auto_update {
486 let cfg = lean_ctx::core::config::Config::load();
487 let hours = cfg.updates.check_interval_hours;
488 match lean_ctx::core::update_scheduler::install_schedule(hours) {
489 Ok(info) => {
490 lean_ctx::core::update_scheduler::set_auto_update(true, false, hours);
491 terminal_ui::print_status_ok(&format!("Enabled — {info}"));
492 }
493 Err(e) => {
494 terminal_ui::print_status_warn(&format!("Scheduler setup failed: {e}"));
495 terminal_ui::print_status_skip("Enable later: lean-ctx update --schedule");
496 }
497 }
498 } else {
499 lean_ctx::core::update_scheduler::set_auto_update(false, false, 6);
500 terminal_ui::print_status_skip("Skipped — enable later: lean-ctx update --schedule");
501 }
502
503 terminal_ui::print_step_header(11, 14, "Tool Profile");
504 configure_tool_profile();
505
506 terminal_ui::print_step_header(12, 14, "Advanced Tuning (optional)");
507 configure_premium_features(&home);
508
509 terminal_ui::print_step_header(13, 14, "Code Intelligence");
510 let cwd = std::env::current_dir().ok();
511 let cwd_is_home = cwd
512 .as_ref()
513 .is_some_and(|d| dirs::home_dir().is_some_and(|h| d.as_path() == h.as_path()));
514 if cwd_is_home {
515 terminal_ui::print_status_warn(
516 "Running from $HOME — graph build skipped to avoid scanning your entire home directory.",
517 );
518 println!();
519 println!(" \x1b[1mSet a default project root to avoid this:\x1b[0m");
520 println!(" \x1b[2mEnter your main project path (or press Enter to skip):\x1b[0m");
521 print!(" \x1b[1m>\x1b[0m ");
522 use std::io::Write;
523 std::io::stdout().flush().ok();
524 let mut root_input = String::new();
525 if std::io::stdin().read_line(&mut root_input).is_ok() {
526 let root_trimmed = root_input.trim();
527 if root_trimmed.is_empty() {
528 terminal_ui::print_status_skip(
529 "No project root set. Set later: lean-ctx config set project_root /path/to/project",
530 );
531 } else {
532 let root_path = std::path::Path::new(root_trimmed);
533 if root_path.exists() && root_path.is_dir() {
534 let config_path = lean_ctx::core::config::Config::path()
535 .unwrap_or_else(|| home.join(".config/lean-ctx").join("config.toml"));
536 let mut content = std::fs::read_to_string(&config_path).unwrap_or_default();
537 if content.contains("project_root") {
538 if let Ok(re) = regex::Regex::new(r#"(?m)^project_root\s*=\s*"[^"]*""#) {
539 content = re
540 .replace(&content, &format!("project_root = \"{root_trimmed}\""))
541 .to_string();
542 }
543 } else {
544 if !content.is_empty() && !content.ends_with('\n') {
545 content.push('\n');
546 }
547 content.push_str(&format!("project_root = \"{root_trimmed}\"\n"));
548 }
549 let _ = lean_ctx::config_io::write_atomic_with_backup(&config_path, &content);
550 terminal_ui::print_status_ok(&format!("Project root set: {root_trimmed}"));
551 if lean_ctx::core::pathutil::has_project_marker(root_path) {
552 spawn_index_build_background(root_path);
553 terminal_ui::print_status_ok("Graph build started (background)");
554 }
555 } else {
556 terminal_ui::print_status_warn(&format!(
557 "Path not found: {root_trimmed} — skipped"
558 ));
559 }
560 }
561 }
562 } else {
563 let is_project = cwd
564 .as_ref()
565 .is_some_and(|d| lean_ctx::core::pathutil::has_project_marker(d));
566 if is_project {
567 println!(" \x1b[2mBuilding code graph for graph-aware reads, impact analysis,\x1b[0m");
568 println!(" \x1b[2mand smart search fusion in the background...\x1b[0m");
569 if let Some(ref root) = cwd {
570 spawn_index_build_background(root);
571 }
572 terminal_ui::print_status_ok("Graph build started (background)");
573 } else {
574 println!(" \x1b[2mRun `lean-ctx graph build` inside any git project to enable\x1b[0m");
575 println!(
576 " \x1b[2mgraph-aware reads, impact analysis, and smart search fusion.\x1b[0m"
577 );
578 }
579 }
580 println!();
581
582 {
583 let tools = lean_ctx::core::editor_registry::writers::auto_approve_tools();
584 println!();
585 println!(
586 " \x1b[33m⚡ Auto-approved tools ({} total):\x1b[0m",
587 tools.len()
588 );
589 for chunk in tools.chunks(6) {
590 let names: Vec<_> = chunk.iter().map(|t| format!("\x1b[2m{t}\x1b[0m")).collect();
591 println!(" {}", names.join(", "));
592 }
593 }
594
595 terminal_ui::print_step_header(14, 14, "Intelligence Runtime (optional)");
596 super::intelligence::configure_runtime();
597
598 println!();
599 println!(
600 " \x1b[1;32m✓ Setup complete!\x1b[0m \x1b[1m{}\x1b[0m configured, \x1b[2m{} already set, {} skipped\x1b[0m",
601 newly_configured.len(),
602 already_configured.len(),
603 not_installed.len()
604 );
605
606 if !errors.is_empty() {
607 println!(
608 " \x1b[33m⚠ {} error{}: {}\x1b[0m",
609 errors.len(),
610 if errors.len() == 1 { "" } else { "s" },
611 errors.join(", ")
612 );
613 }
614
615 let source_cmd = lean_ctx::shell_hook::shell_source_command().unwrap_or("Restart your shell");
616
617 let dim = "\x1b[2m";
618 let bold = "\x1b[1m";
619 let cyan = "\x1b[36m";
620 let yellow = "\x1b[33m";
621 let rst = "\x1b[0m";
622
623 println!();
624 println!(" {bold}Next steps:{rst}");
625 println!();
626 println!(" {cyan}1.{rst} Reload your shell:");
627 println!(" {bold}{source_cmd}{rst}");
628 println!();
629
630 let mut tools_to_restart: Vec<String> = newly_configured
631 .iter()
632 .map(std::string::ToString::to_string)
633 .collect();
634 for name in rules_result
635 .injected
636 .iter()
637 .chain(rules_result.updated.iter())
638 {
639 if !tools_to_restart.contains(name) {
640 tools_to_restart.push(name.clone());
641 }
642 }
643
644 if !tools_to_restart.is_empty() {
645 println!(" {cyan}2.{rst} {yellow}{bold}Restart your IDE / AI tool:{rst}");
646 println!(" {bold}{}{rst}", tools_to_restart.join(", "));
647 println!(
648 " {dim}Changes take effect after a full restart (MCP may be enabled or disabled depending on mode).{rst}"
649 );
650 println!(" {dim}Close and re-open the application completely.{rst}");
651 } else if !already_configured.is_empty() {
652 println!(
653 " {cyan}2.{rst} {dim}Your tools are already configured — no restart needed.{rst}"
654 );
655 }
656
657 println!();
658 println!(
659 " {dim}After restart, lean-ctx will automatically optimize every AI interaction.{rst}"
660 );
661 println!(" {dim}Verify with:{rst} {bold}lean-ctx cockpit{rst}");
662
663 println!();
664 terminal_ui::print_logo_animated();
665 terminal_ui::print_command_box();
666
667 if errors.is_empty() {
668 if let Err(error) =
669 lean_ctx::core::telemetry_aggregate::record_setup_completion(configured_integration_ids)
670 {
671 tracing::debug!("telemetry setup aggregate unavailable: {error}");
672 }
673 }
674
675 crate::cli::show_first_run_wow();
676}