Skip to content

feat(cli): machine-readable output for editor and automation integrations - #499

Merged
Harsh4902 merged 1 commit into
microcks:masterfrom
Caesarsage:feat/vscode-service-test-json-commands
Aug 13, 2026
Merged

feat(cli): machine-readable output for editor and automation integrations#499
Harsh4902 merged 1 commit into
microcks:masterfrom
Caesarsage:feat/vscode-service-test-json-commands

Conversation

@Caesarsage

Copy link
Copy Markdown
Contributor

Give the human-facing commands a structured --output json mode so the Microcks
VS Code extension (and CI/automation) can drive the CLI without scraping text.
The rule throughout: stdout carries the structured result, stderr carries
progress and diagnostics
, so a consumer can parse stdout cleanly while a human
still sees what's happening.

This is the CLI half of the VS Code integration (LFX mentorship, D3). The
extension is using the CLI as communication interface than re-implementing Microcks
auth, context, and lifecycle logic API.

Depends on

Stacked on #488 (--output framework), which is itself stacked on #491
(→ #490, error-handling refactor). This branch imports pkg/output,
pkg/errors Kind classification, and connectors.GetFullTestResult — none of
which exist on master yet — so it will not compile standalone.

Do not merge until #491 and #488 have landed. Merge order:

  1. refactor(cli): migrate commands to RunE with a single exit funnel #490refactor(cli): remove the legacy exit shim and enforce it in CI #491 (error-handling refactor)
  2. Rebase/update feat(test): add --output (text/json/yaml/github-actions) for machine-readable results #488, then merge
  3. Rebase this branch onto updated master, then merge

What's in it

  • capabilities commandmicrocks capabilities [--output json] emits a
    versioned contract (schemaVersion, cliVersion, capabilities[]) so a
    consumer can feature-detect before depending on any JSON shape.
  • context --output json — list/use/delete now speak JSON; an empty config
    returns [] as a valid disconnected state.
  • start --output json — prints only the structured start result on stdout;
    image-pull and readiness progress move to stderr.
  • import --output json — emits an array of import results.
  • test --dry-run --watch --output json — a newline-delimited JSON event
    stream (ready → imported → test-result → waiting → … → stopped), since a
    long-running watch can't wait for one final document.
  • Service/test query JSON contracts (service list/get, test list/get) and
    their documentation.

Testing

  • go build ./..., go vet ./..., go test ./... all pass.
  • New tests cover context JSON output (list/use/empty-config) and the dry-run
    event writer (well-formed and malformed events).

Docs

documentation/cmd/{capabilities,context,import,start,test,service}.md and the
command table in README.md are updated for the new flags and JSON contracts.

@Harsh4902

Copy link
Copy Markdown
Member

@Caesarsage Can you please resolve conflicts for this PR?

@Harsh4902 Harsh4902 added this to the Next milestone Aug 11, 2026
@Harsh4902 Harsh4902 added the lfx-mentorship PR/Issue which is part of LFX mentorship label Aug 11, 2026
@Caesarsage
Caesarsage force-pushed the feat/vscode-service-test-json-commands branch from e6b9171 to 0292dd4 Compare August 12, 2026 10:40

@Vaishnav88sk Vaishnav88sk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase this branch after #488 is merged

Comment thread cmd/capabilities.go
Comment thread pkg/connectors/microcks_client.go
@Caesarsage
Caesarsage force-pushed the feat/vscode-service-test-json-commands branch from 72d8bc3 to e20c066 Compare August 12, 2026 12:09
Signed-off-by: caesarsage <destinyerhabor6@gmail.com>
@Caesarsage
Caesarsage force-pushed the feat/vscode-service-test-json-commands branch from aa904f2 to 69d220c Compare August 12, 2026 15:59
@Vaishnav88sk

Copy link
Copy Markdown

Looks perfect 👍🏻 @Harsh4902
Thank you, @Caesarsage, for strengthening the microcks' CLI.

@Harsh4902
Harsh4902 dismissed Vaishnav88sk’s stale review August 13, 2026 03:55

Dismissing this as @Vaishnav88sk's commented LGTM.

@Harsh4902 Harsh4902 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge. Thanks @Caesarsage

@Harsh4902
Harsh4902 merged commit 424887c into microcks:master Aug 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/cli lfx-mentorship PR/Issue which is part of LFX mentorship

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants