Skip to content

Add YouTube search command#650

Open
BRO3886 wants to merge 3 commits into
openclaw:mainfrom
BRO3886:feat/youtube-search
Open

Add YouTube search command#650
BRO3886 wants to merge 3 commits into
openclaw:mainfrom
BRO3886:feat/youtube-search

Conversation

@BRO3886
Copy link
Copy Markdown

@BRO3886 BRO3886 commented May 28, 2026

Summary

  • Adds gog youtube search ls <query> (aliases: gog yt search ls, gog yt find ls) backed by YouTube Data API v3 search.list endpoint
  • Supports --type (video, channel, playlist — comma-separated), --order (relevance, date, rating, title, viewCount), --channel-id filtering, --max, --page pagination
  • Uses OAuth when --account is provided, falls back to API key otherwise
  • Validates --type values individually and --order via kong enum tag
  • Table and JSON output follow existing YouTube command patterns
  • Generated command docs updated via make docs-commands

Live proof

Basic search:

$ gog yt search ls "mikey posada productivity" --max 3 --account user@gmail.com
# Next page: --page CAMQAA
KIND   ID           TITLE                                                           CHANNEL       PUBLISHED_AT
video  Uw-oPV31XxA  Being productive is easy, actually.                             Mikey Posada  2026-05-13T12:00:51Z
video  rDgZSiOMQ84  Rest ≠ Reward: How to do more, in less time, with less stress.  Mikey Posada  2024-12-22T14:00:48Z
video  4nY-JcTKDoE  #productivity                                                   Mikey Posada  2026-05-09T15:59:30Z

With --type, --order flags:

$ gog yt search ls "golang concurrency" --max 3 --type video --order date --account user@gmail.com
# Next page: --page CAMQAA
KIND   ID           TITLE                                                                                  CHANNEL                      PUBLISHED_AT
video  2xwUyoXIj88  How to implement concurrency with goroutine,channel and waitgroup  #faangprep #golang  Sharda Learning Center       2026-05-26T16:46:19Z
video  FlVGvwQEpCA  Почему Go так быстрый? Разбираем горутины, каналы и конкурентность                     Владимир Балун               2026-05-26T13:26:55Z
video  aYH7LypVYKM  Concurrent Weather Fetcher | Weekend Dev 50 | Golang Projects                          Learn to Code with CodeChef  2026-05-26T05:18:33Z

Validation (invalid --type):

$ gog yt search ls "test" --type invalid --account user@gmail.com
--type must be video, channel, or playlist (comma-separated)

Test plan

  • TestYouTubeSearchWithAPIKey — verifies query param, table output fields
  • TestYouTubeSearchWithOAuth — verifies OAuth path passes account through
  • TestYouTubeSearchTypeValidation — verifies invalid type rejected before API call
  • All 6 YouTube tests pass
  • Manual testing with live YouTube API (output above)
  • Generated command docs updated (make docs-commands)

Implements `gog youtube search ls <query>` backed by the YouTube Data
API v3 search.list endpoint. Supports --type (video, channel, playlist),
--order (relevance, date, rating, title, viewCount), --channel-id
filtering, pagination, and both JSON and table output.

Uses OAuth when --account is provided, falls back to API key otherwise.
Validates --type values individually (comma-separated) and --order via
kong enum tag.
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 28, 2026

Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 4:10 AM ET / 08:10 UTC.

Summary
The PR adds gog youtube search list/gog yt search ls with API-key or OAuth-backed YouTube search.list support, filters, tests, and regenerated command docs.

Reproducibility: not applicable. this is a new command feature rather than a bug report. The current-main check confirms the command is absent, and the PR proof shows the proposed behavior running against YouTube.

Review metrics: 2 noteworthy metrics.

  • Patch size: 9 files changed, 305 added, 7 deleted. The feature is concentrated in one command file, one test file, and generated command docs.
  • YouTube tests: 3 tests added. The added coverage exercises the API-key path, OAuth account path, and validation path for the new command.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] This is a new user-facing YouTube API command, so maintainers still need to approve the command-surface expansion even though the implementation is narrow.
  • [P1] I did not run tests in this read-only review; CI or a maintainer should verify go test ./internal/cmd -run YouTube before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused search command after maintainer approval of the new YouTube surface and normal CI/test verification.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair lane is needed; this PR is ready for maintainer command-surface review and CI gating.

Security
Cleared: No concrete security or supply-chain concern found; the patch adds no dependencies or workflow changes and reuses the existing YouTube API-key/OAuth service helpers.

Review details

Best possible solution:

Land the focused search command after maintainer approval of the new YouTube surface and normal CI/test verification.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a new command feature rather than a bug report. The current-main check confirms the command is absent, and the PR proof shows the proposed behavior running against YouTube.

Is this the best way to solve the issue?

Yes, subject to maintainer product approval: the PR follows the existing YouTube command patterns, uses existing API-key/OAuth helpers, preserves parseable stdout, and keeps docs/tests in the expected generated-command flow.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 9987f8b2f053.

Label changes

Label justifications:

  • P2: This is a normal-priority feature PR for an existing Google API area with bounded implementation scope and live proof.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and follow-up comment include after-change live terminal output for successful searches and validation failure, which is sufficient proof for this CLI behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comment include after-change live terminal output for successful searches and validation failure, which is sufficient proof for this CLI behavior.
Evidence reviewed

What I checked:

  • Current main lacks search command: YouTubeCmd on current main lists activities, videos, playlists, comments, and channels, with no search/find subcommand. (internal/cmd/youtube.go:15, 9987f8b2f053)
  • PR adds focused implementation: The PR branch adds YouTubeSearchCmd and YouTubeSearchListCmd, validates --type, chooses OAuth when --account is provided, otherwise API key, and writes table/JSON output through existing helpers. (internal/cmd/youtube.go:432, 678b3701c13d)
  • Regression coverage added: The PR branch adds tests for API-key search, OAuth search, and invalid --type validation before the API call. (internal/cmd/youtube_test.go:105, 678b3701c13d)
  • Generated docs updated: The diff adds generated pages for gog-youtube-search and gog-youtube-search-list, and updates the parent YouTube command summaries. (docs/commands/gog-youtube-search-list.md:1, 678b3701c13d)
  • Live proof supplied: The PR body and follow-up comment include copied live output for basic search, filtered/date-ordered search, and invalid --type validation using a real account path. (678b3701c13d)
  • Whitespace check clean: The patch has no git diff --check whitespace errors. (678b3701c13d)

Likely related people:

  • Kuldip Satpute: Introduced the YouTube command group, YouTube service helpers, API-key config, OAuth scope wiring, docs, and initial YouTube tests in 05dd666. (role: introduced behavior; confidence: high; commits: 05dd66607583; files: internal/cmd/youtube.go, internal/cmd/youtube_services.go, internal/googleapi/youtube.go)
  • Peter Steinberger: Recently maintained the YouTube API-key transport path and lint cleanup, and the current shallow blame for the released YouTube files points through the v0.19.0 release commit. (role: recent area contributor; confidence: high; commits: e8c17cbc37be, c84a09192c80, b25a3c029b37; files: internal/googleapi/youtube.go, internal/googleapi/youtube_test.go, internal/cmd/youtube.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels May 28, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 28, 2026
@BRO3886
Copy link
Copy Markdown
Author

BRO3886 commented May 28, 2026

@clawsweeper re-review

here's the live proof:

$ gog yt search ls "mikey posada productivity" --max 3 --account user@gmail.com
# Next page: --page CAMQAA
KIND   ID           TITLE                                                           CHANNEL       PUBLISHED_AT
video  Uw-oPV31XxA  Being productive is easy, actually.                             Mikey Posada  2026-05-13T12:00:51Z
video  rDgZSiOMQ84  Rest ≠ Reward: How to do more, in less time, with less stress.  Mikey Posada  2024-12-22T14:00:48Z
video  4nY-JcTKDoE  #productivity                                                   Mikey Posada  2026-05-09T15:59:30Z
$ gog yt search ls "golang concurrency" --max 3 --type video --order date --account user@gmail.com
# Next page: --page CAMQAA
KIND   ID           TITLE                                                                                  CHANNEL                      PUBLISHED_AT
video  2xwUyoXIj88  How to implement concurrency with goroutine,channel and waitgroup  #faangprep #golang  Sharda Learning Center       2026-05-26T16:46:19Z
video  FlVGvwQEpCA  Почему Go так быстрый? Разбираем горутины, каналы и конкурентность                     Владимир Балун               2026-05-26T13:26:55Z
video  aYH7LypVYKM  Concurrent Weather Fetcher | Weekend Dev 50 | Golang Projects                          Learn to Code with CodeChef  2026-05-26T05:18:33Z
$ gog yt search ls "test" --type invalid
--type must be video, channel, or playlist (comma-separated)

docs also regenerated in the second commit

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 28, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant