data
YouTube CLI for Coding Agents
Use the YouTube CLI for coding agents with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 7 read 0 write API key auth
YouTube CLI for Coding Agents
Let coding agents discover schemas and execute integration functions through CLI commands or MCP.
Use this pattern when another coding agent needs exact commands and schema discovery. The YouTube CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# YouTube CLI for Coding Agents
kosmokrator integrations:configure youtube --set api_key="$YOUTUBE_API_KEY" --enable --read allow --write ask --json
kosmo integrations:call youtube.youtube_search_videos '{"query":"example_query","type":"example_type","max_results":1,"page_token":"example_page_token","order":"example_order","published_after":"example_published_after","published_before":"example_published_before","region_code":"example_region_code"}' --json Discovery Before Execution
Agents and scripts can inspect YouTube docs and schemas before choosing a function.
kosmo integrations:docs youtube --json
kosmo integrations:docs youtube.youtube_search_videos --json
kosmo integrations:schema youtube.youtube_search_videos --json
kosmo integrations:search "YouTube" --json
kosmo integrations:list --json Useful YouTube CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
youtube.youtube_search_videos | Read | query, type, max_results, page_token, order, published_after, published_before, region_code, channel_id, video_duration, safe_search | Search for videos, channels, or playlists on YouTube using keywords, filters, and sorting options. Returns matching results with snippet metadata. |
youtube.youtube_get_video_details | Read | video_ids, part | Get detailed information about one or more YouTube videos by ID, including title, description, thumbnails, duration, view count, likes, and channel info. |
youtube.youtube_list_channels | Read | for_username, channel_ids, category_id, mine, max_results, page_token, hl | List YouTube channels by username, channel ID, or category. Returns channel snippets, statistics, and content details. |
youtube.youtube_get_channel | Read | channel_id, part | Get detailed information about a specific YouTube channel by ID, including snippet, statistics (subscribers, views, videos), content details, and branding settings. |
youtube.youtube_list_playlists | Read | channel_id, playlist_ids, mine, max_results, page_token | List playlists for a YouTube channel or by playlist IDs. Returns playlist snippets and content details. |
youtube.youtube_get_playlist | Read | playlist_id, max_results, page_token | Get details about a specific YouTube playlist by ID, including its metadata and up to 50 playlist items (videos). |
youtube.youtube_get_current_user | Read | none | Get the authenticated user's YouTube channel information, including channel title, description, subscriber count, total views, and video count. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.