cli/serviceability: move per-resource subcommand wrappers into module crate#3759
Open
juan-malbeclabs wants to merge 1 commit into
Open
cli/serviceability: move per-resource subcommand wrappers into module crate#3759juan-malbeclabs wants to merge 1 commit into
juan-malbeclabs wants to merge 1 commit into
Conversation
d539f1c to
4196e46
Compare
aeaa287 to
f274db8
Compare
This was referenced May 22, 2026
4196e46 to
a65bc24
Compare
f274db8 to
17d3095
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC-20 implementation stack
This PR is part of a 9-PR chain delivering RFC-20: CLI standardization. Each PR's diff is only its own contribution; reviewers should consume them in order.
doublezero-cli-corefoundation crate +solana_l1_rpc_url--solana-url+--log-verboseglobal flags + tracing initCliContextbuilt inmain+ centralized error renderingdoublezero_cli→doublezero-serviceability-clilocation getas the async +CliContextreference verbdocs/cli-standard.md+CLAUDE.mdpointerServiceabilityCommandenum + async dispatcher#[command(flatten)]+ collapse binary dispatchThis PR: #3759 — position 7 of 9. Previous: #3758 · Next: #3760
Summary of Changes
accesspass,config,contributor,device,exchange,globalconfig,link,location,multicastgroup,permission,resource,tenant,user) fromclient/doublezero/src/cli/into thedoublezero-serviceability-climodule crate atsmartcontract/cli/src/cli/, per RFC-20 §Module contract item 2 ("the module crate exports the subcommand enum").smartcontract/cli/src/cli/mod.rsandpub mod cli;in the library'slib.rsso the new module is reachable.doublezero_serviceability_cli::<resource>::*->crate::<resource>::*) and in the binary (client/doublezero/src/{cli/command.rs,main.rs}switch todoublezero_serviceability_cli::cli::<resource>::*for the moved types).cli/multicast.rsstays in the binary: itsSubscribe,Unsubscribe,Publish, andUnpublishvariants are async and theirexecuteimpls live inclient/doublezero/src/command/multicast.rs(binary-local), depending onServiceControllerImplandcrate::command::helpers::resolve_client_ip. The binary'scli/multicast.rsnow importsMulticastGroupCliCommandfrom the library.Commandenum reshape, nomain.rsdispatch change. Pure file relocation. The next PR adds the top-levelServiceabilityCommandenum; the PR after that wires it into the binary via#[command(flatten)]and collapses the dispatch.Diff Breakdown
Pure file moves (tracked as renames in git, ~95% similarity each) plus import-path rewrites in the binary and the new library
cli/mod.rs. Behavior unchanged.Key files (click to expand)
smartcontract/cli/src/cli/mod.rs(new) - declares the 13 moved modules.smartcontract/cli/src/lib.rs- addspub mod cli;.client/doublezero/src/cli/mod.rs- keeps onlycommand,geolocation, andmulticast(the binary-local ones).client/doublezero/src/cli/command.rs- importsMulticastCliCommandfromcrate::cliand the 13 moved types fromdoublezero_serviceability_cli::cli::*.client/doublezero/src/cli/multicast.rs- importsMulticastGroupCliCommandfrom the library.client/doublezero/src/main.rs- imports the moved subcommand enums (DeviceCommands,LinkCommands, ...) fromdoublezero_serviceability_cli::cli::*; the per-resource match arms switch fromcli::<resource>::*Commands::*todoublezero_serviceability_cli::cli::<resource>::*Commands::*.Testing Verification
cargo check --workspaceclean.make rust-testgreen workspace-wide (including thecargo test -p doublezero-serviceability-cli location::getreference verb).make rust-lintclean.cargo run -p doublezero -- --helpandcargo run -p doublezero -- device list --helpproduce the same command tree as before; the relocation is invisible to users.jo/6-docs-cli-standard; the diff shown is only this PR's contribution. Follow-ups #PR8 (addServiceabilityCommandenum) and #PR9 (flatten in binary + collapse dispatch) complete the RFC-20 §Module contract item 2 work.