Need
infrahub_sdk/ctl/marketplace.py (~700 lines, 4 commands) has grown into an
architectural island within infrahubctl. It diverges from the shared CLI
conventions documented in infrahub_sdk/ctl/AGENTS.md on several axes:
- Client — builds a raw
httpx.AsyncClient via its own _make_http_client()
(re-deriving proxy/TLS config from the SDK config) instead of the shared
initialize_client(). initialize_client is never imported here.
- Error handling — ships a parallel error framework (
_ErrorClass, _fail(),
_classify_http_error(), _fail_http_error()) alongside the shared
catch_exception / handle_exception in ctl/utils.py.
- Output — defines its own
console / err_console (Console(stderr=True))
stderr channel rather than the shared console pattern.
The result is effectively a mini-app: contributors touching marketplace commands
have to learn a second set of patterns, fixes to the shared client/error layer
do not reach it, and the divergence quietly undercuts the conventions the rest of
the CLI (and ctl/AGENTS.md) rely on.
Context
- The file already imports and uses the shared
catch_exception decorator, so it
is only partially integrated — the two systems currently coexist.
- Some divergence may be justified (e.g. the marketplace talks to public
/api/v1/... endpoints that may not require an authenticated Infrahub client);
scoping which parts should converge vs. stay bespoke is part of the work.
References
Need
infrahub_sdk/ctl/marketplace.py(~700 lines, 4 commands) has grown into anarchitectural island within
infrahubctl. It diverges from the shared CLIconventions documented in
infrahub_sdk/ctl/AGENTS.mdon several axes:httpx.AsyncClientvia its own_make_http_client()(re-deriving proxy/TLS config from the SDK config) instead of the shared
initialize_client().initialize_clientis never imported here._ErrorClass,_fail(),_classify_http_error(),_fail_http_error()) alongside the sharedcatch_exception/handle_exceptioninctl/utils.py.console/err_console(Console(stderr=True))stderr channel rather than the shared console pattern.
The result is effectively a mini-app: contributors touching marketplace commands
have to learn a second set of patterns, fixes to the shared client/error layer
do not reach it, and the divergence quietly undercuts the conventions the rest of
the CLI (and
ctl/AGENTS.md) rely on.Context
catch_exceptiondecorator, so itis only partially integrated — the two systems currently coexist.
/api/v1/...endpoints that may not require an authenticated Infrahub client);scoping which parts should converge vs. stay bespoke is part of the work.
References
infrahub_sdk/ctl/AGENTS.md(Command Pattern)