Skip to content

cli: add --json flag to device get command#3154

Open
martinsander00 wants to merge 1 commit intomainfrom
ms/3036
Open

cli: add --json flag to device get command#3154
martinsander00 wants to merge 1 commit intomainfrom
ms/3036

Conversation

@martinsander00
Copy link
Contributor

@martinsander00 martinsander00 commented Mar 3, 2026

Resolves: #3036

Summary

  • Add --json and --json-compact flags to doublezero device get --code <code> for machine-readable output
  • Follows the same pattern used by all existing list commands (device list, user list, etc.)
  • Introduces a DeviceGetDisplay struct with proper serde serialization (pubkeys as base58 strings, network prefixes as CIDR strings)

Lines of Code

Section Added Removed
cli +111 -28
tests +47 -4

Testing Verification

  • Added test_cli_device_get_json unit test validating JSON output parses correctly and contains expected field values
  • Existing test_cli_device_get updated and continues to pass, confirming no regression in text output

@martinsander00 martinsander00 requested a review from nikw9944 March 3, 2026 05:37
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.

Add --json to doublezero device get --code <code>

1 participant