From rustarr
Queries and controls Plex Media Server: browse libraries, search media, view recently added, and monitor active streams.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rustarr:plexThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Control and query Plex Media Server using the Plex API. Browse libraries, search media, and monitor active sessions.
Control and query Plex Media Server using the Plex API. Browse libraries, search media, and monitor active sessions.
This skill primarily provides read-only access to your Plex Media Server:
Most operations are GET-only and safe for monitoring/browsing. The refresh helper triggers a library scan; treat it as admin-only and get explicit confirmation before running it.
Credentials are configured in the plugin settings (userConfig). A SessionStart hook writes them to ~/.config/lab-plex/config.env, which the scripts load automatically — no manual file editing. Variables used:
# Plex Media Server
PLEX_URL="http://192.168.1.100:32400"
PLEX_TOKEN="<your_plex_token>"
PLEX_URL: Your Plex server URL with port (default: 32400)PLEX_TOKEN: Your Plex authentication tokenGetting your Plex token:
X-Plex-Token in the URLAll commands output JSON. Use jq for formatting or filtering.
The plex-api.sh helper script simplifies API access. Located at: scripts/plex-api.sh
# Using helper script
./scripts/plex-api.sh info
# Or raw curl
curl -s "$PLEX_URL/" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
List all library sections:
# Using helper script
./scripts/plex-api.sh libraries
# Or raw curl
curl -s "$PLEX_URL/library/sections" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
# Using helper script (replace 1 with your section key)
./scripts/plex-api.sh library 1
./scripts/plex-api.sh library 1 --limit 50 --offset 100
# Or raw curl
curl -s "$PLEX_URL/library/sections/1/all" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
# Using helper script
./scripts/plex-api.sh search "Inception"
./scripts/plex-api.sh search "Avengers" --limit 10
# Or raw curl
curl -s "$PLEX_URL/search?query=SEARCH_TERM" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
# Using helper script (default: 20 items)
./scripts/plex-api.sh recent
./scripts/plex-api.sh recent --limit 10
# Or raw curl
curl -s "$PLEX_URL/library/recentlyAdded" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
# Using helper script (default: 10 items)
./scripts/plex-api.sh ondeck
./scripts/plex-api.sh ondeck --limit 5
# Or raw curl
curl -s "$PLEX_URL/library/onDeck" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
# Using helper script
./scripts/plex-api.sh sessions
# Or raw curl
curl -s "$PLEX_URL/status/sessions" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
# Using helper script
./scripts/plex-api.sh clients
# Or raw curl
curl -s "$PLEX_URL/clients" -H "X-Plex-Token: $PLEX_TOKEN" -H "Accept: application/json"
# Server identity
./scripts/plex-api.sh identity
# Get metadata for specific item (by rating key)
./scripts/plex-api.sh metadata 12345
# Get children of item (e.g., seasons of a TV show)
./scripts/plex-api.sh children 12345
# List playlists
./scripts/plex-api.sh playlists
# List user accounts (admin-only; returns account info — read-only)
./scripts/plex-api.sh accounts
# Server preferences (admin-only; returns sensitive server config — read-only)
./scripts/plex-api.sh prefs
# Refresh library section (admin-only scan; confirm first)
./scripts/plex-api.sh refresh 1
# View all commands
./scripts/plex-api.sh --help
When the user asks about Plex:
Common section types (keys vary by server):
Always list sections first to get the correct section keys for your server.
-H "Accept: application/json" for JSON output/library/metadata/12345jq to filter and format JSON responsesTo query multiple Plex servers:
# Server 1
PLEX_URL="http://server1:32400" PLEX_TOKEN="token1" curl ...
# Server 2
PLEX_URL="http://server2:32400" PLEX_TOKEN="token2" curl ...
Note: these PLEX_URL=…/PLEX_TOKEN=… overrides apply to raw curl
only. The plex-api.sh helper always reads the plugin-managed
~/.config/lab-plex/config.env and ignores per-invocation env overrides, so to
target a second server with the helper you must point the plugin settings at it
(or call the API with raw curl as shown above).
For detailed local reference, see:
Creates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.
npx claudepluginhub jmagar/dendrite --plugin rustarr