name: bitwarden-secrets description: > Retrieve and manage secrets using Bitwarden Secrets Manager CLI (bws). Trigger terms: bitwarden, secrets, bws, secret, api key, credentials, password.
Use when
- Retrieving API keys, passwords, or credentials for a task
- Listing available secrets or projects
- Creating or updating secrets
Don't use when
- Storing secrets in code or config files (use bws instead)
- Managing Bitwarden vault items (use
bwCLI, notbws)
Prerequisites
bwsCLI installedBWS_ACCESS_TOKENenvironment variable set
Quick Reference
| Action | Command |
|---|---|
| Get secret | bws secret get <SECRET_ID> |
| List secrets | bws secret list |
| List in project | bws secret list <PROJECT_ID> |
| List projects | bws project list |
| Create secret | bws secret create <KEY> <VALUE> <PROJECT_ID> |
| Edit secret | bws secret edit <SECRET_ID> --value <VALUE> |
| Delete secret | bws secret delete <SECRET_ID> |
Outputs
Use --output flag: json, yaml, table, tsv, env
bws secret get <ID> --output json
bws secret list --output table
Templates or Examples
- Use the
bws secret list --format jsonoutput when a structured list is required. - Use the
bws secret get --format jsonoutput when the user needs an exact payload.
Procedure
- List projects to find where secrets are stored
- List secrets in the relevant project
- Get secret by ID to retrieve the value
- Use the secret value in your task (don't log it)
Checks & Guardrails
- Never echo or log secret values
- Don't commit secrets to git
- Use
--output jsonfor parsing in scripts