yt_cli 2.2.6+5 copy "yt_cli: ^2.2.6+5" to clipboard
yt_cli: ^2.2.6+5 copied to clipboard

A CLI tool for the YouTube Data, Live Streaming, and Analytics APIs.

yt_cli #

A CLI tool for the YouTube Data, Live Streaming, and Analytics APIs.

License: MIT

Quick Start #

Installation #

# Using dart pub
dart pub global activate yt_cli

# Using homebrew
brew tap cdavis-code/yt
brew install yt

Or download a pre-built binary from the releases page.

Usage #

# Display all available commands
yt --help

# Search for videos
yt search list --q "flutter tutorial" --max-results 5

# List playlists for a channel
yt playlists list --channel-id UC_x5XG1OV2P6uZZ5FSM9Ttw --max-results 10

# View all subcommands for a command
yt videos --help

Features #

  • OAuth 2.0 web flow authorization with automatic token refresh
  • Query YouTube Analytics reports (views, watch time, demographics, and more)
  • Manage analytics groups and group items for organizing channels, videos, or playlists
  • Full CRUD for channels, playlists, videos, comments, and subscriptions
  • Live broadcast and stream management with live chat interaction
  • Channel members and membership levels
  • Thumbnail and watermark management
  • Video abuse report reasons lookup
  • Cross-platform: runs on macOS, Linux, and Windows

Commands #

Run yt --help for the full list. Key commands:

Command Description
analytics YouTube Analytics reports, groups, and group items
authorize OAuth 2.0 web flow to authorize the CLI
broadcast Manage live broadcasts
channels Retrieve channel information
chat Interact with live chat messages
comments Manage YouTube comments
comment-threads Manage comment threads
members List channel members
memberships-levels List membership pricing levels
playlists Manage playlists
search Search for videos, channels, and playlists
stream Manage live streams
subscriptions Manage channel subscriptions
thumbnails Set thumbnail images
version Display package name and version
videos Manage videos (upload, update, delete)
video-categories List video categories
video-abuse-report-reasons List abuse report reasons
watermarks Manage channel watermarks

Configuration #

Authorization #

Before using most commands, authorize the CLI with your YouTube account:

# 1. Download client_secret.json from Google Cloud Console
#    See: https://github.com/cdavis-code/yt/blob/main/packages/yt_cli/authentication.md

# 2. Run the authorization command
yt authorize

# Or specify a custom path to your credentials file
yt authorize --credentials-file ~/secrets/client_secret.json

The CLI starts a local HTTP server, opens an OAuth 2.0 page in your browser, and saves a permanent refresh token to youtube_server_tokens.json. Subsequent commands automatically refresh the access token in the background.

See authentication.md for step-by-step setup instructions.

Documentation #

Contributing #

Any help from the open-source community is always welcome:

  • Found an issue? Please fill a bug report with details.
  • Need a feature? Open a feature request with use cases.
  • Are you a developer? Fix a bug and send a pull request.

License #

MIT License - see [LICENSE] for details.

1
likes
0
points
45
downloads

Publisher

verified publishercdavis.ca

Weekly Downloads

A CLI tool for the YouTube Data, Live Streaming, and Analytics APIs.

Homepage
Repository (GitHub)
View/report issues

Topics

#youtube #cli #api #live-streaming #oauth2

Funding

Consider supporting this project:

www.buymeacoffee.com

License

unknown (license)

Dependencies

args, dio, loggy, oauth2, universal_io, yt

More

Packages that depend on yt_cli