Skip to content

Add --output=json support to account and du commands - #273

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
account-du-json-output
Jun 23, 2026
Merged

Add --output=json support to account and du commands#273
AndreyVMarkelov merged 1 commit into
masterfrom
account-du-json-output

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Migrate account and du to emit structured JSON when --output=json is used
  • Add usersClient interface and usersNewFunc factory for testability (same pattern as filesNewFunc)
  • account outputs full/basic account metadata with name, email, team info
  • du outputs usage and allocation details (individual + team with space limit fields)
  • Text rendering now writes to io.Writer instead of os.Stdout
  • Fix: renderBasicAccount no longer mutates the input BasicAccount.Email field

Test plan

  • go vet ./... clean
  • golangci-lint run ./... clean
  • All tests pass (go test ./... -count=1)
  • Manual: dbxcli account --output=json emits JSON with full account metadata
  • Manual: dbxcli account --output=json <account-id> emits JSON with basic account lookup
  • Manual: dbxcli du --output=json emits JSON with usage and allocation
  • Manual: dbxcli account and dbxcli du text output unchanged

Migrate account and du to emit structured JSON. Add usersClient
interface and factory for testability. Account outputs full/basic
account metadata; du outputs usage and allocation details including
team space fields.
@AndreyVMarkelov
AndreyVMarkelov merged commit cc26db3 into master Jun 23, 2026
7 checks passed
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