How to extract views integration setting from the command line?
It is possible, you can code it (and because you are a scripter I suppose you are a coder). In CiviCRM, the views settings are generated in the with file https://github.com/civicrm/civicrm-core/blob/master/CRM/Admin/Form/Setting/UF.php 

I used this as inspiration to create the following script

&lt;?php
$config = CRM_Core_Config::singleton();
$dsnArray = DB::parseDSN($config-&gt;dsn);
$tableNames = CRM_Core_DAO::getTableNames();
$tablePrefixes = '$databases[\'default\'][\'default\'][\'prefix\']= array(';
$tablePrefixes .= "\n  'default' =&gt; '$drupal_prefix',"; // add default prefix: the drupal database prefix
$prefix = "";
if ($config-&gt;dsn != $config-&gt;userFrameworkDSN) {
  $prefix = "`{$dsnArray['database']}`.";
}
foreach ($tableNames as $tableName) {
  $tablePrefixes .= "\n  '" . str_pad($tableName . "'", 41) . " =&gt; '{$prefix}',";
}
$tablePrefixes .= "\n);";

echo $tablePrefixes;


Run this script with the CiviCRM cv utility (see https://github.com/civicrm/cv) as follows.

cv scr &lt;scriptname.php&gt;


I tested this on CiviCRM 4.7.27