Skip to content

cli: add doublezero geolocation user subcommands#3715

Merged
ben-dz merged 1 commit into
mainfrom
bdz/geolocation-user-subtree
May 19, 2026
Merged

cli: add doublezero geolocation user subcommands#3715
ben-dz merged 1 commit into
mainfrom
bdz/geolocation-user-subtree

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented May 18, 2026

Stacked on #3713 (PR 2: doublezero geolocation probe).

Summary of Changes

  • Adds doublezero geolocation user <create|delete|update|get|list|add-target|remove-target|set-result-destination|update-payment> to the doublezero CLI, mirroring the existing doublezero-geolocation user surface
  • Wires UserCliCommand / UserCommands via the existing Command::Geolocation dispatch arm (no new client construction — reuses GeoClient / GeoCliCommandImpl from the probe arm)

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 2 +98 / -6 +92
Scaffolding 6 +138 / -6 +132
Docs 1 +4 / -0 +4

Purely additive clap wiring for the PR-3 slice; the larger config/set.rs changes 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: clap UserCliCommand / UserCommands enum mirroring doublezero-geolocation-cli/src/cli/user.rs
  • client/doublezero/src/main.rsGeolocationCommands::User dispatch arm; GeoUserCommands import alias
  • client/doublezero/src/cli/geolocation/mod.rs — registers pub mod user and adds User(UserCliCommand) variant to GeolocationCommands
  • smartcontract/cli/src/config/set.rs — (base PR 1) --geo-program-id flag, validation, persistence, and two new tests
  • smartcontract/cli/src/config/get.rs — (base PR 1) displays Geolocation Program ID in config get output

Testing Verification

  • cargo check -p doublezero — clean
  • make 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

@ben-dz ben-dz marked this pull request as draft May 18, 2026 16:35
@ben-dz ben-dz force-pushed the bdz/geolocation-probe-subtree branch from f3e46d0 to 50c8027 Compare May 18, 2026 17:18
Base automatically changed from bdz/geolocation-probe-subtree to main May 18, 2026 19:05
@ben-dz ben-dz force-pushed the bdz/geolocation-user-subtree branch from 454f635 to e2c3c0e Compare May 18, 2026 19:11
@ben-dz ben-dz marked this pull request as ready for review May 18, 2026 19:31
@ben-dz ben-dz requested a review from juan-malbeclabs May 18, 2026 19:31
@ben-dz ben-dz force-pushed the bdz/geolocation-user-subtree branch from e2c3c0e to b7c23c0 Compare May 18, 2026 20:47
@ben-dz ben-dz enabled auto-merge (squash) May 18, 2026 20:55
@ben-dz ben-dz merged commit 4ad2937 into main May 19, 2026
37 of 38 checks passed
@ben-dz ben-dz deleted the bdz/geolocation-user-subtree branch May 19, 2026 12:46
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
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