CLI Reference
What the CLI Does
Section titled “What the CLI Does”The synctv binary can start the service and act as an administrative CLI.
It supports:
- Local operations: load configuration, validate configuration, run database migrations, and start the service.
- Management operations: manage users, rooms, providers, settings, and system state through the management gRPC endpoint.
- Helper operations: generate shell completions and print version information.
General help:
synctv --helpCommand help:
synctv --helpsynctv user --helpsynctv room playback --helpsynctv provider alist --helpFor operational semantics, read Administration Runbook. Before changing room roles, permission bits, room settings, or user preferences, read Rooms, Permissions, and Preferences.
Global Flags
Section titled “Global Flags”--config <PATH>
Section titled “--config <PATH>”Explicit configuration file:
synctv --config /etc/synctv/synctv.yaml config validateThis has higher precedence than default search paths and SYNCTV_CONFIG_PATH.
--data-dir <PATH>
Section titled “--data-dir <PATH>”Override runtime data directory:
synctv --data-dir /var/lib/synctv serveThis affects management socket, HLS storage, slice cache, file logs, and similar runtime-owned paths. It does not affect *_file secret paths.
--no-dotenv
Section titled “--no-dotenv”Do not load .env:
synctv --no-dotenv config validateUseful in CI and production scripts where configuration should come only from explicit files and environment variables.
-v / --verbose
Section titled “-v / --verbose”Print more detailed configuration loading diagnostics:
synctv -v config validate--endpoint <ENDPOINT>
Section titled “--endpoint <ENDPOINT>”Management endpoint.
Unix socket:
synctv --endpoint unix:///var/lib/synctv/synctv.sock system statsTCP:
synctv --endpoint http://127.0.0.1:50052 system statsEnvironment variable:
SYNCTV_MANAGEMENT_ENDPOINT=http://127.0.0.1:50052--auth-token and --auth-token-file
Section titled “--auth-token and --auth-token-file”TCP management requires a bearer token.
synctv --endpoint http://127.0.0.1:50052 --auth-token "$TOKEN" system statsPrefer file input:
synctv --endpoint http://127.0.0.1:50052 --auth-token-file /run/secrets/management_token system statsEnvironment variables:
SYNCTV_MANAGEMENT_AUTH_TOKEN=...SYNCTV_MANAGEMENT_AUTH_TOKEN_FILE=/run/secrets/management_tokenOutput Formats
Section titled “Output Formats”Remote management commands commonly support:
--output human--output json--output yaml
Example:
synctv user list --output jsonConfiguration output supports:
--output yaml--output json--output toml
synctv config show --output jsonService Commands
Section titled “Service Commands”Start service:
synctv servesynctv serve --config synctv.yamlDry-run startup:
synctv serve --dry-runStop a running service through management:
synctv stopsynctv stop --force--force asks for faster shutdown and reduces drain waiting.
Configuration Commands
Section titled “Configuration Commands”Validate effective configuration:
synctv config validatesynctv --config /etc/synctv/synctv.yaml config validateShow merged configuration with secrets redacted:
synctv config showsynctv config show --output jsonDatabase Commands
Section titled “Database Commands”Run embedded SQLx migrations without starting the service. Startup runs the same migrations automatically, so this command is mainly for preflight, CI, test environments, and troubleshooting:
synctv db migrateCheck database connectivity and migration state:
synctv db statussynctv db status --output yamlUser Management
Section titled “User Management”Common commands:
synctv user listsynctv user get alicesynctv user create alice --password 'StrongPass123'synctv user delete alicesynctv user ban alice --reason "abuse"synctv user unban alicesynctv user set-role alice adminsynctv user set-password alice --password 'NewStrongPass123'synctv user set-username alice --username alice2synctv user rooms alicePreferences:
synctv user preferences get alicesynctv user preferences set alice --two-factor-enabled trueAdmin role:
synctv user admin grant alicesynctv user admin revoke alicesynctv user admin listBatch operations:
synctv user batch ban alice bob --reason "spam"synctv user batch delete alice bobPrivileged operations follow role hierarchy. A non-root admin cannot modify root or higher-privilege users’ sensitive settings.
Room Management
Section titled “Room Management”Rooms:
synctv room create "Movie Room" --username alicesynctv room listsynctv room get <ROOM_ID>synctv room set-password <ROOM_ID> --password "room-pass"synctv room transfer-owner <ROOM_ID> --username alice bobsynctv room ban <ROOM_ID> --reason "policy"synctv room unban <ROOM_ID>synctv room delete <ROOM_ID>Room settings:
synctv room settings get <ROOM_ID>synctv room settings update <ROOM_ID> --settings-json '{"join_requires_review":true}'synctv room settings reset <ROOM_ID>Members:
synctv room member list <ROOM_ID>synctv room member add <ROOM_ID> alicesynctv room member set-permissions <ROOM_ID> alice --role adminsynctv room member kick <ROOM_ID> alicesynctv room member ban <ROOM_ID> alicesynctv room member unban <ROOM_ID> alicePlayback:
synctv room playback get <ROOM_ID>synctv room playback start --room-id <ROOM_ID> --media-id <MEDIA_ID>synctv room playback play <ROOM_ID>synctv room playback pause <ROOM_ID>synctv room playback seek --room-id <ROOM_ID> --position 60synctv room playback speed <ROOM_ID> --speed 1.25synctv room playback stop <ROOM_ID>Streams:
synctv room stream list <ROOM_ID>Reviews and Bans
Section titled “Reviews and Bans”User registration review:
synctv review user-registration listsynctv review user-registration approve <REVIEW_ID>synctv review user-registration reject <REVIEW_ID> --reason "reason"Room creation review:
synctv review room-creation listsynctv review room-creation approve <REVIEW_ID>synctv review room-creation reject <REVIEW_ID> --reason "reason"Room join review:
synctv review room-join listsynctv review room-join approve <REVIEW_ID>synctv review room-join reject <REVIEW_ID> --reason "reason"Ban records:
synctv ban listPlaylists and Media
Section titled “Playlists and Media”Playlists:
synctv playlist list <ROOM_ID>synctv playlist get <ROOM_ID> <PLAYLIST_ID>synctv playlist create --room-id <ROOM_ID> --username alice "Weekend List"synctv playlist update --room-id <ROOM_ID> <PLAYLIST_ID> --name "New Title"synctv playlist move --room-id <ROOM_ID> <PLAYLIST_ID> --after-playlist-id <OTHER_PLAYLIST_ID>synctv playlist delete <ROOM_ID> <PLAYLIST_ID>Media:
synctv media list <ROOM_ID>synctv media add-url --room-id <ROOM_ID> --username alice "https://example.com/video.mp4" --title "Video"synctv media add --room-id <ROOM_ID> --username alice --source-config-json '{"url":"https://example.com/video.mp4"}' --title "Video"synctv media update --room-id <ROOM_ID> <MEDIA_ID> --title "New Title"synctv media move --room-id <ROOM_ID> <MEDIA_ID> --after-media-id <OTHER_MEDIA_ID>synctv media delete <ROOM_ID> <MEDIA_ID>Provider-backed media:
synctv playlist provider alist <ROOM_ID> ...synctv playlist provider emby <ROOM_ID> ...synctv media provider alist <ROOM_ID> ...synctv media provider emby <ROOM_ID> ...synctv media provider bilibili video <ROOM_ID> ...synctv media provider bilibili pgc <ROOM_ID> ...synctv media provider bilibili live <ROOM_ID> ...Use --help for exact provider-specific arguments.
Provider Management
Section titled “Provider Management”Provider instances:
synctv provider availablesynctv provider backends alistsynctv provider listsynctv provider create <NAME> <PROVIDER_ENDPOINT> --provider alistsynctv provider update <NAME> --provider-endpoint <PROVIDER_ENDPOINT> --provider alistsynctv provider enable <NAME>synctv provider disable <NAME>synctv provider reconnect <NAME>synctv provider delete <NAME>Alist:
synctv provider alist login --username alice --host https://alist.example --account-username alice --password 'pass' --instance-name alist-mainsynctv provider alist list --username alice --path / --instance-name alist-mainsynctv provider alist search --username alice --keyword movie --instance-name alist-mainsynctv provider alist me --username alice --instance-name alist-mainsynctv provider alist binds --username alicesynctv provider alist logout --username alice --instance-name alist-mainEmby:
synctv provider emby login --username alice --host https://emby.example --account-username alice --password 'pass' --instance-name emby-mainsynctv provider emby list --username alice --instance-name emby-mainsynctv provider emby me --username alice --instance-name emby-mainsynctv provider emby binds --username alicesynctv provider emby logout --username alice --instance-name emby-mainBilibili:
synctv provider bilibili parse "https://www.bilibili.com/video/..."synctv provider bilibili login-qr --username alice --instance-name bilibili-mainsynctv provider bilibili check-qr --username alice --key <KEY> --instance-name bilibili-mainsynctv provider bilibili get-captcha --username alice --instance-name bilibili-mainsynctv provider bilibili send-sms --username alice --phone 13800000000 --token <TOKEN> --challenge <CHALLENGE> --validate <VALIDATE> --instance-name bilibili-mainsynctv provider bilibili login-sms --username alice --phone 13800000000 --code 123456 --captcha-key <CAPTCHA_KEY> --instance-name bilibili-mainsynctv provider bilibili me --username alice --instance-name bilibili-mainsynctv provider bilibili binds --username alicesynctv provider bilibili logout --username alice --instance-name bilibili-mainRTMP:
synctv provider rtmp create-publish-key --username alice --room-id <ROOM_ID> <MEDIA_ID>synctv provider rtmp info --username alice --room-id <ROOM_ID> <MEDIA_ID>Runtime Settings
Section titled “Runtime Settings”Runtime settings are changed through the management endpoint. They are not the same as YAML startup configuration.
synctv settings listsynctv settings get emailsynctv settings update email --set whitelist_enabled=true --set whitelist=example.comsynctv settings test-email admin@example.comSee Runtime Settings Reference for all keys, defaults, and validation rules.
SMTP host, port, username, password, and sender identity are startup configuration, not runtime settings. settings test-email sends through the SMTP configuration loaded by the running service.
Security note: do not expose the management TCP endpoint publicly. Use strong tokens and prefer internal networks or VPNs.
System and Slice Cache
Section titled “System and Slice Cache”System state:
synctv system statssynctv system stream listsynctv system stream kick <STREAM_ID>Slice cache operations:
synctv slice-cache statssynctv slice-cache evict-expiredsynctv slice-cache purgeSlice cache enablement is controlled by startup config cache.proxy_slice_cache_enabled. CLI operations only provide stats, cleanup, and expiration eviction.
Shell Completions
Section titled “Shell Completions”synctv completion bash > synctv.bashsynctv completion zsh > _synctvsynctv completion fish > synctv.fishInstallation paths depend on the shell and OS distribution.
Version
Section titled “Version”synctv version