Persistent Issue with Bitwarden CLI – Vault remains "locked" despite successful unlock

Hello,

I’m currently experiencing a strange behavior with the Bitwarden CLI (version 2025.3.0) on Windows, using an organization account authenticated via API Key.

I’m running a PowerShell script that follows this sequence:

bw login --apikey
$env:BW_SESSION = bw unlock --passwordenv BW_PASSWORD --raw
bw status

or using the token directly: bw status --session $token

The unlock appears to work correctly:

The command returns success = true
A session token is returned using --raw

However, the bw status command always returns “locked”.

Some additional context:

The same script works perfectly for a colleague using a different account in the same organization.
My own account used to work as well, but I wasn’t locking the vault between script executions — which may have resulted in multiple active tokens being generated without properly closing previous sessions.
Since then, I suspect my account is facing an issue related to accumulated or orphaned CLI sessions.

Is it possible that my account has been affected server-side due to repeated use without bw lock or bw logout?

Thank you very much in advance for your help.

1 Like

I have the same issue with PowerShell under Windows 11. bw cli keeps asking for my password, even if I use --session:

> $env:BW_SESSION = bw unlock --raw
? Master password: [hidden]
> bw status
{“serverUrl”:null,“lastSync”:“2025-05-21T11:03:27.008Z”,“userEmail”:“yyy”,“userId”:“xxx”,“status”:“locked”}
> bw --version
2025.3.0
> bw list items --session $env:BW_SESSION
? Master password: [hidden]

I’ve solved my problem by loging out, deleting my AppData\Roaming\Bitwarden CLI\data.json file, and reloging in.

I believe the issue is linked to a modification in my priviledges. In any case, deleting the file worked.