1use console::{style, Term};
11
12pub fn print_banner(version: &str, model: &str, project: &str, auth_status: &str) {
14 let term = Term::stdout();
15 let width = term.size().1 as usize;
16 let width = width.clamp(60, 100);
17 let line = style("─".repeat(width)).dim().to_string();
18
19 println!();
20 println!(
21 " {} {} {} {}",
22 style("✦").cyan().bold(),
23 style("xcodeai").cyan().bold(),
24 style(format!("v{}", version)).dim(),
25 style("autonomous AI coding agent").dim(),
26 );
27 println!(
28 " {} {} {} {}",
29 style("model:").dim(),
30 style(model).green(),
31 style("project:").dim(),
32 style(project).yellow(),
33 );
34 println!(" {} {}", style("auth:").dim(), auth_status,);
35 println!("{}", line);
36 println!(
37 " {}",
38 style("Type a task and press Enter. /plan to discuss first. /help for commands. Ctrl-D to quit.").dim()
39 );
40 println!("{}", line);
41 println!();
42}
43
44pub fn print_separator(label: &str) {
46 let label_str = if label.is_empty() {
47 style("─".repeat(44)).dim().to_string()
48 } else {
49 format!(
50 "{} {} {}",
51 style("─".repeat(2)).dim(),
52 style(label).dim(),
53 style("─".repeat(40 - label.len().min(38))).dim()
54 )
55 };
56 println!("{}", label_str);
57}
58
59pub fn ok(msg: &str) {
61 println!(" {} {}", style("✓").green().bold(), msg);
62}
63
64pub fn warn(msg: &str) {
66 println!(" {} {}", style("!").yellow().bold(), style(msg).yellow());
67}
68
69pub fn err(msg: &str) {
71 eprintln!(" {} {}", style("✗").red().bold(), style(msg).red());
72}
73
74pub fn info(msg: &str) {
76 println!(" {}", style(msg).dim());
77}