Skip to content

feat: cluster subcommands#77

Merged
kacy merged 1 commit intomainfrom
feat/cli-cluster-subcommands
Feb 10, 2026
Merged

feat: cluster subcommands#77
kacy merged 1 commit intomainfrom
feat/cli-cluster-subcommands

Conversation

@kacy
Copy link
Copy Markdown
Owner

@kacy kacy commented Feb 10, 2026

summary

adds ember-cli cluster <action> subcommands for cluster management. restructures clap args to support named subcommands (cluster, benchmark) alongside the existing one-shot mode via external_subcommand.

new CLI modes:

  • ember-cli → REPL (unchanged)
  • ember-cli SET key value → one-shot (unchanged, via external_subcommand catch-all)
  • ember-cli cluster info → typed cluster subcommand
  • ember-cli benchmark → stub (wired in next PR)

cluster subcommands: info, nodes, slots, keyslot, myid, meet, forget, addslots, delslots, setslot (with importing/migrating/node/stable sub-actions), replicate, failover (with --force/--takeover), countkeysinslot, getkeysinslot.

what was tested

  • 19 unit tests for to_tokens() covering every cluster subcommand variant
  • all 66 CLI tests pass (cargo test -p emberkv-cli)
  • full workspace: cargo clippy --workspace -- -D warnings, cargo fmt --all --check, cargo test --workspace (excluding pre-existing integration flake on ping_with_message)

design considerations

  • used clap #[command(external_subcommand)] to preserve backwards compatibility — raw one-shot commands like ember-cli SET key value still work without a subcommand prefix
  • ClusterCommand::to_tokens() converts typed args to wire-format token arrays, keeping the connection/serialization layer unchanged
  • SetslotAction is a nested subcommand enum for the setslot sub-actions (importing, migrating, node, stable)
  • benchmark variant is stubbed as a placeholder — will be wired in the next PR

restructure clap args to use subcommands with external_subcommand
as the catch-all for raw one-shot commands. adds a typed
ClusterCommand enum covering all cluster operations (info, nodes,
slots, meet, forget, addslots, delslots, setslot, replicate,
failover, etc.) with to_tokens() conversion and run_cluster()
execution. includes a benchmark stub for the next PR.
@kacy kacy merged commit 7510fa0 into main Feb 10, 2026
7 checks passed
@kacy kacy deleted the feat/cli-cluster-subcommands branch February 10, 2026 02:30
kacy added a commit that referenced this pull request Feb 11, 2026
restructure clap args to use subcommands with external_subcommand
as the catch-all for raw one-shot commands. adds a typed
ClusterCommand enum covering all cluster operations (info, nodes,
slots, meet, forget, addslots, delslots, setslot, replicate,
failover, etc.) with to_tokens() conversion and run_cluster()
execution. includes a benchmark stub for the next PR.
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