From 6b2d499deaf75b268a98fcd555af0da19a38606b Mon Sep 17 00:00:00 2001 From: tamnd <1218621+tamnd@users.noreply.github.com> Date: Sun, 14 Jun 2026 16:36:24 +0700 Subject: [PATCH 1/2] Add the YouTube domain driver Blank-import the youtube package from ytb-cli so ant can address videos, channels, playlists, and the rest of YouTube as URIs. The driver registers itself with kit on init, exactly like the goodreads, x, and wikipedia drivers, so every verb works for the youtube:// scheme after a rebuild. Verified end to end: ant domains lists the scheme with its yt/ytb aliases, ant get youtube://video/dQw4w9WgXcQ returns the JSON-LD record with a typed channel edge under @links, and ant resolve maps a youtu.be URL to its URI. --- README.md | 8 ++++++-- cli/root.go | 1 + docs/content/getting-started/introduction.md | 2 ++ docs/content/guides/add-a-site.md | 1 + go.mod | 8 ++++++++ go.sum | 12 ++++++++++++ 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee928ba..bb283b0 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ Every public record is a URI, and `ant` dereferences it. `ant` is a single pure-Go binary that puts one address space over the whole `tamnd/*-cli` family. A book on Goodreads, an account on X, an article on -Wikipedia — each is a short URI like `goodreads://book/2767052`, -`x://user/nasa`, or `wikipedia://page/Alan_Turing`. Hand one to `ant` and +Wikipedia, a video on YouTube — each is a short URI like `goodreads://book/2767052`, +`x://user/nasa`, `wikipedia://page/Alan_Turing`, or `youtube://video/dQw4w9WgXcQ`. +Hand one to `ant` and it fetches the record, follows the typed links out of it, and writes the slice of the graph you asked for to disk, no matter which site each name lives on. @@ -45,6 +46,8 @@ x://user/nasa x://status/20 wikipedia://page/Alan_Turing wikipedia://category/Computability_theory +youtube://video/dQw4w9WgXcQ +youtube://channel/UCuAXFkgsw1L7xaCfnd5JJOw ``` Every verb takes a URI and does one thing: @@ -134,6 +137,7 @@ import ( _ "github.com/tamnd/goodread-cli/goodread" _ "github.com/tamnd/wikipedia-cli/wiki" _ "github.com/tamnd/x-cli/x" + _ "github.com/tamnd/ytb-cli/youtube" ) ``` diff --git a/cli/root.go b/cli/root.go index 1128fc0..1c56355 100644 --- a/cli/root.go +++ b/cli/root.go @@ -15,6 +15,7 @@ import ( _ "github.com/tamnd/goodread-cli/goodread" _ "github.com/tamnd/wikipedia-cli/wiki" _ "github.com/tamnd/x-cli/x" + _ "github.com/tamnd/ytb-cli/youtube" ) // Build metadata, set via -ldflags at release time. diff --git a/docs/content/getting-started/introduction.md b/docs/content/getting-started/introduction.md index 82ec117..1362519 100644 --- a/docs/content/getting-started/introduction.md +++ b/docs/content/getting-started/introduction.md @@ -23,6 +23,8 @@ x://user/nasa x://status/20 wikipedia://page/Alan_Turing wikipedia://category/Computability_theory +youtube://video/dQw4w9WgXcQ +youtube://channel/UCuAXFkgsw1L7xaCfnd5JJOw ``` Every verb takes a URI and does one thing — `resolve` normalizes any id or URL diff --git a/docs/content/guides/add-a-site.md b/docs/content/guides/add-a-site.md index 4ae39c0..a9409cc 100644 --- a/docs/content/guides/add-a-site.md +++ b/docs/content/guides/add-a-site.md @@ -17,6 +17,7 @@ import ( _ "github.com/tamnd/goodread-cli/goodread" _ "github.com/tamnd/wikipedia-cli/wiki" _ "github.com/tamnd/x-cli/x" + _ "github.com/tamnd/ytb-cli/youtube" ) ``` diff --git a/go.mod b/go.mod index b8e1239..5ca143a 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,14 @@ require ( github.com/tamnd/x-cli v0.2.0 ) +require ( + github.com/dlclark/regexp2/v2 v2.2.1 // indirect + github.com/dop251/goja v0.0.0-20260607120635-348e6bea910d // indirect + github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect + github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e // indirect + github.com/tamnd/ytb-cli v0.1.2-0.20260614093259-c846254c19bb +) + require ( charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410 // indirect github.com/PuerkitoBio/goquery v1.12.0 // indirect diff --git a/go.sum b/go.sum index 6f4e289..6211222 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410 h1:D9PbaszZYpB4nj+d6HTWr1onlmlyuGVNfL9gAi8iB3k= charm.land/lipgloss/v2 v2.0.0-beta.3.0.20251106193318-19329a3e8410/go.mod h1:1qZyvvVCenJO2M1ac2mX0yyiIZJoZmDM4DG4s0udJkU= +github.com/Masterminds/semver/v3 v3.5.0 h1:kQceYJfbupGfZOKZQg0kou0DgAKhzDg2NZPAwZ/2OOE= +github.com/Masterminds/semver/v3 v3.5.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/PuerkitoBio/goquery v1.12.0 h1:pAcL4g3WRXekcB9AU/y1mbKez2dbY2AajVhtkO8RIBo= github.com/PuerkitoBio/goquery v1.12.0/go.mod h1:802ej+gV2y7bbIhOIoPY5sT183ZW0YFofScC4q/hIpQ= github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= @@ -33,8 +35,16 @@ github.com/clipperhouse/uax29/v2 v2.3.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsV github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2/v2 v2.2.1 h1:mf4KkFUj0gJuarK8P+LgiS+Lit7m9N1yAwEfPbee7R0= +github.com/dlclark/regexp2/v2 v2.2.1/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU= +github.com/dop251/goja v0.0.0-20260607120635-348e6bea910d h1:xbM5U2EvWKkHxzEQJ2DEn20FwolWZahuTnVHr6WL3Q4= +github.com/dop251/goja v0.0.0-20260607120635-348e6bea910d/go.mod h1:Sc+QOu1WruvaaeT/cxFez/pXHpI9ZDjg/E8QNfSVveI= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= +github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs= github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= @@ -83,6 +93,8 @@ github.com/tamnd/wikipedia-cli v0.1.0 h1:LOLYAnH2LOIl6fr2ES1gJSo0sLDTMfvhcMiZZ+e github.com/tamnd/wikipedia-cli v0.1.0/go.mod h1:iR/4ucuwD9N5sTYCu7sMlpLNgS1XiikYebNhWGO+LrE= github.com/tamnd/x-cli v0.2.0 h1:k8cX6+YpqjnY1zq5T3x5zuXUWak554AalTUR7GrQ7iE= github.com/tamnd/x-cli v0.2.0/go.mod h1:6Mjop/nBV6BwK3GhMlQmyxesVVtHdl6jQtsNMFnhcY4= +github.com/tamnd/ytb-cli v0.1.2-0.20260614093259-c846254c19bb h1:PnYx4OtjhxiKBpwJdURlwo7YPIodKDTzbOa1IH1bU4s= +github.com/tamnd/ytb-cli v0.1.2-0.20260614093259-c846254c19bb/go.mod h1:/DoozwStkw9OMRksN12EOfPRP+66ODZMKg7/CDPgiGQ= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From 2d6fc4bce0d394a9909060e5448fc56c99cc0d88 Mon Sep 17 00:00:00 2001 From: tamnd <1218621+tamnd@users.noreply.github.com> Date: Sun, 14 Jun 2026 16:54:27 +0700 Subject: [PATCH 2/2] Pin ytb-cli at v0.2.0 The kit-native rewrite that exposes the youtube.Domain driver has merged and tagged, so move off the kit-native branch pseudo-version onto the release. --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5ca143a..d92633d 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/dop251/goja v0.0.0-20260607120635-348e6bea910d // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e // indirect - github.com/tamnd/ytb-cli v0.1.2-0.20260614093259-c846254c19bb + github.com/tamnd/ytb-cli v0.2.0 ) require ( diff --git a/go.sum b/go.sum index 6211222..d2a4e45 100644 --- a/go.sum +++ b/go.sum @@ -93,8 +93,8 @@ github.com/tamnd/wikipedia-cli v0.1.0 h1:LOLYAnH2LOIl6fr2ES1gJSo0sLDTMfvhcMiZZ+e github.com/tamnd/wikipedia-cli v0.1.0/go.mod h1:iR/4ucuwD9N5sTYCu7sMlpLNgS1XiikYebNhWGO+LrE= github.com/tamnd/x-cli v0.2.0 h1:k8cX6+YpqjnY1zq5T3x5zuXUWak554AalTUR7GrQ7iE= github.com/tamnd/x-cli v0.2.0/go.mod h1:6Mjop/nBV6BwK3GhMlQmyxesVVtHdl6jQtsNMFnhcY4= -github.com/tamnd/ytb-cli v0.1.2-0.20260614093259-c846254c19bb h1:PnYx4OtjhxiKBpwJdURlwo7YPIodKDTzbOa1IH1bU4s= -github.com/tamnd/ytb-cli v0.1.2-0.20260614093259-c846254c19bb/go.mod h1:/DoozwStkw9OMRksN12EOfPRP+66ODZMKg7/CDPgiGQ= +github.com/tamnd/ytb-cli v0.2.0 h1:mzIVriPNmVZ52ePj1Zwb5P1tkq+CNYhuqBtGM85zNBE= +github.com/tamnd/ytb-cli v0.2.0/go.mod h1:/DoozwStkw9OMRksN12EOfPRP+66ODZMKg7/CDPgiGQ= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=