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
累計下載
4501
星標
6
全站排名
#2,144
全站前 43% · 「開發程式設計」前 47%
平台累計安裝累計下載星標評論
ClawHub ↗15045016-

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該 CLI 可訪問完整保管庫,支援電子郵件/密碼、API key 和 SSO 登入;解鎖後需要在命令會話中使用 BW_SESSION。會話令牌和匯出的秘密可能留在持續執行的 shell/tmux 中。不得將秘密顯示在日誌、程式碼或使用者可見輸出中,操作完成後應鎖定保管庫並關閉不再需要的會話。建立、編輯或刪除保管庫專案前必須取得明確確認;優先只讀、最小範圍操作。 文件流程要求 bw 和專用 tmux 會話。

資料釋出於 2026-10-29

可以用來做什麼

  • 在使用者授權後查詢指定保管庫專案的相關憑據
  • 確認 CLI 登入狀態和安全的會話管理要求
  • 為命令列工作流規劃不輸出秘密值的憑據讀取方案

什麼時候用

  • 使用者明確授權訪問保管庫且命令環境安全隔離時
  • 可以避免回顯秘密、及時鎖定保管庫並確認所有寫入操作時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

說明讀取指定保管庫專案所需的安全步驟,但不要登入、解鎖保管庫、讀取或輸出任何秘密。

月度資料趨勢

累計下載4501
2931377446172026-03 · 累計下載 30472026-05 · 累計下載 36932026-06 · 累計下載 38742026-07 · 累計下載 42032026-08 · 累計下載 43692026-09 · 累計下載 450126-0326-09
星標6
5672026-03 · 星標 62026-05 · 星標 62026-06 · 星標 62026-07 · 星標 62026-08 · 星標 62026-09 · 星標 626-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094501—6
2026-084369+3.9%6
2026-074203+8.5%6
2026-063874+4.9%6
2026-053693—6
2026-033047—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),按月更新。口徑說明見資料方法。