feat(skywire-cli): svc gains --testenv + URL overrides + fetch-chain flags; --jq/--shape parity - #4077
Merged
0pcom merged 1 commit intoAug 22, 2026
Conversation
0pcom
force-pushed
the
feat/svc-testenv-url-overrides-output-parity
branch
from
August 22, 2026 23:53
0c383a5 to
472186d
Compare
…etch-chain flags; structured-output parity The svc command group hardcoded deployment.Prod.* in every subcommand and exposed only --direct/--rpc — unlike sd/ut, which offer --testenv and per-service URL overrides. It also accepted --jq/--shape but ignored them on the pretty-print subcommands (output went through internal.PrintOutput, only 'ar check' routed through the flag-aware cliout printer). Deployment / fetch-chain (item D): - add persistent flags on svc RootCmd, inherited by every subcommand: --testenv (or SKYWIRETEST=1), --tpdurl/--dmsgdurl/--arurl overrides, and the --no-cxo/--no-rpc/--no-dmsg/--sk/--config fetch-chain controls. - resolve each subcommand's base URL through baseURLFor(service), which honors --testenv and the overrides, instead of literal deployment.Prod.*. - thread the same resolution through 'svc health' direct queries. Structured output (item E): - emitPretty now routes --json/--jq/--shape through cliout.Print so they work uniformly across the svc pretty-print subs; the default human view stays pretty-indented JSON (unchanged). Backward-compatible: defaults are prod/empty, so existing invocations are unchanged. Verified: new flags inherited by all svc subs (standalone + combined binary); --json/--jq/--shape work on 'svc tpd stats'; --direct --tpdurl override reaches the fetch URL.
0pcom
force-pushed
the
feat/svc-testenv-url-overrides-output-parity
branch
from
August 22, 2026 23:54
472186d to
e74cc62
Compare
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.
Converges the
svccommand group toward the deployment-selection and structured-output vocabulary the rest of the CLI already uses. Strictly backward-compatible (defaults are prod / empty).D — deployment-service URL + fetch-flag unification (svc slice)
svchardcodeddeployment.Prod.*in every subcommand and exposed only--direct/--rpc— unlikesd/ut, which offer--testenvand per-service URL overrides, and unlike the fetch-chain flags (--no-cxo/--no-rpc/--no-dmsg) present onut.svcRootCmd, inherited by every subcommand:--testenv(orSKYWIRETEST=1),--tpdurl/--dmsgdurl/--arurl, and the--no-cxo/--no-rpc/--no-dmsg/--sk/--configfetch-chain controls.fetchViaVisorOrDirectresolves each subcommand's base URL viabaseURLFor(service)(honors--testenv+ overrides) instead of literaldeployment.Prod.*.svc health's direct queries use the same resolution.E — structured-output parity
--jq/--shapewere accepted but ignored on thesvcpretty-print subs (output went throughinternal.PrintOutput; onlyar checkused the flag-awareclioutprinter).emitPrettynow routes--json/--jq/--shapethroughcliout.Print; the default human view stays pretty-indented JSON.Validation (standalone + combined binaries built locally)
go build ./cmd/skywire-cli/ .clean.svc tpd stats --help,svc health --helpshow them as Global Flags under the combined binary).svc tpd stats --json(compact when piped),--jq 'keys',--jq '.total_transports',--shapeall work; bare command still prints pretty JSON.svc tpd stats --direct --tpdurl http://127.0.0.1:9reaches the override URL in the fetch (fails to map, as expected) — proving the override is threaded.Deferred (design note)
--rpc/--directare still registered per-subcommand rather than once on the svc root; left as-is to keep the diff focused and avoid duplicate-flag churn. Folding them onto the root persistent set is a safe follow-up.sd's--sdurl/--uturl,ut's--url, hidden aliases so every group shares one spelling) is not attempted here — this PR bringssvcup to parity as the highest-value slice.DmsgURLForHTTP/cxoFeedForURLmap onlydeployment.Prod.*prefixes, so a raw non-prod--*urloverride (or--testenv) is only fully effective on the--directpath when the target is already admsg://URL. This is a pre-existing fetch-chain property shared withsd/ut, not introduced here; teaching the mapping aboutdeployment.Test.*would be a separate change across the whole CLI.