|
1 | 1 | # redisctl |
2 | 2 |
|
3 | 3 | [](https://crates.io/crates/redisctl) |
4 | | -[](https://crates.io/crates/redisctl) |
5 | 4 | [](https://docs.rs/redisctl) |
6 | | -[](https://github.com/joshrotenberg/redisctl/releases) |
7 | | -[](https://github.com/joshrotenberg/redisctl#license) |
8 | 5 | [](https://github.com/joshrotenberg/redisctl/actions/workflows/ci.yml) |
9 | | -[](https://github.com/joshrotenberg/redisctl/actions/workflows/security.yml) |
10 | | -[](https://hub.docker.com/r/joshrotenberg/redisctl) |
| 6 | +[](https://github.com/joshrotenberg/redisctl#license) |
11 | 7 |
|
12 | | -A unified CLI for Redis Cloud and Redis Enterprise REST APIs with comprehensive async operation support. |
| 8 | +A unified command-line interface for managing Redis Cloud and Redis Enterprise deployments through their REST APIs. |
13 | 9 |
|
14 | 10 | ## Features |
15 | 11 |
|
16 | 12 | - **Unified Interface** - Single CLI for both Redis Cloud and Redis Enterprise |
17 | 13 | - **Async Operations** - Full support for long-running operations with `--wait` flags |
18 | 14 | - **Smart Routing** - Automatically detects which API to use based on context |
19 | 15 | - **Multiple Output Formats** - JSON, YAML, and Table output with JMESPath filtering |
20 | | -- **Secure Configuration** - Profile-based auth with environment variable support |
21 | | -- **Comprehensive Coverage** - Full API coverage for both platforms |
| 16 | +- **Profile Management** - Secure credential storage with environment variable support |
22 | 17 |
|
23 | 18 | ## Installation |
24 | 19 |
|
25 | | -```bash |
26 | | -# Install from crates.io |
27 | | -cargo install redisctl |
28 | | - |
29 | | -# Or build from source |
30 | | -git clone https://github.com/joshrotenberg/redisctl.git |
31 | | -cd redisctl |
32 | | -cargo install --path crates/redisctl |
33 | | -``` |
| 20 | +### From Binary Releases |
| 21 | +Download the latest release for your platform from the [releases page](https://github.com/joshrotenberg/redisctl/releases). |
34 | 22 |
|
35 | | -### Shell Completions |
36 | | - |
37 | | -`redisctl` can generate shell completions for various shells. To install them: |
38 | | - |
39 | | -#### Bash |
| 23 | +### From Cargo |
40 | 24 | ```bash |
41 | | -# Generate and install completion |
42 | | -redisctl completions bash > ~/.local/share/bash-completion/completions/redisctl |
43 | | - |
44 | | -# Or for system-wide installation (requires sudo) |
45 | | -redisctl completions bash | sudo tee /usr/share/bash-completion/completions/redisctl |
46 | | -``` |
47 | | - |
48 | | -#### Zsh |
49 | | -```bash |
50 | | -# Generate completion to a directory in your $fpath |
51 | | -redisctl completions zsh > ~/.zsh/completions/_redisctl |
52 | | - |
53 | | -# Add this to your ~/.zshrc if not already present |
54 | | -fpath=(~/.zsh/completions $fpath) |
55 | | -autoload -U compinit && compinit |
56 | | -``` |
57 | | - |
58 | | -#### Fish |
59 | | -```bash |
60 | | -# Generate completion |
61 | | -redisctl completions fish > ~/.config/fish/completions/redisctl.fish |
62 | | -``` |
63 | | - |
64 | | -#### PowerShell |
65 | | -```powershell |
66 | | -# Generate completion |
67 | | -redisctl completions powershell > $PROFILE.CurrentUserAllHosts |
68 | | -
|
69 | | -# Or add to your profile |
70 | | -redisctl completions powershell >> $PROFILE |
| 25 | +cargo install redisctl |
71 | 26 | ``` |
72 | 27 |
|
73 | | -#### Elvish |
| 28 | +### Using Docker |
74 | 29 | ```bash |
75 | | -# Generate completion |
76 | | -redisctl completions elvish > ~/.elvish/lib/redisctl.elv |
77 | | - |
78 | | -# Add to rc.elv |
79 | | -echo "use redisctl" >> ~/.elvish/rc.elv |
| 30 | +docker run --rm joshrotenberg/redisctl --help |
80 | 31 | ``` |
81 | 32 |
|
82 | 33 | ## Quick Start |
83 | 34 |
|
84 | | -### Configure Authentication |
85 | | - |
86 | | -Create `~/.config/redisctl/config.toml`: |
87 | | - |
88 | | -```toml |
89 | | -[profiles.cloud] |
90 | | -deployment_type = "cloud" |
91 | | -api_key = "your-api-key" |
92 | | -api_secret = "your-secret-key" |
93 | | - |
94 | | -[profiles.enterprise] |
95 | | -deployment_type = "enterprise" |
96 | | -url = "https://cluster:9443" |
97 | | -username = "admin@example.com" |
98 | | -password = "your-password" |
99 | | - |
100 | | -default_profile = "cloud" |
101 | | -``` |
102 | | - |
103 | | -Or use environment variables: |
| 35 | +### 1. Configure Authentication |
104 | 36 |
|
105 | 37 | ```bash |
106 | 38 | # Redis Cloud |
107 | | -export REDIS_CLOUD_API_KEY="your-key" |
108 | | -export REDIS_CLOUD_API_SECRET="your-secret" |
| 39 | +export REDIS_CLOUD_API_KEY="your-api-key" |
| 40 | +export REDIS_CLOUD_SECRET_KEY="your-secret-key" |
109 | 41 |
|
110 | 42 | # Redis Enterprise |
111 | | -export REDIS_ENTERPRISE_URL="https://cluster:9443" |
112 | | -export REDIS_ENTERPRISE_USER="admin@example.com" |
| 43 | +export REDIS_ENTERPRISE_URL="https://your-cluster:9443" |
| 44 | +export REDIS_ENTERPRISE_USER="your-email@example.com" |
113 | 45 | export REDIS_ENTERPRISE_PASSWORD="your-password" |
114 | 46 | ``` |
115 | 47 |
|
116 | | -### Basic Usage |
117 | | - |
118 | | -### Database Operations |
| 48 | +Or use profiles for multiple environments: |
119 | 49 |
|
120 | 50 | ```bash |
121 | | -# List databases |
122 | | -redisctl database list |
123 | | - |
124 | | -# Create database with async wait |
125 | | -redisctl cloud database create --data @database.json --wait |
| 51 | +# Create a profile |
| 52 | +redisctl profile set cloud-prod \ |
| 53 | + --cloud-api-key="$REDIS_CLOUD_API_KEY" \ |
| 54 | + --cloud-secret-key="$REDIS_CLOUD_SECRET_KEY" |
126 | 55 |
|
127 | | -# Update database with wait |
128 | | -redisctl cloud database update 12345 --data @update.json --wait |
129 | | - |
130 | | -# Different output formats with filtering |
131 | | -redisctl database list -o yaml | yq '.[] | select(.name == "prod")' |
132 | | - |
133 | | -# Delete database with force and wait |
134 | | -redisctl cloud database delete 12345 --force --wait |
| 56 | +# Use the profile |
| 57 | +redisctl --profile cloud-prod cloud database list |
135 | 58 | ``` |
136 | 59 |
|
137 | | -## Output Formats |
| 60 | +### 2. Basic Commands |
138 | 61 |
|
139 | 62 | ```bash |
140 | | -# JSON output (default) |
141 | | -redisctl database list -o json |
142 | | - |
143 | | -# YAML output |
144 | | -redisctl database list -o yaml |
145 | | - |
146 | | -# Human-readable table |
147 | | -redisctl database list -o table |
148 | | - |
149 | | -# Filter with JMESPath |
150 | | -redisctl database list -q "[?status=='active'].{name: name, memory: memoryLimitInGb}" |
151 | | - |
152 | | -# Combine with jq for advanced processing |
153 | | -redisctl database list -o json | jq '.[] | select(.name | contains("prod"))' |
154 | | -``` |
155 | | - |
156 | | -## Profile Management |
157 | | - |
158 | | -```bash |
159 | | -# List all profiles |
160 | | -redisctl profile list |
161 | | - |
162 | | -# Set default profile |
163 | | -redisctl profile default cloud-prod |
164 | | - |
165 | | -# Get specific profile settings |
166 | | -redisctl profile get enterprise-dev |
| 63 | +# List databases (auto-detects deployment type from profile) |
| 64 | +redisctl database list |
167 | 65 |
|
168 | | -# Set profile values |
169 | | -redisctl profile set cloud-staging api_key "new-key" |
170 | | -redisctl profile set cloud-staging api_secret "new-secret" |
| 66 | +# Get database details with formatted output |
| 67 | +redisctl database get 12345 --output table |
171 | 68 |
|
172 | | -# Remove profile |
173 | | -redisctl profile remove old-profile |
| 69 | +# Create a database and wait for completion |
| 70 | +redisctl cloud database create --data @database.json --wait |
174 | 71 |
|
175 | | -# Use specific profile for a command |
176 | | -redisctl database list --profile cloud-staging |
| 72 | +# Direct API access for any endpoint |
| 73 | +redisctl api cloud get /subscriptions/88449/databases |
177 | 74 | ``` |
178 | 75 |
|
179 | | -## Environment Variables |
180 | | - |
181 | | -### Cloud Configuration |
182 | | -- `REDIS_CLOUD_API_KEY` - API key for authentication |
183 | | -- `REDIS_CLOUD_API_SECRET` - API secret for authentication |
184 | | -- `REDIS_CLOUD_API_URL` - Custom API URL (optional) |
185 | | - |
186 | | -### Enterprise Configuration |
187 | | -- `REDIS_ENTERPRISE_URL` - Cluster API URL |
188 | | -- `REDIS_ENTERPRISE_USER` - Username for authentication |
189 | | -- `REDIS_ENTERPRISE_PASSWORD` - Password for authentication |
190 | | -- `REDIS_ENTERPRISE_INSECURE` - Allow insecure TLS (true/false) |
191 | | - |
192 | | -### General Configuration |
193 | | -- `REDISCTL_PROFILE` - Default profile to use |
194 | | -- `RUST_LOG` - Logging level (error, warn, info, debug, trace) |
195 | | - |
196 | 76 | ## Documentation |
197 | 77 |
|
198 | | -For comprehensive documentation, see the [mdBook documentation](docs/): |
| 78 | +For comprehensive documentation including: |
| 79 | +- Detailed configuration options |
| 80 | +- Complete command reference |
| 81 | +- Async operation handling |
| 82 | +- Output formatting and filtering |
| 83 | +- Troubleshooting guides |
199 | 84 |
|
200 | | -- [Getting Started](docs/src/getting-started/index.md) - Installation and configuration |
201 | | -- [CLI Reference](docs/src/cli-reference/index.md) - Complete command reference |
202 | | -- [Async Operations](docs/src/features/async-operations.md) - Using `--wait` flags |
203 | | -- [Examples](docs/src/examples/index.md) - Common use cases and patterns |
204 | | -- **API Reference** - Complete command reference |
| 85 | +Visit the [full documentation](https://joshrotenberg.github.io/redisctl/). |
205 | 86 |
|
206 | 87 | ## Development |
207 | 88 |
|
208 | | -This project provides Rust client libraries for both APIs: |
| 89 | +### Building from Source |
| 90 | +```bash |
| 91 | +git clone https://github.com/joshrotenberg/redisctl.git |
| 92 | +cd redisctl |
| 93 | +cargo build --release |
| 94 | +``` |
209 | 95 |
|
210 | | -```toml |
211 | | -[dependencies] |
212 | | -redis-cloud = "0.2" # Redis Cloud API client |
213 | | -redis-enterprise = "0.2" # Redis Enterprise API client |
| 96 | +### Running Tests |
| 97 | +```bash |
| 98 | +cargo test --workspace |
214 | 99 | ``` |
215 | 100 |
|
216 | | -See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines. |
| 101 | +## Contributing |
| 102 | + |
| 103 | +Contributions are welcome! Please see the [contributing guidelines](https://joshrotenberg.github.io/redisctl/developer/contributing.html) in the documentation. |
217 | 104 |
|
218 | 105 | ## License |
219 | 106 |
|
220 | | -This project is licensed under the MIT License - see [LICENSE](LICENSE) file for details. |
| 107 | +Licensed under either of: |
| 108 | +- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE)) |
| 109 | +- MIT license ([LICENSE-MIT](LICENSE-MIT)) |
| 110 | + |
| 111 | +at your option. |
0 commit comments