StartupBros

Bitwarden Vault CLI

开发编程v1.0.0
作者:StartupBros更新于 2026-05-11bitwarden-vault
#Email

据 AlphaMoat 统计,截至 2026-09,Bitwarden Vault CLI 累计下载 4,501 次、获 6 个星标,在全部 5,078 个 AI 技能中排名第 2,144 位,在「开发编程」分类(577 个)中排名第 270 位。

累计安装
150
累计下载
4,501
星标
6
全站排名
#2,144
全站前 43% · 「开发编程」前 47%
平台累计安装累计下载星标评论
ClawHub ↗1504,5016-

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

该 CLI 可访问完整保管库,支持邮箱/密码、API key 和 SSO 登录;解锁后需要在命令会话中使用 BW_SESSION。会话令牌和导出的秘密可能留在持续运行的 shell/tmux 中。不得将秘密显示在日志、代码或用户可见输出中,操作完成后应锁定保管库并关闭不再需要的会话。创建、编辑或删除保管库项目前必须取得明确确认;优先只读、最小范围操作。 文档流程要求 bw 和专用 tmux 会话。

资料发布于 2026-10-29

可以用来做什么

  • 在用户授权后查找指定保管库项目的相关凭据
  • 确认 CLI 登录状态和安全的会话管理要求
  • 为命令行工作流规划不输出秘密值的凭据读取方案

什么时候用

  • 用户明确授权访问保管库且命令环境安全隔离时
  • 可以避免回显秘密、及时锁定保管库并确认所有写入操作时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

说明读取指定保管库项目所需的安全步骤,但不要登录、解锁保管库、读取或输出任何秘密。

月度数据趋势

累计下载4,501
2,9313,7744,6172026-03 · 累计下载 3,0472026-05 · 累计下载 3,6932026-06 · 累计下载 3,8742026-07 · 累计下载 4,2032026-08 · 累计下载 4,3692026-09 · 累计下载 4,50126-0326-09
星标6
5672026-03 · 星标 62026-05 · 星标 62026-06 · 星标 62026-07 · 星标 62026-08 · 星标 62026-09 · 星标 626-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,501—6
2026-084,369+3.9%6
2026-074,203+8.5%6
2026-063,874+4.9%6
2026-053,693—6
2026-033,047—6

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

3.9 KB · ClawHub v1.0.0
---
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.
展开全部(共 104 行)

## 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 `bw unlock` to decrypt the vault.

### Session Key Management

The unlock command outputs a session key. You **must** export it:

```bash
# Bash/Zsh
export BW_SESSION="<session_key_from_unlock>"

# Or capture automatically
export BW_SESSION=$(bw unlock --raw)
```

Session keys remain valid until you run `bw lock` or `bw logout`. They do **not** persist across terminal windows—hence the tmux requirement.

## Reading Secrets

```bash
# Get password by item name
bw get password "GitHub"

# Get username
bw get username "GitHub"

# Get TOTP code
bw get totp "GitHub"

# Get full item as JSON
bw get item "GitHub"

# Get specific field
bw get item "GitHub" | jq -r '.fields[] | select(.name=="api_key") | .value'

# List all items
bw list items

# Search items
bw list items --search "github"
```

## Security Guardrails

- **NEVER** expose secrets in logs, code, or command output visible to users
- **NEVER** write secrets to disk unless absolutely necessary
- **ALWAYS** use `bw lock` when finished with vault operations
- **PREFER** reading secrets directly into environment variables or piping to commands
- If you receive "Vault is locked" errors, re-authenticate with `bw unlock`
- If you receive "You are not logged in" errors, run `bw login` first
- Stop and request assistance if tmux is unavailable on the system

## Environment Variables

| Variable | Purpose |
|----------|---------|
| `BW_SESSION` | Session key for vault decryption (required for all vault commands) |
| `BW_CLIENTID` | API key client ID (for `--apikey` login) |
| `BW_CLIENTSECRET` | API key client secret (for `--apikey` login) |
| `BITWARDENCLI_APPDATA_DIR` | Custom config directory (enables multi-account setups) |

## Self-Hosted Servers

For Vaultwarden or self-hosted Bitwarden:

```bash
bw config server https://your-bitwarden-server.com
```

## Reference Documentation

- [Get Started Guide](references/get-started.md) - Installation and initial setup
- [CLI Examples](references/cli-examples.md) - Common usage patterns and advanced operations

「开发编程」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。