title: How to use multiple service accounts with gcloud?
body: <p>I have two Google Cloud service accounts; one for each of my two projects.</p>
  
  <pre><code># ACCOUNTS
  editor@someproj-1.iam.gserviceaccount.com
  editor@someproj-2.iam.gserviceaccount.com
  </code></pre>
  
  <p>I can tell <code>gcloud</code> which account I need to use before executing a command:</p>
  
  <pre><code>gcloud set account [ACCOUNT]
  </code></pre>
  
  <p><strong>Question:</strong> Is there any way I can configure <code>gcloud</code> and <code>gsutil</code> so that they'll be used for operations performed in their respective project without me having to switch between these accounts manually all the time?</p>
  
  <hr>
  
  <p>I'm managing instances in one project and I upload/download files from buckets in another project. It becomes quite tedious to have to perform <code>gcloud set_account [ACCOUNT]</code> all the time in-between commands.</p>
  
  <p>I need to be running long-running commands in both projects at the same time which causes me to think I will fall into a pit if I activate/de-activate the accounts used for these commands.</p>
  
  <p>Perhaps my only option is to run google-cloud-sdk from two different Docker containers?</p>