fix(cli): apps-cli — skycoin daemon list --json, group catalog self-listing, help polish - #4076
Open
0pcom wants to merge 1 commit into
Open
fix(cli): apps-cli — skycoin daemon list --json, group catalog self-listing, help polish#40760pcom wants to merge 1 commit into
0pcom wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit + fixes across the skychat / skycoin / mail CLI command groups
(
cmd/skywire-cli/commands/{skychat,skycoin,mail}/). Strictly backwardcompatible — no flag renames, no output-shape changes for existing
--jsonconsumers.
Fixes
skycoin daemon list --json: previously passedniltoPrintOutput, so--json/--jqemitted an empty object. Now collects thedaemon rows and emits an array of
{name,auto_start,status,fiber_toml}.skychat group catalog(no host arg): the documented "omit the key tosee your own listing" form errored with
Invalid public key. A zerocipher.PubKeycannot be gob-encoded over net/rpc, so the visor'szero-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 theShortdescription for consistencywith every other subcommand.
skychat send: removed the redundant(default 1)embedded in the--retrieshelp text (cobra already appends the default, so it renderedtwice).
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.to fail cleanly (no crashes) with clear messages.
Follow-ups (not in this PR)
--jsoncommands (alias ls,history,status,listen,pair list/poll,group history/listen) ignore the global--jq/--shapebecause they marshal their own shape rather than routingthrough
internal.PrintOutput. Converging them risks changing establishedoutput shapes, so it's left as a separate change.