# Doppler CLI with two different accounts

**URL:** <https://community.doppler.com/t/doppler-cli-with-two-different-accounts/631>\
**Category:** Need Help\
**Created:** [May 20, 2022, 1:49am UTC](https://community.doppler.com/t/doppler-cli-with-two-different-accounts/631 "2022-05-20T01:49:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bp4151](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/bp4151/32/318_2.png) [@bp4151](https://community.doppler.com/u/bp4151)\
**Post date:** [May 20, 2022, 1:49am UTC](https://community.doppler.com/t/doppler-cli-with-two-different-accounts/631/1 "2022-05-20T01:49:02Z")

</div>

So I have a weird situation. I have a personal free account and a teams account for work. When I try to use the CLI with my teams account, I can authenticate and get to the teams account dashboard, but when I check my configuration using the CLI, I get the project from my personal account. It looks like something is being cached but I don’t know for sure. If anyone has any thoughts or suggestions, I’d appreciate it.

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [May 20, 2022, 2:37am UTC](https://community.doppler.com/t/doppler-cli-with-two-different-accounts/631/2 "2022-05-20T02:37:48Z")

</div>

Hey Bruce!

The best solution is to scope each account to a different parent directory on your machine.

I’d also recommend using either separate browsers or separate profiles within Chrome so you can also manage access to the dashboards from both accounts.

By default when you run `doppler login`, it sets the scope (parent directory) to root `/` as most developers will only ever access a single workplace.

So the process will be to clear out your existing token, then re-authenticate both accounts, but with different root directories.

To get started, clear the token at the root level by running:

```nohighlight
doppler logout

```

**Step 1. Authenticate Work Account**

Then, presuming you have a directory structure like `/home/bruce/work` and `/home/bruce/personal`.

First, authenticate your Work account.

But instead of auto opening the window, type `n` and manually copy the `https://dashboard.doppler.com/workplace/auth/cli` URL and paste it into the browser that 's authenticated for your Work account:

```nohighlight
doppler login --scope /home/bruce/work

```

Then paste in the auth code to complete authenticating the CLI.

What you should now find is that CLI commands outside of `/home/bruce/work` will fail as they don’t have a token associated with that path.

You can verify this worked by changing into your Work directory and listing the projects:

```nohighlight
cd /home/bruce/work
doppler projects

```

**Step 2. Authenticate Personal Account**

This is essentially the same as step 1, except the scope will change:

```nohighlight
doppler login --scope /home/bruce/personal

```

Again type `n` and this time, copy and paste `https://dashboard.doppler.com/workplace/auth/cli` into the browser where your Personal account is authenticated.

Then verify that worked by changing into your Personal directory and listing the projects:

```nohighlight
cd /home/bruce/personal
doppler projects

```

As a final test step, change into the root folder for your user and the projects list should fail as it does not have a scoped directory as it’s parent:

```nohighlight
cd $HOME
doppler projects # This should fail

```

Although I wouldn’t recommend this approach, you can also edit the Doppler config file at `~/.doppler/.doppler.yaml` if you needed to make some adjustments in the future without having to re-authenticate.

Let me know how you go!
