{"id":46039459,"url":"https://github.com/dogbertdev/plexcli","last_synced_at":"2026-04-01T18:58:56.783Z","repository":{"id":339078927,"uuid":"1154491296","full_name":"dogbertdev/plexcli","owner":"dogbertdev","description":"A command-line interface for managing Plex Media Server libraries","archived":false,"fork":false,"pushed_at":"2026-02-28T13:33:45.000Z","size":172,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-28T16:37:19.660Z","etag":null,"topics":["cli","golang","media-management","plex","plex-api","plex-media-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dogbertdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-10T12:58:35.000Z","updated_at":"2026-02-23T10:59:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dogbertdev/plexcli","commit_stats":null,"previous_names":["dogbertdev/plexcli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dogbertdev/plexcli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogbertdev%2Fplexcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogbertdev%2Fplexcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogbertdev%2Fplexcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogbertdev%2Fplexcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dogbertdev","download_url":"https://codeload.github.com/dogbertdev/plexcli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogbertdev%2Fplexcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29961857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T05:59:08.471Z","status":"ssl_error","status_checked_at":"2026-03-01T05:58:04.208Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","golang","media-management","plex","plex-api","plex-media-server"],"created_at":"2026-03-01T06:02:00.061Z","updated_at":"2026-04-01T18:58:56.772Z","avatar_url":"https://github.com/dogbertdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plex CLI\n\n[![CI](https://github.com/dogbertdev/plexcli/actions/workflows/ci.yml/badge.svg)](https://github.com/dogbertdev/plexcli/actions/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/dogbertdev/plexcli)](https://goreportcard.com/report/github.com/dogbertdev/plexcli)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA comprehensive command-line interface for managing Plex Media Server libraries using the [plexgo](https://github.com/lukehagar/plexgo) SDK.\n\n## Features\n\n- **Library Management**: List, filter, and analyze your Plex libraries\n- **Media Analysis**: Check for duplicates, missing episodes, quality issues\n- **Subtitle \u0026 Audio**: Detect missing subtitle languages and audio configuration issues\n- **Metadata**: Find items with incomplete metadata\n- **Flexible Output**: Support for table, JSON, and TSV output formats\n\n## Installation\n\n### From Source\n\n```bash\ngit clone https://github.com/dogbertdev/plexcli.git\ncd plexcli\nmake install\n```\n\n### Using Go Install\n\n```bash\ngo install github.com/dogbertdev/plexcli/cmd/plex@latest\n```\n\n### Pre-built Binaries\n\nDownload from the [releases page](https://github.com/dogbertdev/plexcli/releases) for your platform.\n\n## Configuration\n\nThe CLI supports configuration through:\n\n1. **Environment Variables**:\n   - `PLEX_SERVER` - Your Plex server URL\n   - `PLEX_TOKEN` - Your Plex authentication token\n   - `PLEX_USERNAME` - Your Plex username (for authentication)\n   - `PLEX_PASSWORD` - Your Plex password (for authentication)\n   - `PLEX_CACHE_TTL` - Local library cache TTL in seconds (default: `300`, `0` disables cache)\n   - `PLEX_NO_CACHE` - Disable local library cache (`true` or `false`)\n   - `PLEX_REFRESH_CACHE` - Bypass cache reads and refresh from Plex (`true` or `false`)\n\n2. **Config File** (~/.config/plexcli/config.json):\n   ```json\n   {\n     \"server_url\": \"http://localhost:32400\",\n     \"token\": \"your-plex-token\"\n   }\n   ```\n\n3. **CLI Flags** (highest priority):\n   ```bash\n   plex --server http://localhost:32400 --token your-token unwatched\n   ```\n\n### Getting a Plex Token\n\nUse the built-in auth flow:\n\n```bash\n# Browser-based login (recommended)\nplex auth login --browser\n\n# Username/password login\nplex auth login --username your-email@example.com --password 'your-password'\n```\n\nThis fetches a token from Plex and stores it in your config file.\n\n## Usage\n\n### Global Flags\n\n```bash\nplex --help\n```\n\n- `--json` - Output JSON to stdout\n- `--plain` - Output TSV to stdout (for piping)\n- `--color auto|always|never` - Color mode (default: auto)\n- `--config PATH` - Path to config file\n- `--server URL` - Plex server URL\n- `--token TOKEN` - Plex authentication token\n- `--timeout SECONDS` - Request timeout in seconds (default: `120`)\n- `--cache-ttl SECONDS` - Local library cache TTL in seconds (default: `300`, `0` disables cache)\n- `--no-cache` - Disable local library cache for this run\n- `--refresh-cache` - Bypass cache reads and refresh local cache for this run\n- `-v, --version` - Show version\n\n### Commands\n\n#### Manage Cache\n\n```bash\n# Clear local library cache\nplex cache clear\n```\n\n#### Manage Library Maintenance\n\n```bash\n# List all library sections\nplex library list\n\n# List only movie sections\nplex library list --type movie\n\n# Refresh all sections\nplex library update\n\n# Refresh one section\nplex library update 1\n\n# Clean all sections (empty trash + maintenance tasks)\nplex library clean\n\n# Clean one section (plus global maintenance tasks)\nplex library clean 1\n\n# Show active activities/background tasks\nplex library status\n\n# Show details for a section\nplex library section show 1\n\n# Create or edit a section\nplex library section create \"Movies\" --type movie --agent tv.plex.agents.movie --location /srv/media/movies\nplex library section edit 1 --language en-AU --pref languageOverride=en-AU\n\n# Cancel one section refresh or stop all refreshes\nplex library refresh cancel 1\nplex library refresh stop-all --yes\n\n# Update item metadata and preferences\nplex library item edit 12345 --set title=\"New Title\" --lock title\nplex library item prefs set 12345 --pref introDetection=1\nplex library section prefs defaults --type movie --agent tv.plex.agents.movie\n\n# Run advanced detectors\nplex library detect intros 27018 --force\nplex library detect status 999\n\n# Use discovery helpers\nplex library discover collections 1\nplex library discover autocomplete 1 --query sta\n\n# Download binary helpers\nplex library artwork get 12345 --element poster --output /tmp/poster.jpg\nplex library media file --url /library/metadata/27017/theme/1771256497 --output /tmp/theme.mp3\nplex library media part 38540 1704960287 file.mkv --output /tmp/episode.mkv\nplex library media part-index 77 sd --interval 1000 --output /tmp/index.bif\nplex library media stream get 77 srt --output /tmp/subtitle.srt\n\n# Attach subtitles from a URL or local file\nplex library subtitle add 12345 --url https://example.com/subs/en.srt --language eng\nplex library subtitle add 12345 --file ./subs/en.srt --language eng --format srt\n\n# Show similar items for a movie/show\nplex library discover similar 12345 --compact\n\n# Show related items as JSON\nplex library discover related 12345 --json\n\n# Show Plex metadata matches for an item\nplex library discover matches 12345 --compact\n```\n\n#### Authenticate\n\n```bash\n# Login in browser and fetch/store a Plex token\nplex auth login --browser\n\n# Login with username/password and fetch/store a Plex token\nplex auth login --username your-email@example.com --password 'your-password'\n\n# Logout and clear stored credentials\nplex auth logout\n\n# Discover available servers\nplex auth servers\n\n# Select server #1 from discovered list and save it to config\nplex auth servers --select 1\n```\n\n#### List Unwatched Items\n\n```bash\n# Show all unwatched items\nplex unwatched\n\n# Show unwatched movies only\nplex unwatched --type movie\n\n# Limit results\nplex unwatched --limit 20\n```\n\n#### List Unmatched Items\n\n```bash\n# Show all unmatched items\nplex unmatched\n\n# Show unmatched movies only\nplex unmatched --type movie\n\n# Limit results\nplex unmatched --limit 20\n```\n\n#### List Recently Watched\n\n```bash\n# Show recently watched (last 7 days)\nplex recently-watched\n\n# Show last 30 days\nplex recently-watched --days 30\n\n# Output as JSON\nplex recently-watched --json\n```\n\n#### List Recently Added\n\n```bash\n# Show recently added items\nplex recently-added\n\n# Show last 30 days, limit to 50 items\nplex recently-added --days 30 --limit 50\n```\n\n#### Find Duplicates\n\n```bash\n# Find all duplicate media files\nplex duplicates\n\n# Find duplicates in a specific section\nplex duplicates --section 1\n```\n\n#### Search the Library\n\n```bash\n# Fuzzy search\nplex search \"Ghost in the Shell\"\n\n# Exact title + year resolution\nplex search \"Gattaca\" --exact --year 1997\n\n# Return only the top surviving result\nplex search \"Moon\" --exact --first\n\n# Fail for scripting if the result is ambiguous\nplex search \"Ghost in the Shell\" --exact --fail-ambiguous\n```\n\n#### Build Playlists\n\n```bash\n# Create a playlist from rating keys\nplex playlist create \"Sci-Fi Night\" 123 456\n\n# Create a playlist by resolving titles directly\nplex playlist create \"Sci-Fi Night\" --query \"Solaris\" --query \"On the Silver Globe\"\n\n# Add more items by title\nplex playlist add 999 --query \"Perfect Blue\"\n\n# Create a smart playlist with multiple filters\nplex playlist smart \"Oshii Essentials\" --section 1 --director \"Mamoru Oshii\" --genre Anime --year-from 1985 --year-to 2004 --unwatched\n```\n\n#### Recommend from Seeds\n\n```bash\n# Build ranked recommendations from multiple seeds\nplex recommend --like \"Avalon\" --like \"Stalker\"\n\n# Restrict to one library section and save as a playlist\nplex recommend --section 1 --like \"Avalon\" --like \"Stalker\" --playlist-name \"Avalon x Stalker\"\n```\n\n#### Check File Paths\n\n```bash\n# List all file paths\nplex file-paths\n\n# Filter by section\nplex file-paths --section 1\n```\n\n#### Check Subtitles\n\n```bash\n# Find items missing English subtitles\nplex subtitles-missing --lang en\n\n# Check for multiple languages\nplex subtitles-missing --lang en,de,fr\n```\n\n#### Check Audio\n\n```bash\n# Find items with stereo audio\nplex audio-check --min-channels 2\n\n# Check for specific codecs\nplex audio-check --codecs aac,ac3\n```\n\n#### Find Missing Episodes\n\n```bash\n# Find missing episodes in all TV series\nplex episodes-missing\n\n# Check specific show\nplex episodes-missing --show \"Game of Thrones\"\n\n# Check specific season\nplex episodes-missing --show \"Game of Thrones\" --season 1\n```\n\n#### Check Video Quality\n\n```bash\n# Find items below 1080p\nplex quality-check --min-resolution 1080p\n\n# Find 4K HDR content\nplex quality-check --min-resolution 4k --hdr\n```\n\n#### Check Metadata\n\n```bash\n# Find items with incomplete metadata\nplex metadata-missing\n```\n\n#### Manage Audio and Subtitle Streams\n\n```bash\n# Set streams for one season\nplex streams set \"Demon Slayer\" --season 1 --audio japanese --subtitle \"full english\"\n\n# Set streams for all episodes in all seasons\nplex streams set \"Demon Slayer\" --all-seasons --audio japanese --subtitle \"full english\"\n\n# Preview changes without modifying Plex\nplex streams set \"Demon Slayer\" --all-seasons --audio japanese --subtitle \"full english\" --dry-run\n```\n\n## Development\n\n### Prerequisites\n\n- Go 1.21+\n- Make\n\n### Building\n\n```bash\n# Build for current platform\nmake build\n\n# Build for all platforms\nmake build-all\n\n# Run tests\nmake test\n\n# Run with coverage\nmake test-coverage\n```\n\n### Project Structure\n\n```\n.\n├── cmd/plex/           # Main entry point\n├── internal/\n│   ├── auth/           # Authentication logic\n│   ├── cmd/            # Command implementations\n│   ├── config/         # Configuration management\n│   ├── outfmt/         # Output formatting (table/JSON/TSV)\n│   ├── plexclient/     # Plex API client wrapper\n│   └── ui/             # UI utilities\n├── tests/              # Integration tests\n├── go.mod\n├── Makefile\n└── README.md\n```\n\n## Output Formats\n\n### Table (default)\nHuman-readable formatted tables with headers.\n\n### JSON\nMachine-readable JSON output for scripting:\n\n```bash\nplex unwatched --json | jq '.[] | select(.year \u003e 2020)'\n```\n\n### TSV\nTab-separated values for piping to other tools:\n\n```bash\nplex unwatched --plain | cut -f1 | sort\n```\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests\n5. Submit a pull request\n\n## Acknowledgments\n\n- Built with [plexgo](https://github.com/lukehagar/plexgo) SDK\n- CLI framework: [Kong](https://github.com/alecthomas/kong)\n- Table formatting: [tablewriter](https://github.com/olekukonko/tablewriter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogbertdev%2Fplexcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogbertdev%2Fplexcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogbertdev%2Fplexcli/lists"}