Skip to content

Commit af873b9

Browse files
committed
feat: add auth test, config management, and interactive setup wizard
- Add 'auth test' command to verify credentials for any profile - Add 'auth setup' interactive wizard for easy profile creation - Add 'config show' to display current configuration and active profile - Add 'config path' to show configuration file location - Add 'config validate' to check profile configuration - Improve error messages with actionable suggestions - Support environment variable precedence for authentication - Add colored output and dialoguer for better UX Closes #33
1 parent 9a91e9b commit af873b9

File tree

11 files changed

+848
-15
lines changed

11 files changed

+848
-15
lines changed

crates/redisctl/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ serde_json = { workspace = true }
4141
chrono = "0.4"
4242
rpassword = { workspace = true }
4343
urlencoding = "2.1"
44+
dialoguer = "0.11"
45+
colored = "2.1"
4446

4547
# Shared utility dependencies
4648
thiserror = { workspace = true }

crates/redisctl/src/cli.rs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ pub enum Commands {
6969
#[command(subcommand)]
7070
command: AccountCommands,
7171
},
72+
/// Authentication testing and management
73+
Auth {
74+
#[command(subcommand)]
75+
command: AuthCommands,
76+
},
77+
/// Configuration management
78+
Config {
79+
#[command(subcommand)]
80+
command: ConfigCommands,
81+
},
7282
}
7383

7484
#[derive(Subcommand)]
@@ -1585,3 +1595,36 @@ pub enum BillingCommands {
15851595
data: String,
15861596
},
15871597
}
1598+
1599+
#[derive(Subcommand)]
1600+
pub enum AuthCommands {
1601+
/// Test authentication credentials
1602+
Test {
1603+
/// Profile to test (defaults to current profile)
1604+
#[arg(long)]
1605+
profile: Option<String>,
1606+
/// Test a specific deployment type
1607+
#[arg(long, value_enum)]
1608+
deployment: Option<DeploymentType>,
1609+
},
1610+
/// Interactive setup wizard for new profiles
1611+
Setup,
1612+
}
1613+
1614+
#[derive(Subcommand)]
1615+
pub enum ConfigCommands {
1616+
/// Show current configuration and active profile
1617+
Show {
1618+
/// Show sensitive values (passwords, API keys)
1619+
#[arg(long)]
1620+
show_secrets: bool,
1621+
},
1622+
/// Show configuration file path
1623+
Path,
1624+
/// Validate configuration
1625+
Validate {
1626+
/// Profile to validate (defaults to all profiles)
1627+
#[arg(long)]
1628+
profile: Option<String>,
1629+
},
1630+
}

crates/redisctl/src/cloud_bin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn get_cloud_profile<'a>(
6060
let env_profile = std::env::var("REDISCTL_PROFILE").ok();
6161
let profile_name = profile_name
6262
.as_deref()
63-
.or(config.default.as_deref())
63+
.or(config.default_profile.as_deref())
6464
.or(env_profile.as_deref())
6565
.ok_or_else(|| anyhow::anyhow!("No profile specified"))?;
6666

0 commit comments

Comments
 (0)