Skip to content

fix(cli): apps-cli — skycoin daemon list --json, group catalog self-listing, help polish - #4076

Open
0pcom wants to merge 1 commit into
skycoin:developfrom
0pcom:fix/apps-cli-json-catalog
Open

fix(cli): apps-cli — skycoin daemon list --json, group catalog self-listing, help polish#4076
0pcom wants to merge 1 commit into
skycoin:developfrom
0pcom:fix/apps-cli-json-catalog

Conversation

@0pcom

@0pcom 0pcom commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Audit + fixes across the skychat / skycoin / mail CLI command groups
(cmd/skywire-cli/commands/{skychat,skycoin,mail}/). Strictly backward
compatible — no flag renames, no output-shape changes for existing --json
consumers.

Fixes

  • skycoin daemon list --json: previously passed nil to
    PrintOutput, so --json/--jq emitted an empty object. Now collects the
    daemon rows and emits an array of {name,auto_start,status,fiber_toml}.
  • skychat group catalog (no host arg): the documented "omit the key to
    see your own listing" form errored with Invalid public key. A zero
    cipher.PubKey cannot be gob-encoded over net/rpc, so the visor's
    zero-PK-means-self branch was never reached. The CLI now resolves the local
    visor's own PK via Overview() and sends it explicitly.
  • skychat send-file: capitalized the Short description for consistency
    with every other subcommand.
  • skychat send: removed the redundant (default 1) embedded in the
    --retries help text (cobra already appends the default, so it rendered
    twice).

Verification

Built and run against a live visor:

  • skycoin daemon list --json → proper JSON array; --jq '.[].name' works.
  • skychat group catalog (no arg) → nothing published (self listing)
    instead of Invalid public key.
  • Error paths for send/history/status/listen/pair/group/voice/mail confirmed
    to fail cleanly (no crashes) with clear messages.

Follow-ups (not in this PR)

  • Several hand-rolled---json commands (alias ls, history, status,
    listen, pair list/poll, group history/listen) ignore the global
    --jq/--shape because they marshal their own shape rather than routing
    through internal.PrintOutput. Converging them risks changing established
    output shapes, so it's left as a separate change.

…self-listing, help polish

Audit + fixes across the skychat / skycoin / mail CLI groups:

- skycoin daemon list: pass the collected daemon rows to PrintOutput
  instead of nil, so `--json` / `--jq` emit an array of
  {name,auto_start,status,fiber_toml} instead of an empty object.
- skychat group catalog: with no host arg, resolve the local visor's
  own PK via Overview() before the RPC. A zero cipher.PubKey cannot be
  gob-encoded over net/rpc ("Invalid public key"), so the documented
  "omit the key to see your own listing" form previously errored out.
- skychat send-file: capitalize the Short description for consistency
  with every other subcommand.
- skychat send: drop the redundant "(default 1)" embedded in the
  --retries help text (cobra already appends the default).

Strictly backward compatible: no flag renames, no output-shape changes
for existing --json consumers of the affected commands.
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