Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ pub enum Commands {
/// Preview changes without writing to disk
#[arg(long)]
dry_run: bool,
/// Reconfigure a single section (providers, budget, compliance, fallback)
/// Reconfigure a single section
/// (providers, auth, budget, compliance, fallback, endpoints, tools)
#[arg(long, alias = "reconfigure", value_name = "SECTION")]
edit: Option<String>,
},
Expand Down
23 changes: 21 additions & 2 deletions src/commands/setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ pub async fn run_setup_wizard(config_path: &Path, flags: &SetupFlags) -> Result<
println!(" [2] Replace from scratch");
println!(" [3] Cancel");
println!();
println!(" Tip: use `grob setup --edit providers` to reconfigure a single section.");
println!(
" Tip: `grob setup --edit <section>` (providers, auth, budget, compliance, fallback, endpoints, tools)"
);
if prompt_choice(3) == 3 {
return Ok(false);
}
Expand Down Expand Up @@ -268,9 +270,26 @@ async fn run_edit_section(config_path: &Path, section: &str, flags: &SetupFlags)
}
}
}
"tools" => {
// Re-run the tool picker. Screen_tools infers the preset from the
// tool selection; we rewrite [presets].active so a subsequent
// `grob setup` re-runs pick up the new preset as default.
let (_tools, preset, _desc) = match screen_tools() {
Some(t) => t,
None => {
println!(" No tools selected — leaving config unchanged.");
return Ok(false);
}
};
patch(&mut config, "presets", &[("active", preset.clone().into())])?;
println!(" Preset switched to '{}'.", preset);
println!(
" Note: provider list is tied to the preset — run `grob setup --edit providers` if credentials need updating."
);
}
_ => {
println!(
" Unknown section '{}'. Available: providers, budget, compliance, fallback, endpoints",
" Unknown section '{}'. Available: providers, auth, budget, compliance, fallback, endpoints, tools",
section
);
return Ok(false);
Expand Down
5 changes: 4 additions & 1 deletion src/commands/setup/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ pub struct SetupFlags {
pub yes: bool,
/// Previews changes without writing to disk.
pub dry_run: bool,
/// Restricts the wizard to a single section (providers, budget, compliance, fallback).
/// Restricts the wizard to a single section.
///
/// Accepted values: `providers`, `auth`, `budget`, `compliance`,
/// `fallback`, `endpoints`, `tools`.
pub edit_section: Option<String>,
}
Loading