WP-CLI as of v1.4.0 can extract and store serialized data with the "pluck" and "patch" commands.
In the above case, a problem I needed to solve, I use the expression below to obtain the source image filename from a post ID (the post the image is attached to):
wp post meta pluck $(wp post meta get <post_ID> _thumbnail_id) _wp_attachment_metadata file
Note that this code will pull the relative post media path, e.g.: 2018/09/. The dirname portion can easily be stripped with e.g.:
basename "$(wp post meta pluck $(wp post meta get <post_ID> _thumbnail_id) _wp_attachment_metadata file)"