Skip to content

refactor(youtube): adopt kit/console/cli + conventions parity#6

Merged
jadb merged 4 commits into
mainfrom
cli-parity-foo-youtube
Jun 17, 2026
Merged

refactor(youtube): adopt kit/console/cli + conventions parity#6
jadb merged 4 commits into
mainfrom
cli-parity-foo-youtube

Conversation

@jadb

@jadb jadb commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Migrates the foo-youtube sidecar from Go's stdlib flag to kit/console/cli, resolving the red-verdict findings from the CLI review.

Changes

  • kit/console/cli root — replace stdlib flag with a cobra root via cli.New (Use: "foo-youtube [flags] <url>"). Fixes the stdlib usage-leak and weak -h; brings kit-styled help, --version, --help-all.
  • <url> documented — positional now appears in --help with accepted URL forms.
  • Exit codes — invalid/missing URL → 2, missing yt-dlp → 5, fetch failures → 1, routed through kit's error model.
  • Flag negation — add --no-metadata / --no-transcript for the boolean defaults.
  • Events — publish foo-youtube.capture.transcript.fetched / foo-youtube.capture.metadata.fetched after successful extraction (respecting the metadata/transcript flags); failed fetches publish nothing.

Contract preserved

  • --ext-info emits the four-field discovery JSON, now including the previously-missing capabilities: ["discover"], exit 0.

Verification

  • go build ./... + go vet ./cmd/foo-youtube/... clean.
  • ext-info, --help (<url> shown), and exit codes (no-args → 2, missing-dep → 5) probed.

Copilot AI review requested due to automatic review settings June 16, 2026 16:28

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

jadb added 4 commits June 17, 2026 01:31
wire kit/bus + NetworkAdapter (source foo-youtube); peers env
FOO_YOUTUBE_BUS_PEERS, auth FOO_BUS_TOKEN/BUS_TOKEN; connect best-effort,
never fatal. publish capture.metadata.fetched + capture.transcript.fetched
after successful extraction, payload {url}. failed fetch publishes nothing.
ext-info contract + exit codes unchanged.
@jadb jadb force-pushed the cli-parity-foo-youtube branch from 1c715da to 9384711 Compare June 17, 2026 05:32
@jadb jadb merged commit dc56d4f into main Jun 17, 2026
2 checks passed
@jadb jadb deleted the cli-parity-foo-youtube branch June 17, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants