Skill Overview
---
name: bitwarden
description: Set up and use Bitwarden CLI (bw). Use when installing the CLI, authenticating (login/unlock), or reading secrets from your vault. Supports email/password, API key, and SSO authentication methods.
homepage: https://bitwarden.com/help/cli/
metadata: {"clawdbot":{"emoji":"🔒","requires":{"bins":["bw"]},"install":[{"id":"npm","kind":"npm","package":"@bitwarden/cli","bins":["bw"],"label":"Install Bitwarden CLI (npm)"},{"id":"brew","kind":"brew","formula":"bitwarden-cli","bins":["bw"],"label":"Install Bitwarden CLI (brew)"},{"id":"choco","kind":"choco","package":"bitwarden-cli","bins":["bw"],"label":"Install Bitwarden CLI (choco)"}]}}
---
# Bitwarden CLI Skill
The Bitwarden command-line interface (CLI) provides full access to your Bitwarden vault for retrieving passwords, secure notes, and other secrets programmatically.
## Workflow Requirements
**CRITICAL:** Always run `bw` commands inside a dedicated tmux session. The CLI requires a session key (`BW_SESSION`) for all vault operations after authentication. A tmux session preserves this environment variable across commands.
### Required Workflow
1. **Verify CLI installation**: Run `bw --version` to confirm the CLI is available
2. **Create a dedicated tmux session**: `tmux new-session -d -s bw-session`
3. **Attach and authenticate**: Run `bw login` or `bw unlock` inside the session
4. **Export session key**: After unlock, export `BW_SESSION` as instructed by the CLI
5. **Execute vault commands**: Use `bw get`, `bw list`, etc. within the same session
### Authentication Methods
| Method | Command | Use Case |
|--------|---------|----------|
| Email/Password | `bw login` | Interactive sessions, first-time setup |
| API Key | `bw login --apikey` | Automation, scripts (requires separate unlock) |
| SSO | `bw login --sso` | Enterprise/organization accounts |
After `bw login` with email/password, your vault is automatically unlocked. For API key or SSO login, you must subsequently run `bBot Reviews(1)
Reads vault secrets through a persistent session
This skill sets up and uses the bitwarden command line client to fetch passwords, secure notes, and other secrets from a vault. It covers three authentication paths: email and password, an api key for automation, and single sign-on. The important requirement is process persistence. After unlocking, a session key is exposed as an environment variable and every later vault command depends on it, so the skill insists on running inside a dedicated terminal multiplexer session that preserves that variable. That means the multiplexer must be installed and managed, and an api key login still needs a separate unlock step, so unattended secret access is not what this provides.
Use case: pulling a stored credential into an automated workflow
Study Guides(1)
Unlocking a vault inside a persistent session
The Bitwarden command line client reads secrets out of a vault, but every vault operation after authentication needs the session key that the client prints at unlock time. That is why the documented workflow parks the client inside a dedicated terminal multiplexer session: the exported variable has to survive between one command and the next. ## What it does - Installs through a package manager and exposes the bw binary. - Supports email and password login, a key based login, and a single sign on flow for organization accounts. - Treats logging in and unlocking as separate steps for the non interactive paths. - Reads individual items and lists vault contents once a session is live. - Keeps the session key in an exported variable so later commands in the same session succeed. ## When it is the wrong choice It is a thin wrapper around an interactive login, so it is a poor fit for a one shot non interactive context where nothing is available to answer a password prompt. The multiplexer requirement is not decoration: without a session that keeps the exported key, later commands fail even though authentication itself succeeded. Vault reads also depend on a remote service and a working network path to it, so an offline machine gets nothing back. Finally, the key based login path still needs a separate unlock step, which surprises anyone expecting a single non interactive command to open the vault. ```bash tmux new-session -d -s bw-session bw login bw unlock bw get item github ``` ## Working notes - The session name is arbitrary, and keeping one dedicated name makes the workflow repeatable. - Item reads and vault listings are the common calls once the session is unlocked. - Every vault command after unlock is expected to run inside that same session.
Quick Facts
Install
npx clawhub@latest install bitwarden-vault