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
81 changes: 61 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,35 +144,76 @@ docker compose down -v

### 1. Configure Authentication

#### Redis Cloud
#### Option 1: Interactive Setup Wizard (Recommended)
```bash
# Using environment variables
export REDIS_CLOUD_API_KEY="your-api-key"
export REDIS_CLOUD_API_SECRET="your-api-secret"
# Launch guided setup for any deployment type
redisctl auth setup

# Or using profiles
redisctl profile set prod-cloud \
--deployment-type cloud \
--api-key YOUR_KEY \
--api-secret YOUR_SECRET
# Test your authentication
redisctl auth test
```

#### Redis Enterprise
The interactive setup wizard will:
- Guide you through credential collection
- Test authentication during setup
- Create and save working profiles
- Set up your first profile as default

#### Option 2: Manual Profile Creation

##### Redis Cloud
```bash
# Using environment variables
# Create a Cloud profile manually
redisctl profile set prod-cloud cloud \
--api-key "your-api-key" \
--api-secret "your-api-secret"

# Set as default profile
redisctl profile default prod-cloud
```

##### Redis Enterprise
```bash
# Create an Enterprise profile manually
redisctl profile set prod-enterprise enterprise \
--url https://cluster:9443 \
--username admin@example.com \
--password your-password
```

#### Option 3: Environment Variables
```bash
# Redis Cloud
export REDIS_CLOUD_API_KEY="your-api-key"
export REDIS_CLOUD_API_SECRET="your-api-secret"

# Redis Enterprise
export REDIS_ENTERPRISE_URL="https://cluster.example.com:9443"
export REDIS_ENTERPRISE_USER="admin@example.com"
export REDIS_ENTERPRISE_USER="admin@example.com"
export REDIS_ENTERPRISE_PASSWORD="your-password"

# Or using profiles
redisctl profile set prod-enterprise \
--deployment-type enterprise \
--url https://cluster:9443 \
--username admin \
--password secret
# Test authentication works
redisctl auth test
```

### 2. Verify Your Setup

```bash
# Test authentication for any profile or environment vars
redisctl auth test
redisctl auth test --profile prod-cloud

# View your configuration
redisctl config show

# Validate all profiles
redisctl config validate

# Find your config file location
redisctl config path
```

### 2. Basic Usage
### 3. Basic Usage

```bash
# List all profiles
Expand All @@ -194,7 +235,7 @@ redisctl database list -o json | jq '.[] | .name'
redisctl database list -q "[?status=='active'].name" -o yaml
```

### 3. Common Workflows
### 4. Common Workflows

```bash
# Initialize a new Enterprise cluster
Expand Down
2 changes: 2 additions & 0 deletions crates/redisctl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ serde_json = { workspace = true }
chrono = "0.4"
rpassword = { workspace = true }
urlencoding = "2.1"
dialoguer = "0.11"
colored = "2.1"

# Shared utility dependencies
thiserror = { workspace = true }
Expand Down
43 changes: 43 additions & 0 deletions crates/redisctl/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ pub enum Commands {
#[command(subcommand)]
command: AccountCommands,
},
/// Authentication testing and management
Auth {
#[command(subcommand)]
command: AuthCommands,
},
/// Configuration management
Config {
#[command(subcommand)]
command: ConfigCommands,
},
}

#[derive(Subcommand)]
Expand Down Expand Up @@ -1585,3 +1595,36 @@ pub enum BillingCommands {
data: String,
},
}

#[derive(Subcommand)]
pub enum AuthCommands {
/// Test authentication credentials
Test {
/// Profile to test (defaults to current profile)
#[arg(long)]
profile: Option<String>,
/// Test a specific deployment type
#[arg(long, value_enum)]
deployment: Option<DeploymentType>,
},
/// Interactive setup wizard for new profiles
Setup,
}

#[derive(Subcommand)]
pub enum ConfigCommands {
/// Show current configuration and active profile
Show {
/// Show sensitive values (passwords, API keys)
#[arg(long)]
show_secrets: bool,
},
/// Show configuration file path
Path,
/// Validate configuration
Validate {
/// Profile to validate (defaults to all profiles)
#[arg(long)]
profile: Option<String>,
},
}
2 changes: 1 addition & 1 deletion crates/redisctl/src/cloud_bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn get_cloud_profile<'a>(
let env_profile = std::env::var("REDISCTL_PROFILE").ok();
let profile_name = profile_name
.as_deref()
.or(config.default.as_deref())
.or(config.default_profile.as_deref())
.or(env_profile.as_deref())
.ok_or_else(|| anyhow::anyhow!("No profile specified"))?;

Expand Down
Loading
Loading