cli: add doublezero geolocation user subcommands#3715
Merged
Conversation
f3e46d0 to
50c8027
Compare
454f635 to
e2c3c0e
Compare
juan-malbeclabs
approved these changes
May 18, 2026
e2c3c0e to
b7c23c0
Compare
ben-dz
added a commit
that referenced
this pull request
May 19, 2026
Stacked on #3715 (PR 3: \`doublezero geolocation user\`). Base branch: \`bdz/geolocation-user-subtree\`. ## Summary of Changes - Adds a hidden top-level \`doublezero init-geolocation-config\` command that delegates to \`InitProgramConfigCliCommand\`, mirroring \`doublezero-geolocation init-config\` - Follows the same \`#[command(hide = true)]\` pattern as the existing \`Init\` and \`Migrate\` hidden commands ## Diff Breakdown | Category | Files | Lines (+/-) | Net | |--------------|-------|-------------|------| | Scaffolding | 2 | +13 / -0 | +13 | | Docs | 1 | +1 / -0 | +1 | Pure wiring — no new logic, just hooking \`InitProgramConfigCliCommand\` into the existing \`doublezero\` binary. <details> <summary>Key files (click to expand)</summary> - \`client/doublezero/src/cli/command.rs\` — adds \`InitGeolocationConfig(InitProgramConfigCliCommand)\` hidden variant; imports \`InitProgramConfigCliCommand\` into the \`doublezero_cli\` use block - \`client/doublezero/src/main.rs\` — wires \`Command::InitGeolocationConfig\` dispatch arm; constructs \`GeoClient\` + \`GeoCliCommandImpl\` inline, identical to the \`Command::Geolocation\` pattern </details> ## Testing Verification - \`cargo check -p doublezero\` passes clean - \`make rust-fmt && make rust-lint\` pass with no warnings - \`doublezero init-geolocation-config --help\` shows the expected clap help (including \`--yes\`) - \`doublezero --help | grep init-geolocation\` produces no output, confirming the command is hidden
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.
Stacked on #3713 (PR 2:
doublezero geolocation probe).Summary of Changes
doublezero geolocation user <create|delete|update|get|list|add-target|remove-target|set-result-destination|update-payment>to thedoublezeroCLI, mirroring the existingdoublezero-geolocation usersurfaceUserCliCommand/UserCommandsvia the existingCommand::Geolocationdispatch arm (no new client construction — reusesGeoClient/GeoCliCommandImplfrom the probe arm)Diff Breakdown
Purely additive clap wiring for the PR-3 slice; the larger
config/set.rschanges are from the base PRs (1–2) included in this diff.Key files (click to expand)
client/doublezero/src/cli/geolocation/user.rs— new file: clapUserCliCommand/UserCommandsenum mirroringdoublezero-geolocation-cli/src/cli/user.rsclient/doublezero/src/main.rs—GeolocationCommands::Userdispatch arm;GeoUserCommandsimport aliasclient/doublezero/src/cli/geolocation/mod.rs— registerspub mod userand addsUser(UserCliCommand)variant toGeolocationCommandssmartcontract/cli/src/config/set.rs— (base PR 1)--geo-program-idflag, validation, persistence, and two new testssmartcontract/cli/src/config/get.rs— (base PR 1) displays Geolocation Program ID inconfig getoutputTesting Verification
cargo check -p doublezero— cleanmake rust-fmt && make rust-lint— clean (all 8 crates)doublezero geolocation user --help— lists all 9 subcommands:create,delete,update,get,list,add-target,remove-target,set-result-destination,update-payment