# samsung-artmode - Full Agent Operating Manual A native Rust CLI for controlling Samsung The Frame TV Art Mode over the local network. Results are YAML on stdout, errors are YAML or JSON on stderr, and `--json` switches both to machine-readable JSON. ## Target Device Resolution Pass `--account ` (short `-a `) or `--host ` on every command. There is no implicit default device. samsung-artmode accounts list # what TVs are configured samsung-artmode status -a living-room # check Art Mode status samsung-artmode status --host 192.168.1.100 # target by IP directly If you do not know which TV to use, run `samsung-artmode accounts list` and ask the human. ### Pairing with a New TV samsung-artmode pair [host] [--name ] 1. If no host is provided, auto-discovers Samsung TVs on the local network via SSDP multicast. 2. Prompts the TV user on-screen: "Allow SamsungArtCli to connect?". 3. Obtains an authentication token from the TV. 4. If `--name ` is provided, saves the device configuration to `config.yaml` and stores the token in the OS Keystore (Keychain, DPAPI, libsecret). ## Complete Command Reference ### `pair` ```bash samsung-artmode pair [HOST] [--name ] [--timeout ] ``` - `HOST`: Optional TV IP or hostname. If omitted, performs SSDP multicast scan on 239.255.255.250:1900. - `--name `: Optional account name to store in config and OS keystore. - `--timeout `: Scan/connection timeout in seconds (default: 5). ### `status` ```bash samsung-artmode status [-a | --host ] ``` Returns `{ "status": "on" }` or `{ "status": "off" }`. ### `list` ```bash samsung-artmode list [-a | --host ] [--category ] ``` Lists images on the TV. Categories: - `MY-C0002`: My Photos (uploaded user photos) - `MY-C0004`: Favorites - `MY-C0008`: Samsung Art Store ### `current` ```bash samsung-artmode current [-a | --host ] ``` Returns the content item currently displayed on the screen. ### `select` ```bash samsung-artmode select [--show] [-a | --host ] ``` Selects an image to display. - `CONTENT_ID`: Unique ID of the artwork (e.g. `SAM-F0206`). - `--show`: Display immediately even if TV is not currently in art mode (default: true). ### `upload` ```bash samsung-artmode upload [--matte ] [--select] [-a | --host ] ``` Uploads a photo to the TV. - `FILE`: Local path to JPEG or PNG image. - `--matte `: Optional matte style to apply. - `--select`: Immediately set the uploaded image as active artwork. ### `delete` ```bash samsung-artmode delete [-a | --host ] ``` Deletes an image from the TV. ### `favorite` ```bash samsung-artmode favorite [--remove] [-a | --host ] ``` Adds or removes an image from Favorites (`MY-C0004`). ### `brightness` ```bash samsung-artmode brightness get [-a | --host ] samsung-artmode brightness set <0-10> [-a | --host ] ``` Queries or sets the display brightness between 0 (dimmest) and 10 (brightest). ### `matte` ```bash samsung-artmode matte list [-a | --host ] samsung-artmode matte set [-a | --host ] ``` Lists supported mattes or applies a matte to an image. Common matte IDs: - `none` - `flexible_polar` - `shadowbox_black` - `modern_warm` ### `slideshow` ```bash samsung-artmode slideshow [--interval ] [--category ] [--shuffle] [--off] [-a | --host ] ``` Configures or disables the rotating slideshow. ### `accounts` ```bash samsung-artmode accounts list samsung-artmode accounts add --host [--token ] [--mac ] [--model ] [--force] samsung-artmode accounts test samsung-artmode accounts remove [--yes] ``` Manages multi-TV configurations and credential storage. ## Exit Codes & Error Envelope Failures print to stderr with a stable numeric exit code and structured envelope: 0 ok 1 error unclassified error 2 network TV unreachable or socket connection lost 3 auth_required TV refused connection or invalid token; re-pair TV 4 not_found content ID or file not found 5 rate_limited back off before retrying 6 invalid_input invalid argument value 7 no_account missing --account or --host parameter Error Envelope Format: ```json { "error": "Error description message", "code": "auth_required", "detail": "Underlying diagnostic details", "remediation": "samsung-artmode pair 192.168.1.100" } ```