Documentation
¶
Overview ¶
Package cli assembles the ytb command tree on top of the youtube library and the any-cli/kit framework. The record operations are declared once in the youtube domain (so the same definitions drive the CLI, the serve and mcp surfaces, and an ant host); the media, transcript, local-store, and config commands are escape-hatch kit.Command commands that share the run state through the context with appFromCtx.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" Date = "unknown" )
Build metadata, set via -ldflags at release time.
Functions ¶
Types ¶
type App ¶
type App struct {
Cfg youtube.Config
Client *youtube.Client
Out *render.Renderer
DataDir string
Limit int
MaxPages int
Workers int
YtDlpBin string
FFmpegBin string
// contains filtered or unexported fields
}
App is the run state an escape-hatch command works through. The record operations live in the youtube domain and receive the *youtube.Client by injection; the escape-hatch commands (download, transcript text, the local store, config) need more than the client, so they rebuild this state from the run context with appFromCtx and share the same renderer, limit, and pacing.
func (*App) Line ¶ added in v0.2.0
Line prints a raw line of text to stdout, for the transcript body, lyrics, and the store path, which are plain text rather than records.
func (*App) PageOptions ¶
func (a *App) PageOptions(enrich bool) youtube.PageOptions
PageOptions builds a PageOptions from the resolved -n / --max-pages values.
func (*App) RequireStore ¶
RequireStore returns the typed crawl store. It exists for the commands whose whole job is the store; the store always opens at the fixed path, so this no longer fails for a missing flag.