How can I list all installed plugins/themes/versions from CLI/API?

Using WP CLI, you can record WordPress version using:

wp core version --extra --path="$SITEPATH" > wp-report.txt

and append a list of plugins (with status and version):

wp plugin list --path="$SITEPATH" >> wp-report.txt

and append a list of themes (with status and version) using:

wp theme list --path="$SITEPATH" >> wp-report.txt

Further reading: