yt-api-cliManage your YouTube account from the command line. Complete CLI for YouTube Data API v3 - list/search videos, upload, manage playlists, and more.
Install via ClawdBot CLI:
clawdbot install nerveband/yt-api-cliManage your YouTube account from the terminal. A complete CLI for the YouTube Data API v3.
# Using go install
go install github.com/nerveband/youtube-api-cli/cmd/yt-api@latest
# Or download from releases
curl -L -o yt-api https://github.com/nerveband/youtube-api-cli/releases/latest/download/yt-api-darwin-arm64
chmod +x yt-api
sudo mv yt-api /usr/local/bin/
mkdir -p ~/.yt-api
cat > ~/.yt-api/config.yaml << EOF
default_auth: oauth
default_output: json
oauth:
client_id: "YOUR_CLIENT_ID"
client_secret: "YOUR_CLIENT_SECRET"
EOF
yt-api auth login # Opens browser for Google login
yt-api auth status # Check auth state
# List your videos
yt-api list videos --mine
# List channel videos
yt-api list videos --channel-id UC_x5XG1OV2P6uZZ5FSM9Ttw
# List playlists
yt-api list playlists --mine
# List subscriptions
yt-api list subscriptions --mine
# Basic search
yt-api search --query "golang tutorial"
# With filters
yt-api search --query "music" --type video --duration medium --order viewCount
# Upload video
yt-api upload video ./video.mp4 \
--title "My Video" \
--description "Description here" \
--tags "tag1,tag2" \
--privacy public
# Upload thumbnail
yt-api upload thumbnail ./thumb.jpg --video-id VIDEO_ID
# Create playlist
yt-api insert playlist --title "My Playlist" --privacy private
# Add video to playlist
yt-api insert playlist-item --playlist-id PLxxx --video-id VIDxxx
# Get channel info
yt-api list channels --id UCxxx --part snippet,statistics
# Update channel description
yt-api update channel --id UCxxx --description "New description"
# JSON (default - LLM-friendly)
yt-api list videos --mine
# Table (human-readable)
yt-api list videos --mine -o table
# YAML
yt-api list videos --mine -o yaml
# CSV
yt-api list videos --mine -o csv > videos.csv
| Flag | Short | Description |
|------|-------|-------------|
| --output | -o | Output format: json (default), yaml, csv, table |
| --quiet | -q | Suppress stderr messages |
| --config | | Path to config file |
| --auth-type | | Auth method: oauth (default), service-account |
| Variable | Description |
|----------|-------------|
| YT_API_AUTH_TYPE | Auth method: oauth or service-account |
| YT_API_OUTPUT | Default output format |
| YT_API_CLIENT_ID | OAuth client ID |
| YT_API_CLIENT_SECRET | OAuth client secret |
| YT_API_CREDENTIALS | Path to service account JSON |
Best for interactive use and accessing your own YouTube account.
yt-api auth login # Opens browser
Best for server-side automation.
yt-api --auth-type service-account --credentials ./key.json list videos
yt-api info # Full system state
yt-api info --test-connectivity # Verify API access
yt-api info --test-permissions # Check credential capabilities
yt-api auth status # Authentication details
yt-api version # Version info
Exit codes:
0 - Success1 - General error2 - Authentication error3 - API error (quota, permissions)4 - Input error--quiet mode for parsing--dry-run validates without executing~/.yt-api/tokens.json (0600 permissions)GitHub: https://github.com/nerveband/youtube-api-cli
Generated Mar 1, 2026
YouTubers and video producers can automate video uploads, manage playlists, and update metadata like titles and descriptions directly from the command line. This streamlines content workflows, especially for batch operations or scheduled releases.
Marketing teams can programmatically search for trending videos, analyze competitor channels, and export data in JSON or CSV for further analysis. This aids in campaign tracking and audience insights without manual API calls.
Educators and institutions can create and manage playlists of instructional videos, update channel descriptions, and list subscriptions to organize learning materials. It supports automated updates for course content libraries.
Businesses can use service account authentication to upload internal training videos or archive recordings to a dedicated YouTube channel. The CLI enables server-side automation with structured output for logging and integration.
Developers can embed the CLI in scripts or CI/CD pipelines to manage YouTube channels programmatically, such as uploading release videos or updating thumbnails. JSON output and quiet mode facilitate seamless integration with other tools.
Offer the core CLI for free with basic features like listing and searching videos, while charging for advanced capabilities such as bulk uploads, analytics exports, or premium support. Revenue can come from subscriptions or one-time licenses for enterprise users.
Provide consulting or managed services to help businesses integrate the YouTube Data API via this CLI, offering customization, automation scripts, and maintenance. Revenue is generated through project-based contracts or retainer fees.
Partner with online learning platforms to bundle the CLI as a tool for educators to manage video content, offering tutorials, workshops, or certification programs. Revenue can come from affiliate sales, training fees, or platform commissions.
💬 Integration Tip
Use the default JSON output and --quiet flag for easy parsing in automation scripts, and set environment variables like YT_API_OUTPUT for consistent formatting across deployments.
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
Command-line tool to manage Google Workspace services including Gmail, Calendar, Drive, Sheets, Docs, Slides, Contacts, Tasks, People, Groups, and Keep.
Runs shell commands inside a dedicated tmux session named claw, captures, and returns the output, with safety checks for destructive commands.
A modern text-based browser. Renders web pages in the terminal using headless Firefox.
Write robust, portable shell scripts. Use when parsing arguments, handling errors properly, writing POSIX-compatible scripts, managing temp files, running commands in parallel, managing background processes, or adding --help to scripts.
NotebookLM CLI wrapper via `node {baseDir}/scripts/notebooklm.mjs`. Use for auth, notebooks, chat, sources, notes, sharing, research, and artifact generation/download.