Skip to content

search --json prints update notice after JSON on stdout in non-current versions, breaking machine consumers #129

@bishopmatthew

Description

@bishopmatthew

Summary

In skillshare 0.18.9, skillshare search ... --json can append the
update notice to stdout after the JSON payload:

! Update available: 0.18.9 -> 0.19.0
  Run 'skillshare upgrade' to update

That makes stdout invalid JSON and breaks any tool that shells out to
skillshare search --json and unmarshals the result directly.

Affected Version

Observed on 0.18.9.

The failing output itself included:

! Update available: 0.18.9 -> 0.19.0
  Run 'skillshare upgrade' to update

After upgrading to the latest version, the problem no longer reproduces.

Reproduction

Run:

skillshare search bubbletea --json

On 0.18.9, stdout contained:

  1. a valid JSON array of results
  2. then the update notice appended after the array

So the full stdout was not valid JSON.

Expected

When --json is passed, stdout should contain only JSON.

Any upgrade/update notice should go to stderr, or be suppressed entirely in
JSON mode.

Actual

Stdout was:

[
  {
    "Name": "bubbletea",
    "Description": "Browse Bubbletea TUI framework documentation and examples. Use when working with Bubbletea components, models, commands, or building terminal user interfaces in Go.",
    "Source": "hmans/beans/.claude/skills/bubbletea",
    "Skill": "",
    "Stars": 678,
    "Owner": "hmans",
    "Repo": "beans",
    "Path": ".claude/skills/bubbletea",
    "Tags": null
  }
]

followed by:

! Update available: 0.18.9 -> 0.19.0
  Run 'skillshare upgrade' to update

That causes JSON parsers to fail with errors like:

invalid character '!' after top-level value

Why This Matters

This broke a wrapper tool that shells out to skillshare search --json
and unmarshals stdout directly.

In general, --json is a machine contract, so any human-oriented trailing
text on stdout is a compatibility break.

Suggested Fix

  • guarantee that --json writes only JSON to stdout
  • move update notices to stderr
  • add a regression test for search --json to assert stdout is pure JSON

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions