Securely interact with Bitwarden password manager via the bw CLI. Covers authentication (login/unlock/logout), vault operations (list/get/create/edit/delete...
--- name: bw-cli description: Interact with Bitwarden password manager using the bw CLI. Covers authentication (login/unlock/logout/status), vault operations (list/get/create/edit/delete/restore items, folders, attachments, collections), password/passphrase generation, organization management, and Send/receive. Use for "bitwarden", "bw", "password safe", "vaultwarden", "vault", "password manager", "generate password", "get password", "unlock vault", "share send". metadata: author: tfm version: "1.9.0" docs: https://bitwarden.com/help/cli/ docs-md: https://bitwarden.com/help/cli.md api-key-docs: https://bitwarden.com/help/personal-api-key/ --- # Bitwarden CLI Complete reference for interacting with Bitwarden via the command-line interface. **Official documentation:** https://bitwarden.com/help/cli/ **Markdown version (for agents):** https://bitwarden.com/help/cli.md ## Quick Reference ### Installation ```bash # Native executable (recommended) # https://bitwarden.com/download/?app=cli # npm npm install -g @bitwarden/cli # Linux package managers choco install bitwarden-cli # Windows via Chocolatey snap install bw # Linux via Snap ``` ### Authentication Flow (Preferred: Unlock First) **Standard-Workflow (unlock-first):** ```bash # 1. Try unlock first (fast, most common case) export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw 2>/dev/null) # 2. Only if unlock fails, fall back to login if [ -z "$BW_SESSION" ]; then bw login "$BW_EMAIL" "$BW_PASSWORD" export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw) fi # 3. Sync before any vault operation bw sync # 4. End session bw lock # Lock (keep login) bw logout # Complete logout ``` **Alternative: Direct login methods** ```bash bw login # Interactive login (email + password) bw login --apikey # API key login (uses BW_CLIENTID/BW_CLIENTSECRET from .secrets) bw login --sso # SSO login bw unlock # Interactive unlock bw unlock --passwordenv BW_PASSWORD # Auto-available from sourced .secrets ``` ## Session & Configuration Commands ### status Check authentication and vault status: ```bash bw status ``` Returns: `unauthenticated`, `locked`, or `unlocked`. ### config Configure CLI settings: ```bash # Set server (self-hosted or regional) bw config server https://vault.example.com bw config server https://vault.bitwarden.eu # EU cloud bw config server # Check current # Individual service URLs bw config server --web-vault <url> --api <url> --identity <url> ``` ### sync Sync local vault with server (always run before vault operations): ```bash bw sync # Full sync bw sync --last # Show last sync timestamp ``` ### update Check for updates (does not auto-install): ```bash bw update ``` ### serve Start REST API server: ```bash bw serve --port 8087 --hostname localhost ``` ## Vault Item Commands ### list List vault objects: ```bash # Items bw list items bw list items --search github bw list items --folderid <id> --collectionid <id> bw list items --url https://example.com bw list items --trash # Items in trash # Folders bw list folders # Collections bw list collections # All collections bw list org-collections --organizationid <id> # Org collections # Organizations bw list organizations bw list org-members --organizationid <id> ``` ### get Retrieve single values or items: ```bash # Get specific fields (by name or ID) bw get password "GitHub" bw get username "GitHub" bw get totp "GitHub" # 2FA code bw get notes "GitHub" bw get uri "GitHub" # Get full item JSON bw get item "GitHub" bw get item <uuid> --pretty # Other objects bw get folder <id> bw get collection <id> bw get organization <id> bw get org-collection <id> --organizationid <id> # Templates for create operations bw get template item bw get template item.login bw get template item.card bw get template item.identity bw get template item.securenote bw get template folder bw get template collection bw get template item-collections # Security bw get fingerprint <user-id> bw get fingerprint me bw get exposed <password> # Check if password is breached # Attachments bw get attachment <filename> --itemid <id> --output /path/ ``` ### create Create new objects: ```bash # Create folder bw get template folder | jq '.name="Work"' | bw encode | bw create folder # Create login item bw get template item | jq \ '.name="Service" | .login=$(bw get template item.login | jq '.username="user@example.com" | .password="secret"')' \ | bw encode | bw create item # Create secure note (type=2) bw get template item | jq \ '.type=2 | .secureNote.type=0 | .name="Note" | .notes="Content"' \ | bw encode | bw create item # Create card (type=3) bw get template item | jq \ '.type=3 | .name="My Card" | .card=$(bw get template item.card | jq '.number="4111..."')' \ | bw encode | bw create item # Create identity (type=4) bw get template item | jq \ '.type=4 | .name="My Identity" | .identity=$(bw get template item.identity)' \ | bw encode | bw create item # Create SSH key (type=5) bw get template item | jq \ '.type=5 | .name="My SSH Key"' \ | bw encode | bw create item # Attach file to existing item bw create attachment --file ./doc.pdf --itemid <uuid> ``` Item types: `1=Login`, `2=Secure Note`, `3=Card`, `4=Identity`, `5=SSH Key`. ### edit Modify existing objects: ```bash # Edit item bw get item <id> | jq '.login.password="newpass"' | bw encode | bw edit item <id> # Edit folder bw get folder <id> | jq '.name="New Name"' | bw encode | bw edit folder <id> # Edit item collections echo '["collection-uuid"]' | bw encode | bw edit item-collections <item-id> --organizationid <id> # Edit org collection bw get org-collection <id> --organizationid <id> | jq '.name="New Name"' | bw encode | bw edit org-collection <id> --organizationid <id> ``` ### delete Remove objects: ```bash # Send to trash (recoverable 30 days) bw delete item <id> bw delete folder <id> bw delete attachment <id> --itemid <id> bw delete org-collection <id> --organizationid <id> # Permanent delete (irreversible!) bw delete item <id> --permanent ``` ### restore Recover from trash: ```bash bw restore item <id> ``` ## Password Generation ### generate Generate passwords or passphrases: ```bash # Password (default: 14 chars) bw generate bw generate --uppercase --lowercase --number --special --length 20 bw generate -ulns --length 32 # Passphrase bw generate --passphrase --words 4 --separator "-" --capitalize --includeNumber ``` ## Send Commands (Secure Sharing) ### send Create ephemeral shares: ```bash # Text Send bw send -n "Secret" -d 7 --hidden "This text vanishes in 7 days" # File Send bw send -n "Doc" -d 14 -f /path/to/file.pdf # Advanced options bw send --password accesspass -f file.txt ``` ### receive Access received Sends: ```bash bw receive <url> --password <pass> ``` ## Organization Commands ### move Share items to organization: ```bash echo '["collection-uuid"]' | bw encode | bw move <item-id> <organization-id> ``` ### confirm Confirm invited members: ```bash bw get fingerprint <user-id> bw confirm org-member <user-id> --organizationid <id> ``` ### device-approval Manage device approvals: ```bash bw device-approval list --organizationid <id> bw device-approval approve <request-id> --organizationid <id> bw device-approval approve-all --organizationid <id> bw device-approval deny <request-id> --organizationid <id> bw device-approval deny-all --organizationid <id> ``` ## Import & Export ### import Import from other password managers: ```bash bw import --formats # List supported formats bw import lastpasscsv ./export.csv bw import bitwardencsv ./import.csv --organizationid <id> ``` ### export Export vault data: ```bash bw export # CSV format bw export --format json bw export --format encrypted_json bw export --format encrypted_json --password <custom-pass> bw export --format zip # Includes attachments bw export --output /path/ --raw # Output to file or stdout bw export --organizationid <id> --format json ``` ## Utilities ### encode Base64 encode JSON for create/edit operations: ```bash bw get template folder | jq '.name="Test"' | bw encode | bw create folder ``` ### generate (password) See [Password Generation](#password-generation). ### Global Options Available on all commands: ```bash --pretty # Format JSON output with tabs --raw # Return raw output --response # JSON formatted response --quiet # No stdout (use for piping secrets) --nointeraction # Don't prompt for input --session <key> # Pass session key directly --version # CLI version --help # Command help ``` ## Security Reference ### Secure Password Storage (Workspace .secrets) Store the master password in a `.secrets` file in the workspace root and auto-load it: ```bash # Create .secrets file mkdir -p ~/.openclaw/workspace echo "BW_PASSWORD=your_master_password" > ~/.openclaw/workspace/.secrets chmod 600 ~/.openclaw/workspace/.secrets # Add to .gitignore echo ".secrets" >> ~/.openclaw/workspace/.gitignore # Auto-source in shell config (run once) echo 'source ~/.openclaw/workspace/.secrets 2>/dev/null' >> ~/.bashrc # OR for zsh: echo 'source ~/.openclaw/workspace/.secrets 2>/dev/null' >> ~/.zshrc ``` **Now BW_PASSWORD is always available:** ```bash bw unlock --passwordenv BW_PASSWORD ``` **Security requirements:** - File must be mode `600` (user read/write only) - Must add `.secrets` to `.gitignore` - Never commit the .secrets file - Auto-sourcing happens on new shell sessions; run `source ~/.openclaw/workspace/.secrets` for current session ### API Key Authentication (Workspace .secrets) For automated/API key login, store credentials in the same `.secrets` file: ```bash # Add API credentials to .secrets echo "BW_CLIENTID=user.xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" >> ~/.openclaw/workspace/.secrets echo "BW_CLIENTSECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >> ~/.openclaw/workspace/.secrets chmod 600 ~/.openclaw/workspace/.secrets ``` **Login with API key:** ```bash bw login --apikey ``` **⚠️ Known Issue / Workaround** On some self-hosted Vaultwarden instances, `bw login --apikey` may fail with: ``` User Decryption Options are required for client initialization ``` **Workaround - Use Email/Password Login:** ```bash # Add EMAIL to .secrets echo "BW_EMAIL=your@email.com" >> ~/.openclaw/workspace/.secrets # Login with email + password (instead of --apikey) bw login "$BW_EMAIL" "$BW_PASSWORD" # Or as one-liner set -a && source ~/.openclaw/workspace/.secrets && set +a && bw login "$BW_EMAIL" "$BW_PASSWORD" # Then unlock as usual bw unlock --passwordenv BW_PASSWORD ``` **Full workflow (recommended for self-hosted):** ```bash # Source the .secrets file set -a && source ~/.openclaw/workspace/.secrets && set +a # Try unlock first (faster, works if already logged in) export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw 2>/dev/null) # Only login if unlock failed (vault not initialized) if [ -z "$BW_SESSION" ]; then bw login "$BW_EMAIL" "$BW_PASSWORD" export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw) fi # Ready to use bw sync bw list items ``` **Get your API key:** https://bitwarden.com/help/personal-api-key/ ### Environment Variables ```bash BW_CLIENTID # API key client_id BW_CLIENTSECRET # API key client_secret BW_PASSWORD # Master password for unlock BW_SESSION # Session key (auto-used by CLI) BITWARDENCLI_DEBUG=true # Enable debug output NODE_EXTRA_CA_CERTS # Self-signed certs path BITWARDENCLI_APPDATA_DIR # Custom config directory ``` ### Two-Step Login Methods Method values: `0=Authenticator`, `1=Email`, `3=YubiKey`. ```bash bw login user@example.com password --method 0 --code 123456 ``` ### URI Match Types Values: `0=Domain`, `1=Host`, `2=Starts With`, `3=Exact`, `4=Regex`, `5=Never`. ### Field Types Values: `0=Text`, `1=Hidden`, `2=Boolean`. ### Organization User Types `0=Owner`, `1=Admin`, `2=User`, `3=Manager`, `4=Custom`. ### Organization User Statuses `0=Invited`, `1=Accepted`, `2=Confirmed`, `-1=Revoked`. ## Best Practices 1. **Unlock first, login only if needed**: Try `bw unlock` first as it's faster; only run `bw login` if unlock fails (vault not initialized) 2. **Always sync**: Run `bw sync` before any vault operation 3. **Secure session**: Use `bw lock` when done 4. **Protect secrets**: Never log BW_SESSION or BW_PASSWORD 5. **Secure storage**: Keep .secrets file at mode 600, never commit it 6. **Auto-source**: Add to ~/.bashrc or ~/.zshrc for persistent env vars 7. **Verify fingerprints**: Before confirming org members ## Troubleshooting | Issue | Solution | |-------|----------| | "Bot detected" | Use `--apikey` or provide `client_secret` | | "Vault is locked" | Run `bw unlock` and export BW_SESSION | | Self-signed cert error | Set `NODE_EXTRA_CA_CERTS` | | Need debug info | `export BITWARDENCLI_DEBUG=true` | --- **References:** - HTML documentation: https://bitwarden.com/help/cli/ - Markdown (fetchable): https://bitwarden.com/help/cli.md - Personal API Key: https://bitwarden.com/help/personal-api-key/
don't have the plugin yet? install it then click "run inline in claude" again.
by @clawhub
added explicit decision points for api key fallback, self-signed certs, rate limits, session expiry, and empty results; split procedures into numbered steps with clear inputs/outputs; formalized output contract with json examples; added outcome signals for each operation; clarified .secrets file setup with permissions and gitignore; expanded troubleshooting with self-hosted vaultwarden guidance.
use the bitwarden command-line interface to authenticate with your vault, perform CRUD operations on login items/folders/collections, generate passwords, share secrets via Send, and manage organization memberships. use this skill when you need to retrieve passwords programmatically, create new vault entries in bulk, export/import from other password managers, or automate vault access in shell scripts and CI/CD pipelines.
npm install -g @bitwarden/cli), chocolatey (choco install bitwarden-cli), or snap (snap install bw)BW_PASSWORD environment variable, sourced from ~/.openclaw/workspace/.secrets file (mode 600, git-ignored)BW_EMAIL env var in .secretsBW_CLIENTID and BW_CLIENTSECRET env vars from personal api key at https://bitwarden.com/help/personal-api-key/, stored in .secretsNODE_EXTRA_CA_CERTS env varinput: none
output: environment variables (BW_PASSWORD, BW_EMAIL, BW_CLIENTID, BW_CLIENTSECRET) loaded into current shell session
create .secrets file in workspace root with restricted permissions:
mkdir -p ~/.openclaw/workspace
cat >> ~/.openclaw/workspace/.secrets << 'EOF'
BW_PASSWORD=your_master_password
BW_EMAIL=your@email.com
BW_CLIENTID=user.xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
BW_CLIENTSECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EOF
chmod 600 ~/.openclaw/workspace/.secrets
echo ".secrets" >> ~/.openclaw/workspace/.gitignore
source the file in the current shell:
set -a && source ~/.openclaw/workspace/.secrets && set +a
(optional) auto-source on new shell sessions by adding to ~/.bashrc or ~/.zshrc:
echo 'source ~/.openclaw/workspace/.secrets 2>/dev/null' >> ~/.bashrc
input: BW_PASSWORD, BW_EMAIL (if email/password auth) or BW_CLIENTID/BW_CLIENTSECRET (if api key auth)
output: BW_SESSION env var containing session token
attempt unlock first (fast path if already logged in):
export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw 2>/dev/null)
if unlock fails, perform login then unlock:
if [ -z "$BW_SESSION" ]; then
# email/password login
bw login "$BW_EMAIL" "$BW_PASSWORD"
# OR api key login (if credentials exist)
# bw login --apikey
export BW_SESSION=$(bw unlock --passwordenv BW_PASSWORD --raw)
fi
verify authentication status:
bw status
expected output: locked (before unlock) or unlocked (after unlock).
input: BW_SESSION (from step 2)
output: local vault cache synced with cloud/self-hosted server
bw sync
run this before any vault read or write operation. check last sync timestamp with:
bw sync --last
input: operation type, item/folder/collection id or name, optional filters output: json response or raw value depending on command
list all items in vault:
bw list items
list with filters:
bw list items --search github # by name
bw list items --url https://example.com # by url
bw list items --folderid <id> # by folder
bw list items --collectionid <id> # by collection (org)
bw list items --trash # trash only
list folders, collections, organizations:
bw list folders
bw list collections
bw list organizations
bw list org-collections --organizationid <id>
bw list org-members --organizationid <id>
retrieve specific fields by name or id:
bw get password "GitHub" # password field
bw get username "GitHub" # username field
bw get totp "GitHub" # 2fa code
bw get notes "GitHub" # notes field
bw get uri "GitHub" # url field
retrieve full item as json:
bw get item "GitHub"
bw get item <uuid> --pretty
retrieve other object types:
bw get folder <id>
bw get collection <id>
bw get organization <id>
bw get org-collection <id> --organizationid <id>
download attachment:
bw get attachment <filename> --itemid <id> --output /path/
check password breach status:
bw get exposed <password>
get templates for reference:
bw get template item
bw get template item.login
bw get template item.card
bw get template item.identity
bw get template item.securenote
bw get template folder
bw get template collection
create folder:
bw get template folder | jq '.name="Work"' | bw encode | bw create folder
create login item:
bw get template item | jq '.name="Service" | .login |= . + {username:"user@example.com", password:"secret"}' | bw encode | bw create item
create secure note (type=2):
bw get template item | jq '.type=2 | .secureNote.type=0 | .name="Note" | .notes="Content"' | bw encode | bw create item
create card (type=3):
bw get template item | jq '.type=3 | .name="My Card" | .card |= . + {number:"4111..."}' | bw encode | bw create item
create identity (type=4):
bw get template item | jq '.type=4 | .name="My Identity"' | bw encode | bw create item
create ssh key (type=5):
bw get template item | jq '.type=5 | .name="My SSH Key"' | bw encode | bw create item
attach file to existing item:
bw create attachment --file ./doc.pdf --itemid <uuid>
retrieve item, modify json, re-encode and update:
bw get item <id> | jq '.login.password="newpass"' | bw encode | bw edit item <id>
edit folder:
bw get folder <id> | jq '.name="New Name"' | bw encode | bw edit folder <id>
edit item collections (org):
echo '["collection-uuid"]' | bw encode | bw edit item-collections <item-id> --organizationid <id>
soft delete (recoverable for 30 days):
bw delete item <id>
bw delete folder <id>
bw delete attachment <id> --itemid <id>
bw delete org-collection <id> --organizationid <id>
permanent delete (irreversible):
bw delete item <id> --permanent
restore from trash:
bw restore item <id>
input: password length, character sets, passphrase words/separator output: generated password or passphrase string
generate random password (default 14 chars):
bw generate
bw generate --uppercase --lowercase --number --special --length 20
bw generate -ulns --length 32
generate passphrase:
bw generate --passphrase --words 4 --separator "-" --capitalize --includeNumber
input: send name, data (text or file path), ttl (days), optional password output: shareable url
create text send (expires in 7 days):
bw send -n "Secret" -d 7 --hidden "This text vanishes in 7 days"
create file send (expires in 14 days):
bw send -n "Doc" -d 14 -f /path/to/file.pdf
create send with password protection:
bw send --password accesspass -f file.txt
input: send url, optional password output: decrypted send content
bw receive <url> --password <pass>
input: item id, organization id, user id, collection uuid output: json confirmation or member status
move item to organization collection:
echo '["collection-uuid"]' | bw encode | bw move <item-id> <organization-id>
get user fingerprint for security verification:
bw get fingerprint <user-id>
bw get fingerprint me
confirm organization member (after verifying fingerprint):
bw confirm org-member <user-id> --organizationid <id>
list and approve device requests:
bw device-approval list --organizationid <id>
bw device-approval approve <request-id> --organizationid <id>
bw device-approval approve-all --organizationid <id>
bw device-approval deny <request-id> --organizationid <id>
bw device-approval deny-all --organizationid <id>
input: source file path (import) or output path (export), format type output: imported items in vault or exported file at specified path
import from other password managers:
bw import --formats # list supported formats
bw import lastpasscsv ./export.csv
bw import bitwardencsv ./import.csv --organizationid <id>
export vault to csv:
bw export
bw export --output /path/export.csv --raw
export to json:
bw export --format json
bw export --format json --output /path/export.json --raw
export encrypted json (encrypted on disk with custom password):
bw export --format encrypted_json
bw export --format encrypted_json --password <custom-pass> --output /path/export.json
export with attachments as zip:
bw export --format zip --output /path/export.zip
export organization vault:
bw export --organizationid <id> --format json
input: none output: session cleared or logged out
lock vault (session persists, can unlock quickly):
bw lock
logout (complete session termination):
bw logout
if already logged in with active session: run bw unlock --passwordenv BW_PASSWORD --raw (fast path). only proceed to bw login if unlock fails with empty output.
if using api key authentication: check whether target bitwarden instance (self-hosted or cloud) supports bw login --apikey. on some vaultwarden instances, this fails with "User Decryption Options are required". if so, fall back to bw login "$BW_EMAIL" "$BW_PASSWORD" instead.
if self-signed cert on self-hosted instance: before any bw command, set NODE_EXTRA_CA_CERTS=/path/to/cert.pem to bypass tls verification errors.
if operation returns empty result set: (e.g., bw list items --search nonexistent returns []), this is not an error. proceed with empty handling in calling logic.
if rate limit hit: bitwarden cloud enforces request throttling. back off exponentially (1s, 2s, 4s) before retry. this is rare in CLI usage but may occur with rapid api key logins.
if session expires: bitwarden sessions last approximately 24 hours. if a command fails with "session invalid" or "unauthorized", re-run step 2 (unlock/login) to refresh BW_SESSION.
if creating item from template and jq fails: validate json syntax with bw get template item | jq empty before piping to bw encode. use --pretty flag on bw get commands to debug json structure.
if soft-delete recovery window expires: items deleted with bw delete item <id> remain in trash for 30 days only. after 30 days, permanent deletion is automatic. plan recovery workflows within this window.
if vault not initialized (first time login): bw unlock will fail with "vault is empty" or similar. this is expected. proceed with bw login to initialize.
if two-step login (2fa) required: add --method <code> and --code <value> flags to bw login:
--method 0 (authenticator app), --method 1 (email), --method 3 (yubikey)bw login user@example.com password --method 0 --code 123456if exporting organization data: ensure user has admin or owner role. provide --organizationid <id> flag. non-admin users cannot export full org vault.
all operations return json by default (or raw text for specific queries like bw get password). success is indicated by:
bw status returns unlocked state. BW_SESSION env var is set and non-empty.id, name, type fields and nested data. empty array [] is valid (no matches).{
"object": "item",
"id": "uuid",
"name": "GitHub",
"login": {
"username": "user@example.com",
"password": "secret",
"totp": "otpauth://..."
},
"notes": "...",
"fields": [...]
}
id and revisionDate.aB3$x9Kl2m@pQ).id and accessId for url construction.--raw). size depends on vault contents.all responses use --pretty flag for human-readable formatting or --quiet to suppress stdout (for piping secrets).
error responses are json with statusCode and message fields (example: {"statusCode":401,"message":"Invalid credentials"}).
bw status outputs locked or unlocked. no error thrown.bw get password "GitHub"
# output: secretpassword (not redacted, handle with --quiet if needed)
bw list items --search <name> and has assigned uuid.bw get item <id> reflects updated fields.bw list items --trash shows soft-deleted item. bw list items no longer shows it.bw generate outputs a string with requested character set and length.https://vault.bitwarden.com/#/send/... (or custom domain). recipient can access via this url.bw sync --last outputs recent timestamp. subsequent reads reflect server state.bw list items includes newly imported items.bw status returns locked after bw lock.bw status returns unauthenticated after bw logout.set bitwarden server endpoint (cloud or self-hosted):
bw config server https://vault.bitwarden.com # default (cloud)
bw config server https://vault.bitwarden.eu # EU cloud
bw config server https://vault.example.com # self-hosted
bw config server # check current
set individual service urls (advanced):
bw config server --web-vault <url> --api <url> --identity <url>
--pretty # format json with indentation
--raw # output raw value (no json wrapper)
--response # json formatted response envelope
--quiet # suppress stdout (useful for piping secrets)
--nointeraction # skip interactive prompts
--session <key> # pass session directly (override BW_SESSION)
--version # show cli version
--help # show command help
start local http api gateway (beta, not recommended for production):
bw serve --port 8087 --hostname localhost
| issue | solution |
|---|---|
| "Bot detected" | use --apikey login or set BW_CLIENTSECRET. cloud rate limits interactive logins. |
| "Vault is locked" | run bw unlock --passwordenv BW_PASSWORD and export BW_SESSION. |
| "Vault is empty" | first-time login. run bw login to initialize vault from server. |
| "User Decryption Options are required" (self-hosted) | use email/password login (bw login "$BW_EMAIL" "$BW_PASSWORD") instead of --apikey. some vaultwarden versions don't support api key auth. |
| "Self-signed cert rejected" | set NODE_EXTRA_CA_CERTS=/path/to/cert.pem before running bw commands. |
| "Session invalid" or "Unauthorized" | session expired (typically after 24h). re-authenticate with bw unlock or bw login. |
| "Command not found: jq" | install jq (brew install jq or apt-get install jq). needed for json manipulation in create/edit pipelines. |
| "Need debug output" | set export BITWARDENCLI_DEBUG=true before bw commands. very verbose. |
| "Can't find .secrets file" | ensure path is ~/.openclaw/workspace/.secrets and permissions are 600. verify with ls -la ~/.openclaw/workspace/.secrets. |
bw unlock first. only login if vault is not initialized. unlock is faster and avoids unnecessary api calls.bw sync before reading or writing vault data. local cache can lag server state.BW_SESSION only when needed. lock vault with bw lock when done. never log or print session tokens.600. add to .gitignore. never commit credentials to git.source ~/.openclaw/workspace/.secrets 2>/dev/null to ~/.bashrc or ~/.zshrc for automatic env var loading on new shells.bw confirm org-member, verify their fingerprint via out-of-band channel (voice, in-person, etc.) to prevent account spoofing.if ! bw sync; then
echo "sync failed" >&2
exit 1
fi
bw get password <name> --quiet | xargs ... to avoid printing to terminal.--format encrypted_json --password <strong-pass> when exporting vault for transport.Credits: original skill authored by tfm. enriched per implexa quality standards to include explicit decision points, edge case handling, environment setup guidance, and troubleshooting reference.