Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

This PR adds the ability to look up modules by name instead of UID, making it easier to work with modules in Redis Enterprise.

Feature 1: --name flag for enterprise module get

Look up modules by name instead of requiring the UID:

# Before (required UID)
redisctl enterprise module get abc123-uid

# After (can use name)
redisctl enterprise module get --name ReJSON
redisctl enterprise module get --name search

Features:

  • Case-insensitive matching
  • Helpful suggestions on partial matches (e.g., "Did you mean: ReJSON, RedisJSON?")
  • Clear error with version info if multiple modules match

Feature 2: --module flag for enterprise database create

Specify modules by name when creating a database:

# Before (required JSON with module_list)
redisctl enterprise database create --name mydb --memory 1073741824 \
  --data '{"module_list": [{"module_name": "search"}, {"module_name": "ReJSON"}]}'

# After (simple flags)
redisctl enterprise database create --name mydb --memory 1073741824 \
  --module search --module ReJSON

Features:

  • Auto-resolves module names to the proper module_list format
  • Supports module args via colon syntax: --module search:ARGS
  • Can be repeated for multiple modules
  • Case-insensitive matching with helpful error messages
  • Validates modules exist before creating database

Testing

  • All existing tests pass
  • Manually tested CLI help output shows new options correctly

Files Changed

  • crates/redisctl/src/cli/enterprise.rs - Added --module flag to database create
  • crates/redisctl/src/commands/enterprise/module.rs - Added --name flag to module get
  • crates/redisctl/src/commands/enterprise/module_impl.rs - Module name resolution logic
  • crates/redisctl/src/commands/enterprise/database.rs - Pass modules to create handler
  • crates/redisctl/src/commands/enterprise/database_impl.rs - Module resolution in database create

Add --name flag to 'enterprise module get':
- Look up modules by name instead of UID
- Case-insensitive matching
- Helpful suggestions on partial matches
- Error with available versions if multiple matches found

Add --module flag to 'enterprise database create':
- Specify modules by name (e.g., --module search --module ReJSON)
- Auto-resolves module names to proper module_list format
- Supports module args via colon syntax (--module search:ARGS)
- Can be repeated for multiple modules
- Case-insensitive matching with helpful error messages

Examples:
  # Get module by name
  redisctl enterprise module get --name ReJSON

  # Create database with modules
  redisctl enterprise database create --name mydb --memory 1073741824 \
    --module search --module ReJSON
@joshrotenberg joshrotenberg merged commit 252041d into main Dec 17, 2025
16 checks passed
@joshrotenberg joshrotenberg deleted the feat/module-name-lookup branch December 17, 2025 20:05
@joshrotenberg joshrotenberg mentioned this pull request Dec 17, 2025
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.

2 participants