Install
openclaw skills install clawtvAI-powered Apple TV remote that uses vision to autonomously navigate apps, play content, control playback, and manage settings.
openclaw skills install clawtvAI-powered Apple TV remote that can see the screen and navigate any app autonomously using vision + remote control.
Use this skill immediately when the user asks:
# AI agent mode — tell it what you want in plain English
python3 ~/Developer/clawtv/clawtv.py do "open Plex and play Fight Club"
python3 ~/Developer/clawtv/clawtv.py do "search for Stranger Things on Netflix"
python3 ~/Developer/clawtv/clawtv.py do "go to settings and turn on subtitles"
# Direct Plex control (instant, no vision loop)
python3 ~/Developer/clawtv/clawtv.py plex play "Fight Club"
python3 ~/Developer/clawtv/clawtv.py plex play "Westworld" -s 2 -e 6
# Manual remote commands
python3 ~/Developer/clawtv/clawtv.py cmd up down select
python3 ~/Developer/clawtv/clawtv.py type "breaking bad"
python3 ~/Developer/clawtv/clawtv.py launch com.plexapp.plex
# Screenshot
python3 ~/Developer/clawtv/clawtv.py screenshot
# Status
python3 ~/Developer/clawtv/clawtv.py playing
The do command (AI agent mode) requires an Anthropic API key to access Claude's vision API for screenshot analysis and navigation decisions.
export ANTHROPIC_API_KEY=sk-ant-...
Or add to your shell profile (~/.zshrc, ~/.bashrc).
Note: This is only required for the do command. Manual commands (cmd, type, launch) and plex direct control do not use the API.
For instant Plex playback without the vision loop, add these to ~/.clawtv/config.json:
{
"plex_url": "http://192.168.1.100:32400",
"plex_token": "your-plex-token",
"plex_client": "Living Room"
}
Get your Plex token: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
Screenshots:
~/.clawtv/screenshots/ with timestampsdo command (AI agent mode), screenshots are sent to Anthropic's Claude API for vision analysisAnthropic API:
do command sends data to Anthropiccmd, type, launch) and Plex direct control do NOT send any data to external APIsApple TV Pairing Credentials:
~/.clawtv/config.json in your home directoryPlex Tokens (if configured):
~/.clawtv/config.json fileAnthropic API Key:
~/.clawtv/config.json is only readable by your userdo command can make multiple API calls per task (5-20 steps typical)cmd, type, and launch have zero API cost and send no data externally~/.clawtv/config.json~/.clawtv/) with standard Unix file permissions~/.clawtv/screenshots/ and persist until manually deleteddo), screenshots are transmitted to Anthropic's serversdo command runs in a loop (up to 20 steps) and makes Claude API calls automaticallycmd, type, launch, and plex commands do not use the Claude APIdo command)cd ~/Developer/clawtv
pip install -r requirements.txt
For QuickTime screenshot method (recommended):
pip install pyobjc-framework-Quartz
python3 ~/Developer/clawtv/clawtv.py scan # Find your Apple TV on network
python3 ~/Developer/clawtv/clawtv.py pair # Enter 4-digit PIN shown on TV
Pairing credentials are saved to ~/.clawtv/config.json.
QuickTime (recommended):
python3 ~/Developer/clawtv/clawtv.py screenshot --method quicktime
Xcode (fallback for DRM apps):
export ANTHROPIC_API_KEY=sk-ant-...
Or add to your shell profile (~/.zshrc, ~/.bashrc).
For instant Plex playback without vision loop, add to ~/.clawtv/config.json:
{
"plex_url": "http://192.168.1.100:32400",
"plex_token": "your-plex-token",
"plex_client": "Living Room"
}
Get your Plex token: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
do)Tell ClawTV what you want and it figures out the rest using vision + reasoning.
python3 ~/Developer/clawtv/clawtv.py do "<goal>"
How it works:
Examples:
python3 ~/Developer/clawtv/clawtv.py do "open Plex and play Fight Club"
python3 ~/Developer/clawtv/clawtv.py do "search for Stranger Things on Netflix"
python3 ~/Developer/clawtv/clawtv.py do "open YouTube and find lo-fi beats"
python3 ~/Developer/clawtv/clawtv.py do "go to settings and turn on subtitles"
python3 ~/Developer/clawtv/clawtv.py do "open Spotify and play my liked songs"
Token optimizations (automatic):
cache_control (90% savings on steps 2+)Playback pattern: Navigate → start playback → verify playing → skip intro if visible → disconnect → report done
cmd)Send direct remote control commands without AI.
python3 ~/Developer/clawtv/clawtv.py cmd <commands...>
Available commands:
up, down, left, right, select, menu, home, play, pause, play_pause, next, previous, volume_up, volume_down, top_menu
Examples:
python3 ~/Developer/clawtv/clawtv.py cmd up
python3 ~/Developer/clawtv/clawtv.py cmd down down right select
python3 ~/Developer/clawtv/clawtv.py cmd select sleep:1.5 down # with timing
Timing: Insert sleep:X between commands to add delays (in seconds).
type)Type text into a focused search/text field on the TV.
python3 ~/Developer/clawtv/clawtv.py type "<text>"
Example:
python3 ~/Developer/clawtv/clawtv.py type "breaking bad"
Note: The text field must already be focused. Use cmd to navigate to search first, or use do for full automation.
launch)Launch an app by bundle ID.
python3 ~/Developer/clawtv/clawtv.py launch <bundle_id>
Example:
python3 ~/Developer/clawtv/clawtv.py launch com.plexapp.plex
Common bundle IDs:
| App | Bundle ID |
|---|---|
| Plex | com.plexapp.plex |
| YouTube | com.google.ios.youtube |
| HBO Max | com.wbd.stream |
| Prime Video | com.amazon.aiv.AIVApp |
| Apple TV | com.apple.TVWatchList |
| Spotify | com.spotify.client |
| ESPN | com.espn.ScoreCenter |
| Twitch | tv.twitch |
| Pluto TV | tv.pluto.ios |
| NFL | com.nfl.gamecenter |
| Disney+ | com.disney.disneyplus |
| Hulu | com.hulu.plus |
| Netflix | com.netflix.Netflix |
Use python3 ~/Developer/clawtv/clawtv.py apps for the full list on your device.
plex)Bypass the entire vision loop using Plex API directly. Searches your library and tells the Plex client on Apple TV to play. Instant playback, zero vision cost.
# Play a movie
python3 ~/Developer/clawtv/clawtv.py plex play "Fight Club"
# Play a specific episode
python3 ~/Developer/clawtv/clawtv.py plex play "Westworld" -s 2 -e 6
# Search your library
python3 ~/Developer/clawtv/clawtv.py plex search "matrix"
# List Plex clients
python3 ~/Developer/clawtv/clawtv.py plex clients
# List libraries
python3 ~/Developer/clawtv/clawtv.py plex libraries
Requirements:
plex_url, plex_token, and plex_client in ~/.clawtv/config.jsonAuto-detection: The do command automatically detects Plex goals (e.g., "play Fight Club on Plex") and routes through this path without any vision API calls.
screenshot)Take a screenshot of the Apple TV and save to ~/.clawtv/screenshots/.
python3 ~/Developer/clawtv/clawtv.py screenshot [--method auto|quicktime|lookout|xcode]
Screenshot methods:
| Method | Speed | DRM Apps | Requires |
|---|---|---|---|
| QuickTime (default) | ~0.6s | ❌ Kills mirror (DRM) | QuickTime Player, pyobjc-framework-Quartz |
| Lookout | ~0.1s | ❌ Only captures Lookout app | Lookout tvOS app running on Apple TV |
| Xcode (legacy) | ~2.5s | ✅ Works with all apps | Xcode Devices window open |
DRM apps (YouTube, Netflix, Disney+, HBO Max) enforce HDCP and terminate the QuickTime AirPlay mirror entirely. Use Xcode method for these apps, or use Lookout for its own UI.
Configuration: Set default method in ~/.clawtv/config.json:
{
"screenshot_method": "auto"
}
Values: auto (tries quicktime → lookout → xcode), quicktime, lookout, xcode
disconnect)Close the QuickTime mirror and auto-resume playback on the TV.
python3 ~/Developer/clawtv/clawtv.py disconnect
Why: QuickTime mirroring shows a red recording border on the TV and routes audio to the Mac. After starting playback, always disconnect to remove the border and restore audio to the TV.
Auto-resume: Sends play command twice to ensure playback resumes.
# What's currently playing
python3 ~/Developer/clawtv/clawtv.py playing
# Find Apple TVs on network
python3 ~/Developer/clawtv/clawtv.py scan
# List installed apps with bundle IDs
python3 ~/Developer/clawtv/clawtv.py apps
DRM apps (YouTube, Netflix, Disney+, HBO Max) terminate the QuickTime AirPlay mirror entirely. When this happens:
auto mode--method xcodeApps that work with QuickTime: Plex (local media), Settings, home screen, Apple TV+, most non-DRM apps.
When QuickTime mirror is active:
Solution: Always run disconnect after starting playback. The do command does this automatically.
Vision loop (AI agent mode): Uses Claude API for every see-think-act step. Each step = 1 API call with screenshot.
Plex direct control: 2 API calls total (pennies) — no vision loop.
Manual commands (cmd, type, launch): Zero API cost.
~/.clawtv/config.json stores:
{
"devices": {
"Living Room": {
"identifier": "...",
"credentials": "..."
}
},
"screenshot_method": "auto",
"plex_url": "http://192.168.1.100:32400",
"plex_token": "your-plex-token",
"plex_client": "Living Room"
}
Lookout — tvOS app with built-in HTTP screenshot server at port 8080. Fastest possible screenshot method (~100ms) but only captures Lookout's own UI, not other apps.
"No Apple TV found"
python3 ~/Developer/clawtv/clawtv.py scan to verify device is on network"QuickTime mirror disconnected"
--method xcode instead"Screenshot failed"
--method auto to fall back automatically"API key not found"
export ANTHROPIC_API_KEY=sk-ant-... in your shell"Plex not found"
plex_url, plex_token, and plex_client in configpython3 ~/Developer/clawtv/clawtv.py plex clients to verify client nameclawtv.py — Single-file CLI: pairing, remote, screenshots, AI agent
~/.clawtv/
config.json — Device pairing credentials + settings
screenshots/ — Screenshot history (timestamped PNGs)
Stack:
MIT — see LICENSE