how to change civicrm settings from command line?
You can use drush cv to update the settings in db. 

eg drush cvapi Setting.create environment="Production" 

You can find various options in API explorer to set other settings and see for command in cv and drush section.