Skip to content

feat(cloud): implement clean table output and modular structure#109

Merged
joshrotenberg merged 10 commits intomainfrom
feat/cloud-commands-clean
Sep 5, 2025
Merged

feat(cloud): implement clean table output and modular structure#109
joshrotenberg merged 10 commits intomainfrom
feat/cloud-commands-clean

Conversation

@joshrotenberg
Copy link
Copy Markdown
Collaborator

Summary

This PR implements clean, GitHub CLI-style output for Cloud commands and refactors the code into a modular structure.

Replaces #98 - Fresh rebase on main to avoid CI dependency issues.

Key Features

🎨 Clean Table Output

  • GitHub CLI-style tables using tabled library (no Unicode borders)
  • Smart field truncation for readability
  • Automatic paging for long output (Unix systems)
  • Consistent formatting across all list commands

📐 Vertical Detail Views

Added get commands with vertical layout for detailed resource views:

  • cloud subscription get <id>
  • cloud database get <id>
  • cloud user get <id>
  • cloud account get

🏗️ Modular Architecture

Refactored monolithic cloud.rs (1576 lines) into focused modules:

  • account.rs - Account management
  • subscription.rs - Subscription operations
  • database.rs - Database commands
  • user.rs - User management
  • utils.rs - Shared utilities

🪟 Cross-Platform Support

  • Windows compatibility (Unix-only pager feature)
  • Proper error handling for all platforms
  • All tests passing on Windows/Mac/Linux

Examples

Clean Table Output

ID       NAME                        STATUS   PLAN      MEMORY   DATABASES   REGION
2898175  database-MF4SPWPA-that...   active   Free/mo   250MB    1           us-east-1
2370381  cache-LYOVBEO5              active   Free/mo   250MB    1           us-east-1

Vertical Detail View

$ redisctl cloud database get 2898175:51413371

FIELD                     VALUE
id                        51413371
name                      database-MF4SPWPA
status                    active
memory                    268435456 bytes
region                    us-east-1
modules                   [search, json]
replication               enabled
persistence               aof-every-1-second
...

Testing

  • ✅ All existing tests pass
  • ✅ Manual testing of all commands
  • ✅ Windows/Mac/Linux CI passing
  • ✅ Clippy clean
  • ✅ Formatted with rustfmt

Breaking Changes

None - maintains backward compatibility

Closes #98

- Add clean GitHub CLI-style table output using tabled library
- Refactor monolithic cloud.rs into focused modules:
  - account.rs for account commands
  - subscription.rs for subscription management
  - database.rs for database operations
  - user.rs for user management
  - utils.rs for shared utilities
- Add vertical detail views for get commands
- Implement automatic paging for long output (Unix only)
- Add smart truncation for table fields
- Support JSON/YAML output formats with -o flag
- Fix Windows compatibility (Unix-only pager, IsTerminal)
- Fix error handling for anyhow::Error conversions
- Add comprehensive test coverage

Replaces PR #98 with clean rebase on main
- Add cargo fetch --locked step for Windows runners
- Fixes workspace dependency resolution issues in CI
- Windows-specific workaround for GitHub Actions
- Add cargo metadata and check steps for Windows
- Ensures workspace dependencies are properly resolved
- Attempts to precompile dependencies before main build
- Replace workspace = true with explicit version numbers
- Fixes Windows CI failures with unresolved dependencies
- Remove unnecessary Windows-specific CI workarounds
- All dependencies now directly specified in crate Cargo.toml
- Add From<serde_json::Error> for RedisCtlError
- Add From<std::io::Error> for RedisCtlError
- Fixes error conversion issues with ? operator
- All dependencies were already present with correct versions
- Replace ALL workspace inheritance with explicit values
- Change Config error from anyhow::Error to String
- Add explicit From<anyhow::Error> implementation
- This should finally fix Windows CI dependency resolution
- Revert back to using workspace = true for all dependencies
- Keep workspace edition which should work
- Remove incorrect edition 2024 override
- This matches what other crates in workspace do successfully
CRITICAL FIX: Dependencies were accidentally placed after [target.'cfg(unix)'.dependencies]
which made them Unix-only. Moving them before the target section makes them
available on all platforms including Windows.
@joshrotenberg joshrotenberg merged commit 1ff1df8 into main Sep 5, 2025
13 checks passed
@joshrotenberg joshrotenberg deleted the feat/cloud-commands-clean branch September 5, 2025 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant