# tunesync-cli > Two-way playlist sync between Spotify and YouTube Music, Exportify CSV import, interactive review, periodic watch mode, and built-in stdio MCP server. > Docs: https://tunesync.bycomplex.dev > Repo: https://github.com/agarcial16/tunesync-cli ## Install - uv tool install git+https://github.com/agarcial16/tunesync-cli - pipx install git+https://github.com/agarcial16/tunesync-cli ## Authentication - YouTube Music: `tunesync auth ytmusic` (opens Chrome/Edge window with dedicated profile, verifies and saves `browser.json`). - Silent YT Music cookie refresh: `tunesync auth ytmusic --refresh`. - Headless YT Music fallback: `tunesync auth ytmusic --clipboard` or `tunesync auth ytmusic --file request.txt`. - Spotify Official API (PKCE, requires Premium + SPOTIFY_CLIENT_ID): `tunesync auth spotify`. - Spotify Web Backend (experimental, unofficial, uses sp_dc): `tunesync auth spotify --method web` (opens browser window) or `tunesync auth spotify --method web --sp-dc "" --i-know`. - Profiles: every command supports `--profile NAME` (default: `default`). ## Commands - `tunesync doctor [--json]` — validate profile, config, and credentials. - `tunesync lists [--service spotify|ytmusic] [--json]` — list playlists (shows `—` when count is unavailable). - `tunesync link [--source svc:name_or_id --target svc:name_or_id] [--create] [--likes]` — pair playlists; rejects ambiguous names with matching IDs. - `tunesync pairs [--json]` — list linked pairs with resolved names and snapshot status. - `tunesync unlink [--pair ID]` — unlink pairs (shows playlist names + IDs). - `tunesync sync [--dry-run] [--pair ID] [--force] [--json]` — three-way merge with live progress, backups, and bulk-deletion safety caps (empty guard, >20% on 10+ tracks, max 25 removals/pass). - `tunesync import FILE.csv --target new|ID [--name NAME] [--limit N] [--dry-run] [--retry-not-found] [--json]` — additive one-way Exportify CSV import into YouTube Music. - `tunesync review [--report PATH] [--pair ID] [--target PLAYLIST] [--limit N]` — interactive resolution of `not_found` tracks with ranked `[song]` + `[video]` candidates, custom query (`c`), or direct YouTube/Spotify URL paste. - `tunesync watch [--interval MIN] [--pair ID] [--dry-run] [--force] [--max-runs N] [--json]` — periodic sync loop (min 1 min, NDJSON with `--json`). - `tunesync mcp` — zero-dependency stdio JSON-RPC 2.0 MCP server. ## MCP Server Tools (`tunesync mcp`) - `tunesync_doctor`: validate config, active profile, and credentials. - `tunesync_lists`: `{service?: "spotify" | "ytmusic"}` — list playlists. - `tunesync_pairs`: list linked playlist pairs. - `tunesync_sync`: `{dry_run?: bool (default true), pair?: int, force?: bool}` — run two-way sync. - `tunesync_import_csv`: `{file: str, target?: str, name?: str, limit?: int, dry_run?: bool (default true), retry_not_found?: bool}` — import Exportify CSV.