title: Is it possible to connect the gcloud CLI to a Pubsub emulator instance
body: <p>After starting the PubSub emulator using the <code>gcloud</code> CLI and loading the environment variables accordingly, the <code>gcloud</code> CLI remains authenticated with our Google production account. Basically, we did:</p>
  
  <pre><code># Starting the emulator in one shell
  gcloud beta emulators pubsub start
  
  # In a different shell
  $(gcloud beta emulators pubsub env-init)
  gcloud pubsub topics list
  </code></pre>
  
  <p>However, our production topics are listed here. The expected output would be an empty list, as we're trying to list the topics from the freshly started PubSub emulator, which contains nothing at start up.</p>
  
  <p>We are used to start the Bigtable emulator and connect to it without issues with the <code>cbt</code> CLI which is aware of the <code>BIGTABLE_EMULATOR_HOST</code>. Is it possible to have the same kind of tool to manage/check PubSub emulator resources? It simply seems that <code>gcloud</code> is not aware of <code>*_EMULATOR_HOST</code> variables.</p>
  
  <p>Thank you in advance,</p>
  
  <p>PS: Output of our <code>gloud version</code>:</p>
  
  <pre><code>Google Cloud SDK 182.0.0
  alpha 2017.09.15
  beta 2017.09.15
  bigtable
  bq 2.0.27
  cbt
  core 2017.12.01
  gcloud
  gsutil 4.28
  kubectl
  pubsub-emulator 2017.09.15
  </code></pre>