CLI tool to manage and analyze your YouTube channel from the terminal
Project description
YT Studio CLI
Manage and analyze your YouTube channel from the terminal. Ideal for automation and AI workflows.
Motivation
I built this because I needed to bulk update video titles for a YouTube channel I manage with 300+ videos. YouTube Studio does not support bulk search-replace operations, which made it a tedious manual process. This tool uses the YouTube Data API to perform bulk operations on video metadata. Furthermore, it provides features for analytics and comment moderation, all accesible from the command line.
Installation
I recommend the excellent uv tool for installation:
uv tool install ytstudio-cli
The CLI is installed as ytstudio; yts is a short alias for the same entry point.
Setup
- Create a Google Cloud project
- Enable YouTube Data API v3 and YouTube Analytics API
- Configure OAuth consent screen:
- Go to APIs & Services → OAuth consent screen
- Select External and create
- Fill in app name and your email
- Skip scopes, then add yourself as a test user
- Leave the app in "Testing" mode (no verification needed)
- Create OAuth credentials:
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client IDhow
- Select Desktop app as application type
- Download the JSON file
- Configure ytstudio:
ytstudio init --client-secrets path/to/client_secret_<id>.json
ytstudio login
Credentials stored in ~/.config/ytstudio-cli/.
Headless Linux login
If you are logging in from a server without a browser, run:
ytstudio login --headless
The command prints a Google OAuth URL. Open that URL in a browser on any machine and approve
access. The browser will then fail to load a 127.0.0.1 page; this is expected. Copy the full URL
from the browser address bar, paste it back into the terminal, and ytstudio will finish the login.
Managing multiple channels
If you run more than one YouTube channel, ytstudio stores each login under its own named profile.
Every command (videos, analytics, comments, ...) operates on the active channel.
ytstudio profile add work # authenticate a new channel and make it active
ytstudio profile add personal # add another
ytstudio profile list # show profiles; the active one is marked with *
ytstudio profile use work # switch the active profile
ytstudio profile status work # auth status for one profile (defaults to active)
ytstudio profile remove personal
For scripting you can override the active channel per command without switching:
YTSTUDIO_PROFILE=work ytstudio videos list
Credentials live in ~/.config/ytstudio-cli/profiles/<name>/ with owner-only (600) permissions.
The shared OAuth client secrets stay at the top level, so ytstudio init is only needed once.
A plain ytstudio login (no profile add) authenticates the active profile, which is default
on a fresh setup. Existing single-channel installs are migrated to the default profile
automatically on first run.
Live broadcasts
Manage your YouTube livestream broadcasts from the CLI. This drives YouTube's
liveBroadcasts API (scheduling, starting, stopping, updating); the actual
video push to YouTube still goes through your encoder of choice (OBS, etc.).
ytstudio livestreams list --status upcoming # what is scheduled
ytstudio livestreams show <broadcast-id> # details for one broadcast
ytstudio livestreams show <id> --ingest # also fetch the bound stream's RTMP URL
ytstudio livestreams show <id> --show-key # reveal the stream key (treat as secret)
ytstudio livestreams schedule \
--title "Title" --scheduled-start 2026-06-01T19:00:00+02:00 # dry-run
ytstudio livestreams schedule ... --execute # actually create
ytstudio livestreams start <id> # transition to live
ytstudio livestreams start <id> --to testing # transition to the monitor stream first
ytstudio livestreams stop <id> # transition to complete
ytstudio livestreams update <id> --privacy unlisted --no-dvr # dry-run by default
Notes:
scheduleandupdatedefault to a dry-run preview; pass--executeto apply.--show-keyonshowreveals the bound stream key; without it the key is redacted. Stream keys are credentials.liveBroadcasts.insert/updateare write operations (~50 quota units each); see API quota below.
API quota
The YouTube Data API enforces a default quota of 10_000 units per project per day. Most read operations (listing videos, comments, channel info) cost 1 unit, while write operations like updating video metadata or moderating comments cost 50 units each. Bulk updates can consume quota quickly. When exceeded, the API returns a 403 error; quota resets at midnight Pacific Time.
You can request a quota increase via IAM & Admin → Quotas in the Google Cloud Console. See the official quota documentation for full details.
Disclaimer
This project is not affiliated with or endorsed by Google. YouTube and YouTube Studio are trademarks of Google. All channel data is accessed exclusively through the official YouTube Data API and YouTube Analytics API.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytstudio_cli-0.2.0.tar.gz.
File metadata
- Download URL: ytstudio_cli-0.2.0.tar.gz
- Upload date:
- Size: 722.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a187149526724d2608c610d07ef7dd75fc8a2e1b2bddb915ee410f6907ed6a7c
|
|
| MD5 |
37690884582386e71245a5ff33d39d5e
|
|
| BLAKE2b-256 |
0f8d00fa5c2200af49d074f1f990a22625c3a2e4feb9055103f325c1bc1327d8
|
Provenance
The following attestation bundles were made for ytstudio_cli-0.2.0.tar.gz:
Publisher:
ci.yml on jdwit/ytstudio-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytstudio_cli-0.2.0.tar.gz -
Subject digest:
a187149526724d2608c610d07ef7dd75fc8a2e1b2bddb915ee410f6907ed6a7c - Sigstore transparency entry: 1635329954
- Sigstore integration time:
-
Permalink:
jdwit/ytstudio-cli@51ccd1123f1939f674c75788e707b3f13de486ee -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/jdwit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@51ccd1123f1939f674c75788e707b3f13de486ee -
Trigger Event:
push
-
Statement type:
File details
Details for the file ytstudio_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ytstudio_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 46.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2950bcf749c6080fde97cf73a98e306411bc7ddfd6c2a9b4f58138d66ed290f5
|
|
| MD5 |
58a5791e4a3269d72172764f87c5b50b
|
|
| BLAKE2b-256 |
703d60cfb3db6dff92dc70c4178c2b6bbc858c66d5880760a576d36805399384
|
Provenance
The following attestation bundles were made for ytstudio_cli-0.2.0-py3-none-any.whl:
Publisher:
ci.yml on jdwit/ytstudio-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytstudio_cli-0.2.0-py3-none-any.whl -
Subject digest:
2950bcf749c6080fde97cf73a98e306411bc7ddfd6c2a9b4f58138d66ed290f5 - Sigstore transparency entry: 1635329956
- Sigstore integration time:
-
Permalink:
jdwit/ytstudio-cli@51ccd1123f1939f674c75788e707b3f13de486ee -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/jdwit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@51ccd1123f1939f674c75788e707b3f13de486ee -
Trigger Event:
push
-
Statement type: