关于 Yutu
Yutu 是用于自动化 YouTube 工作流的命令行工具、MCP 服务和 AI Agent,支持内容管理与优化,并提供 Agent 模式和技能。
主要功能
- 01上传和优化视频
- 02管理评论与播放列表
- 03管理频道品牌设置
- 04检索、创建、更新和删除内容
- 05提供 YouTube 工作流与 SEO 指引
适用场景
- 01自动上传视频并更新元数据
- 02整理播放列表和管理评论
- 03通过 AI 客户端管理频道内容
MCP 相关
Yutu 可通过标准输入输出或 HTTP 作为 MCP 服务运行,向 MCP 客户端提供 YouTube 操作,并使用 Google OAuth 凭据和缓存令牌。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
npx -y @eat-pray-ai/yutuYUTU_CREDENTIAL密钥GCP project credential for yutu, Base64 encoded JSON or path to JSON fileYUTU_CACHE_TOKEN密钥YouTube authentication token, Base64 encoded JSON or path to JSON fileYUTU_LOG_LEVELLog level本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。
工具
74收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| parts | array | 否 | 要包含在响应中的部分 |
| output | enum | 否 | json|yaml|silentjson | yaml | silent |
| confirmed | boolean | 否 | 确认操作 |
| subject_id | string | 是 | 被举报对象的 ID |
| abuse_types | array | 是 | 滥用类型 ID(例如:垃圾信息、骚扰) |
| description | string | 否 | 滥用行为的说明 |
| subject_url | string | 否 | 被举报对象的 URL |
| subject_type_id | string | 是 | 对象类型 ID(例如:视频、评论、频道) |
| related_entity_id | string | 否 | 相关实体的 ID |
详细介绍
yutu
yutu 是一款命令行工具、MCP 服务和 AI Agent,可自动处理 YouTube 工作流——从上传和优化视频,到管理评论、播放列表和频道品牌形象——并为 AI Agent 提供技能,让你以更少的手动操作获得更多观看次数、更高的点击率和更强的观众参与度。中文文档
目录
前置条件
需要拥有 Google Cloud Platform 账号。请完成以下设置:
-
创建 GCP 项目,并在
APIs & Services -> Enable APIs and services下启用以下 API: -
创建 OAuth 凭据:
- 前往
APIs & Services -> OAuth consent screen,创建同意屏幕,并将自己添加为测试用户 - 前往
Credentials -> Create Credentials -> OAuth Client ID,选择Desktop app - 下载凭据文件并将其保存为
client_secret.json,文件内容应如下所示
{ "installed": { "client_id": "11181119.apps.googleusercontent.com", "project_id": "yutu-11181119", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "XXXXXXXXXXXXXXXX", "redirect_uris": [ "http://localhost" ] } } - 前往
-
进行身份验证:
yutu auth --credential client_secret.json浏览器窗口将打开,供你授权访问 YouTube。授权后,令牌将保存到
youtube.token.json。{ "access_token": "ya29.XXXXXXXXX", "token_type": "Bearer", "refresh_token": "1//XXXXXXXXXX", "expiry": "2024-05-26T18:49:56.1911165+08:00", "expires_in": 3599 }
默认情况下,yutu 会从当前目录读取 client_secret.json 和 youtube.token.json;--credential/-c 和 --cacheToken/-t 标志仅可用于 auth 子命令。若要修改所有子命令的默认路径,请设置以下环境变量。
全局环境变量
| 变量 | 说明 | 默认值 |
|---|---|---|
YUTU_CREDENTIAL | OAuth 客户端密钥的路径、Base64 或 JSON | client_secret.json |
YUTU_CACHE_TOKEN | 缓存的 OAuth 令牌的路径、Base64 或 JSON | youtube.token.json |
YUTU_ROOT | 文件解析的根目录 | 当前工作目录 |
YUTU_LOG_LEVEL | 日志级别:DEBUG、INFO、WARN、ERROR | INFO |
安装
如果你正在使用 AI Agent,请复制并粘贴以下提示词以完成安装:
Install and configure yutu by following https://raw.githubusercontent.com/eat-pray-ai/yutu/main/internal/tools/skillgen/setup.md
你可以直接从 releases page 下载 yutu,也可以根据需要使用以下方法。
GitHub Actions
yutu 提供两个 action,一个用于通用场景,另一个用于将视频上传到 YouTube。详情请参阅 youtube-action 和 youtube-uploader。
Node.js
❯ npm i -g @eat-pray-ai/yutu
Docker
# GitHub Container Registry (GHCR)
❯ docker pull ghcr.io/eat-pray-ai/yutu:latest
# or Docker Hub
❯ docker pull eatprayai/yutu:latest
❯ docker run --rm ghcr.io/eat-pray-ai/yutu:latest
# make sure client_secret.json is in the current directory
❯ docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/app -p 8216:8216 ghcr.io/eat-pray-ai/yutu:latest
Gopher
❯ go install github.com/eat-pray-ai/yutu@latest
Linux
❯ curl -sSfL https://raw.githubusercontent.com/eat-pray-ai/yutu/main/scripts/install.sh | bash
macOS
使用 Homebrew🍺 安装 yutu(推荐),或运行 shell 脚本。
❯ brew install yutu
# or
❯ curl -sSfL https://raw.githubusercontent.com/eat-pray-ai/yutu/main/scripts/install.sh | bash
Windows
❯ winget install yutu
验证安装
使用相关的加密签名证明验证 yutu 的完整性和来源。
# Docker
❯ gh attestation verify oci://ghcr.io/eat-pray-ai/yutu:latest --repo eat-pray-ai/yutu
❯ gh attestation verify oci://docker.io/eatprayai/yutu:latest --repo eat-pray-ai/yutu
# Linux and macOS(if installed using shell script)
❯ gh attestation verify $(which yutu) --repo eat-pray-ai/yutu
# Windows
❯ gh attestation verify $(where.exe yutu.exe) --repo eat-pray-ai/yutu
Agent
yutu 提供 Agent 模式(Miffy),用于自动执行 YouTube 工作流。该 Agent 可以检索、创建、更新和删除 YouTube 内容,并内置 YouTube 增长策略和 SEO 专业知识。
# Gemini(compatible) (default)
❯ yutu agent --provider google --model gemini-3.8-flash --api-key "YOUR_KEY"
❯ yutu agent --provider google --model gemini-3.8-flash --api-key "YOUR_KEY" --base-url "https://custom.endpoint.com/"
# OpenAI(compatible) (OpenAI, DeepSeek, Ollama, vLLM, etc.)
❯ yutu agent --provider openai --model gpt-5.6-terra --api-key "YOUR_KEY"
❯ yutu agent --provider openai --model deepseek-flash --api-key "YOUR_KEY" --base-url "https://api.deepseek.com/"
# web mode with sub-launchers
❯ yutu agent --args "web api a2a webui" --api-key "YOUR_KEY"
# show available launcher args
❯ yutu agent --args ""
Agent 标志
| 标志 | 描述 | 默认值 |
|---|---|---|
-a, --args | 以单个字符串形式提供启动器参数 | console |
-p, --provider | 大模型提供商:google 表示兼容 Gemini,openai 表示兼容 OpenAI | google |
-m, --model | 模型名称 | gemini-3.8-flash |
--api-key | 大模型提供商的 API 密钥 | |
--base-url | 大模型提供商 API 端点的基础 URL | |
-i, --instruction | 覆盖内置的 Agent 指令 | INSTRUCTION.md |
MCP 服务
在将 yutu 用作 MCP 服务之前,请确保已安装 yutu(参见安装部分),并且拥有有效的 client_secret.json 和 youtube.token.json 文件(参见先决条件部分)。
你可以按照以下说明,将 yutu 配置为首选工具的 MCP 服务。
Claude Code
# Stdio mode
❯ claude mcp add --env YUTU_CREDENTIAL=/absolute/path/to/client_secret.json \
--env YUTU_CACHE_TOKEN=/absolute/path/to/youtube.token.json \
yutu -- yutu mcp
# HTTP mode (start the server first: yutu mcp --mode http)
❯ claude mcp add --transport http \
--client-id YOUR_CLIENT_ID.apps.googleusercontent.com \
--client-secret \
yutu http://localhost:8216/mcp
Codex
# Stdio mode
❯ codex mcp add --env YUTU_CREDENTIAL=/absolute/path/to/client_secret.json \
--env YUTU_CACHE_TOKEN=/absolute/path/to/youtube.token.json \
yutu -- yutu mcp
# HTTP mode (start the server first: yutu mcp --mode http)
❯ codex mcp add --url http://localhost:8216/mcp \
--oauth-client-id YOUR_CLIENT_ID.apps.googleusercontent.com \
yutu
手动配置(VS Code、Cursor、OpenCode 等)
将以下内容添加到 MCP 设置中。请记得将 YUTU_CREDENTIAL 和 YUTU_CACHE_TOKEN 的值替换为本地计算机上的正确路径。
{
"yutu": {
"type": "stdio",
"command": "yutu",
"args": [
"mcp"
],
"env": {
"YUTU_CREDENTIAL": "/absolute/path/to/client_secret.json",
"YUTU_CACHE_TOKEN": "/absolute/path/to/youtube.token.json"
}
}
}
技能
yutu 提供统一的技能,为 AI Agent 扩展 YouTube 领域知识、常见工作流和 SEO 最佳实践,涵盖视频、播放列表、评论、频道、字幕、订阅等内容。
❯ npx skills add eat-pray-ai/yutu --skill youtube
完整的支持操作列表,请参阅 skills/youtube/SKILL.md。
用法
❯ yutu
yutu is a CLI, MCP server, and AI agent that automates your YouTube workflows from the terminal or any AI client.
Environment variables:
YUTU_CREDENTIAL Path/Base64/JSON of OAuth client secret (default: client_secret.json)
YUTU_CACHE_TOKEN Path/Base64/JSON of cached OAuth token (default: youtube.token.json)
YUTU_ROOT Root directory for file resolution (default: current working directory)
YUTU_LOG_LEVEL Log level: DEBUG, INFO, WARN, ERROR (default: INFO)
Usage:
yutu [flags]
yutu [command]
Available Commands:
abuseReport Manage YouTube abuse reports
activity Manage YouTube activities
agent Start an agent to automate YouTube workflows
auth Authenticate with YouTube APIs
caption Manage YouTube video captions
channel Manage YouTube channels
channelBanner Manage YouTube channel banners
channelSection Manage YouTube channel sections
comment Manage YouTube comments
commentThread Manage YouTube comment threads
completion Generate the autocompletion script for the specified shell
help Help about any command
i18nLanguage Manage YouTube i18n languages
i18nRegion Manage YouTube i18n regions
liveBroadcast Manage YouTube live broadcasts
liveChatBan Manage YouTube live chat bans
liveChatMessage Manage YouTube live chat messages
liveChatModerator Manage YouTube live chat moderators
liveStream Manage YouTube live streams
mcp Start MCP server
member Manage YouTube channel members
membershipsLevel Manage YouTube membership levels
playlist Manage YouTube playlists
playlistImage Manage YouTube playlist images
playlistItem Manage YouTube playlist items
search Manage YouTube search
subscription Manage YouTube subscriptions
superChatEvent Manage YouTube Super Chat events
thirdPartyLink Manage YouTube third-party links
thumbnail Manage YouTube video thumbnails
version Show the version of yutu
video Manage YouTube videos
videoAbuseReportReason Manage YouTube video abuse report reasons
videoCategory Manage YouTube video categories
watermark Manage YouTube watermarks
Flags:
-h, --help help for yutu
Use "yutu [command] --help" for more information about a command.
功能
更多信息请参阅 FEATURES.md。
贡献
更多信息请参阅 CONTRIBUTING.md。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。
