Skip to content

feat(cli): add --json output to paired-devices add/remove - #345

Open
neto7z wants to merge 2 commits into
Oppzippy:masterfrom
neto7z:feat/cli-json-add-remove
Open

neto7z wants to merge 2 commits into
Oppzippy:masterfrom
neto7z:feat/cli-json-add-remove

Conversation

@neto7z

@neto7z neto7z commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closes #221

Extends the existing --json support to the last two paired-devices commands that still printed plain text:

  • paired-devices add --json now outputs the paired device as an object with the same shape as paired-devices list --json (macAddress / model / isDemo, camelCase).
  • paired-devices remove --json now outputs the removed mac address: {"macAddress": "00:00:00:00:00:02"}.

Human-readable output (Paired / Unpaired) is unchanged, and --json was not previously accepted by these two commands.

Tested headless with demo devices (--demo) against a throwaway database. cargo clippy -p openscq30-cli -- -D warnings and cargo fmt --all -- --check both pass.

Example:

$ openscq30 paired-devices add --json -a 00:00:00:00:00:02 -m SoundcoreA3028 --demo
{
  "macAddress": "00:00:00:00:00:02",
  "model": "SoundcoreA3028",
  "isDemo": true
}

$ openscq30 paired-devices remove --json -a 00:00:00:00:00:02
{
  "macAddress": "00:00:00:00:00:02"
}

ecaloths and others added 2 commits August 8, 2026 13:10
Extends the machine-parsable JSON output to the remaining paired-devices
commands. `add --json` emits the paired device in the same shape as
`paired-devices list --json`, and `remove --json` emits the mac address
that was removed. Human-readable output is unchanged.

Closes Oppzippy#221

Co-Authored-By: Claude <noreply@anthropic.com>
@Oppzippy

Oppzippy commented Aug 23, 2026 •

Copy link
Copy Markdown
Owner

Sorry for the delay reviewing.

Is this useful? It's only outputting information that was passed in via CLI arguments, so the caller has all of this information already.

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.

[Feature Request] Add a parsable JSON output from the CLI interface

3 participants