1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// DRY helpers for user-facing CLI messages.
//
// Conventions:
// error() — red bold "Error: ..." for fatal problems
// warn() — yellow "Warning: ..." for non-fatal issues
// info() — cyan "Info: ..." for neutral guidance
// ok() — green "Done: ..." for success
// hint() — dim " -> ..." for follow-up actions beneath an error/warn
// config_hint() — renders a vtcode.toml snippet the user should add
use vtcode_core::utils::colors::style;
/// Red bold error prefix.
pub fn error(msg: &str) -> String {
format!("{}", style(format!("Error: {msg}")).red().bold())
}
/// Yellow warning prefix.
pub fn warn(msg: &str) -> String {
format!("{}", style(format!("Warning: {msg}")).yellow())
}
/// Cyan info prefix.
#[allow(dead_code)]
pub fn info(msg: &str) -> String {
format!("{}", style(format!("Info: {msg}")).cyan())
}
/// Green success prefix.
pub fn ok(msg: &str) -> String {
format!("{}", style(format!("Done: {msg}")).green())
}
/// Dim follow-up hint, indented with arrow.
pub fn hint(msg: &str) -> String {
format!("{}", style(format!(" -> {msg}")).dim())
}
/// Render a vtcode.toml configuration snippet the user should add.
#[allow(dead_code)]
pub fn config_hint(section: &str, snippet: &str) -> String {
format!(
"Add the following to {}:\n\n [{}]\n {}",
style("vtcode.toml").bold(),
section,
snippet
)
}