Support verbose = true in cli.toml to default verbose output on

Adds a top-level `verbose` bool to CliConfig so `arc run start` and
`arc doctor` pick it up without requiring `-v` every invocation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-08 12:01:05 -04:00
parent ad058e604a
commit 18aaa75ae7
2 changed files with 12 additions and 1 deletions

View file

@ -52,6 +52,8 @@ pub struct CliConfig {
pub llm: Option<LlmDefaults>,
pub git: Option<CliGitConfig>,
#[serde(default)]
pub verbose: bool,
#[serde(default)]
pub log: arc_api::server_config::LogConfig,
}
@ -350,6 +352,12 @@ email = "me@local"
assert_eq!(config.git, None);
}
#[test]
fn parse_verbose_true() {
let config: CliConfig = toml::from_str("verbose = true").unwrap();
assert!(config.verbose);
}
#[test]
fn parse_log_level() {
let toml = "[log]\nlevel = \"debug\"";

View file

@ -217,11 +217,12 @@ async fn main() -> Result<()> {
arc_agent::cli::run_with_args(args).await?
}
Command::Run { command } => match command {
RunCommand::Start(args) => {
RunCommand::Start(mut args) => {
let styles: &'static arc_util::terminal::Styles =
Box::leak(Box::new(arc_util::terminal::Styles::detect_stderr()));
let server_config = arc_api::server_config::load_server_config(None)?;
let cli_config = cli_config::load_cli_config(None)?;
args.verbose = args.verbose || cli_config.verbose;
let github_app = build_github_app_credentials(&server_config);
let cli_author = cli_config.git.as_ref().map(|g| &g.author);
@ -279,6 +280,8 @@ async fn main() -> Result<()> {
arc_api::serve::serve_command(args, styles).await?;
}
Command::Doctor { verbose, live } => {
let cli_config = cli_config::load_cli_config(None)?;
let verbose = verbose || cli_config.verbose;
let exit_code = doctor::run_doctor(verbose, live).await;
std::process::exit(exit_code);
}