mirror of
https://github.com/instructkr/claw-code.git
synced 2026-06-09 16:02:14 +08:00
feat: wizard entry points -- /setup command, claw setup subcommand, and RuntimeProviderConfig
The setup wizard was merged in PR #3017 but was orphaned -- it was not declared as a module in main.rs, making it unreachable. Additionally, the setup_wizard.rs imports RuntimeProviderConfig which did not exist on upstream/main. This commit makes the wizard accessible and adds the necessary RuntimeProviderConfig type. Changes: - Add RuntimeProviderConfig struct to runtime/src/config.rs with kind(), api_key(), base_url(), model() accessors. - Add parse_optional_provider_config() to parse the provider object from merged settings JSON. - Add provider() method to RuntimeConfig and RuntimeFeatureConfig. - Export RuntimeProviderConfig, save_user_provider_settings, clear_user_provider_settings, and default_config_home from runtime crate public API (runtime/src/lib.rs). - Add mod setup_wizard to rusty-claude-cli/src/main.rs. - Add claw setup CLI subcommand. - Add /setup slash command. - Add Setup variant to SlashCommand enum. - Add Setup to LocalHelpTopic enum. - Add setup to diagnostic subcommand matching. - Add subagentModel to TOP_LEVEL_FIELDS in config_validate.rs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -720,6 +720,13 @@ const SLASH_COMMAND_SPECS: &[SlashCommandSpec] = &[
|
||||
argument_hint: None,
|
||||
resume_supported: true,
|
||||
},
|
||||
SlashCommandSpec {
|
||||
name: "setup",
|
||||
aliases: &[],
|
||||
summary: "Run the interactive provider setup wizard",
|
||||
argument_hint: None,
|
||||
resume_supported: false,
|
||||
},
|
||||
SlashCommandSpec {
|
||||
name: "notifications",
|
||||
aliases: &[],
|
||||
@@ -1102,6 +1109,7 @@ pub enum SlashCommand {
|
||||
args: Option<String>,
|
||||
},
|
||||
Doctor,
|
||||
Setup,
|
||||
Login,
|
||||
Logout,
|
||||
Vim,
|
||||
@@ -1223,6 +1231,7 @@ impl SlashCommand {
|
||||
Self::Compact { .. } => "/compact",
|
||||
Self::Cost => "/cost",
|
||||
Self::Doctor => "/doctor",
|
||||
Self::Setup => "/setup",
|
||||
Self::Config { .. } => "/config",
|
||||
Self::Memory { .. } => "/memory",
|
||||
Self::History { .. } => "/history",
|
||||
@@ -1392,6 +1401,10 @@ pub fn validate_slash_command_input(
|
||||
validate_no_args(command, &args)?;
|
||||
SlashCommand::Doctor
|
||||
}
|
||||
"setup" => {
|
||||
validate_no_args(command, &args)?;
|
||||
SlashCommand::Setup
|
||||
}
|
||||
"login" | "logout" => {
|
||||
return Err(command_error(
|
||||
"This auth flow was removed. Set ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN instead.",
|
||||
@@ -1914,7 +1927,7 @@ fn slash_command_category(name: &str) -> &'static str {
|
||||
| "stickers" | "language" | "profile" | "max-tokens" | "temperature" | "system-prompt"
|
||||
| "api-key" | "terminal-setup" | "notifications" | "telemetry" | "providers" | "env"
|
||||
| "project" | "reasoning" | "budget" | "rate-limit" | "workspace" | "reset" | "ide"
|
||||
| "desktop" | "upgrade" => "Config",
|
||||
| "desktop" | "upgrade" | "setup" => "Config",
|
||||
"debug-tool-call" | "doctor" | "sandbox" | "diagnostics" | "tool-details" | "changelog"
|
||||
| "metrics" => "Debug",
|
||||
_ => "Tools",
|
||||
@@ -5381,6 +5394,7 @@ pub fn handle_slash_command(
|
||||
| SlashCommand::AddDir { .. }
|
||||
| SlashCommand::History { .. }
|
||||
| SlashCommand::Team { .. }
|
||||
| SlashCommand::Setup
|
||||
| SlashCommand::Unknown(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user