微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔐

企业级密码库安全管理

bitwarden · vlatest
效率 安全 A 级 作者 Unknown 公开目录收录
696 下载 278 安装 1.7k 收藏 22.8k 浏览

简介

基于 Bitwarden CLI 的密码管理技能,提供安全的会话隔离与凭证获取方案,适合开发运维场景下的密钥自动化管理。

原始描述

Set up and use Bitwarden CLI (bw). Use when installing the CLI, unlocking vault, or reading/generating secrets via bw. Handles session management with BW_SESSION.

通过你的 Agent 添加

安装目录:bitwarden/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/bitwarden/
Codex CLI~/.codex/skills/bitwarden/
DeepSeek Harness~/.agents/skills/bitwarden/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: bitwarden description: "Bitwarden Public API skill — auto-forged from OpenAPI 1.0.0. Bitwarden Public API for Organizations — manage members, collections, groups, events, and policies." triggers: ["bitwarden API", "working with Bitwarden Public API"] version: 1.0.0 forged-from: openapi api-title: Bitwarden Public API api-version: 1.0.0

Bitwarden Public API API Skill

Per-endpoint pages collapsed. The 28 commands/*.md files (one per endpoint) were removed to cut file count — they were forge-generated, unrouted, and reproduce what Context7 (live API docs) and the typed client.ts already provide (some integrations also expose a live MCP server). The Slash Commands inventory below is retained. Restore full offline curl/param detail any time: node bin/forge-skill-from-openapi.mjs <spec-url> skills/bitwarden --name bitwarden.

Auto-forged from the Bitwarden Public API OpenAPI spec (v1.0.0).

What this skill provides

  • 28 slash commands — one per API endpoint, with curl examples and typed guidance
  • types.ts — TypeScript types auto-generated from OpenAPI schemas
  • client.ts — Typed fetch-based API client (zero deps, Workers-compatible)

Slash Commands

  • /get-ciphers — List all items in the organization vault
  • /get-ciphers-id — Retrieve a vault item
  • /put-ciphers-id — Update a vault item
  • /delete-ciphers-id — Delete a vault item
  • /post-ciphers-create — Create a new vault item in an existing collection
  • /get-collections — List all collections in the organization
  • /post-collections — Create a new collection
  • /get-collections-id — Retrieve a collection
  • /put-collections-id — Update a collection
  • /delete-collections-id — Delete a collection
  • /get-members — List all members of the organization
  • /post-members — Invite a new member to the organization
  • /get-members-id — Retrieve a member of the organization
  • /put-members-id — Update an organization member
  • /delete-members-id — Remove a member from the organization
  • /post-members-id-reinvite — Re-invite a member to the organization
  • /post-members-id-confirm — Confirm a member of the organization
  • /get-groups — List all groups in the organization
  • /post-groups — Create a new group
  • /get-groups-id — Retrieve a group
  • /put-groups-id — Update a group
  • /delete-groups-id — Delete a group
  • /get-groups-id-member-ids — Get member IDs for a group
  • /put-groups-id-member-ids — Update members of a group
  • /get-events — List organization event logs
  • /get-policies — List all policies for the organization
  • /get-policies-type — Retrieve a policy by type
  • /put-policies-type — Update a policy

Auth — OAuth2 client_credentials flow (NOT a simple API key)

Bitwarden Public API uses OAuth2 client_credentials. There is no bearer API key — you must exchange credentials for a short-lived access token first.

Step 1 — Get credentials from the Bitwarden web vault

  1. Log in at https://vault.bitwarden.com (or your self-hosted URL).
  2. Go to Settings → Organizations → [Your Org] → Settings → API Key.
  3. Copy client_id (format: organization.<uuid>) and client_secret.

Step 2 — Exchange for an access token

curl -s -X POST https://identity.bitwarden.com/connect/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=$BW_CLIENT_ID" \
  -d "client_secret=$BW_CLIENT_SECRET" \
  -d "scope=api.organization" \
  | jq -r '.access_token'

Response shape:

{
  "access_token": "eyJ...",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "api.organization"
}

Step 3 — Call the API with the token

export BW_TOKEN=$(curl -s -X POST https://identity.bitwarden.com/connect/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id=$BW_CLIENT_ID&client_secret=$BW_CLIENT_SECRET&scope=api.organization" \
  | jq -r '.access_token')

curl -s https://api.bitwarden.com/public/members \
  -H "Authorization: Bearer $BW_TOKEN"

Step 4 — Token TTL and refresh

  • Tokens expire after 1 hour (expires_in: 3600).
  • There is no refresh token in client_credentials flow — re-run the token endpoint to get a new one.
  • For long-running scripts, re-fetch the token before each session or on 401 response.

.env pattern

# ~/.env or project .env (never commit)
BW_CLIENT_ID=organization.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
BW_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Load with get-secret BW_CLIENT_ID / get-secret BW_CLIENT_SECRET per the project secret pattern, or source $CLAUDE_ENV_FILE when the env file is set.

TypeScript client usage

import { BitwardenClient } from './bitwarden/client.js';

// Exchange credentials for token first
const tokenRes = await fetch('https://identity.bitwarden.com/connect/token', {
  method: 'POST',
  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  body: new URLSearchParams({
    grant_type: 'client_credentials',
    client_id: process.env.BW_CLIENT_ID!,
    client_secret: process.env.BW_CLIENT_SECRET!,
    scope: 'api.organization',
  }),
});
const { access_token } = await tokenRes.json();

const client = new BitwardenClient(access_token);

Do not pass BW_CLIENT_ID or BW_CLIENT_SECRET directly to BitwardenClient — the constructor expects the short-lived access_token, not the long-lived credentials.

Maintenance

  • Re-forge: node ~/.agentskills/bin/forge-skill-from-openapi.mjs <spec-url> skills/bitwarden --name bitwarden
  • Hand-edit: add examples, tweak descriptions, add business-context to commands.
  • Spec drift: re-running forge overwrites generated files; custom edits in commands/*.md survive if you rename the file.

Source

Generated 2026-06-18 by forge-skill-from-openapi. Spec: https://api.bitwarden.com/public

Multi-Swarm Parallelization & OpenCode (DeepSeek) Offload Mandate

  • Whole-change dispatch. Apply rules/openspec-change-ownership.md and rules/agent-provider-policy.md. Assign each OpenSpec change one owner through verification. Route suitable bounded changes to OpenCode with DeepSeek through LiteLLM.
  • Architecture and verification: Route material decisions through rules/evidence-gated-autonomous-orchestration.md. Its conference and risk gates govern provider selection and independence.
  • Reuse review: Review reuse during implementation under control-plane/RUNTIME.md. Capture cited proposals for application code in theme.tools, host configuration in install.doctor, and agent guidance in agent-skills. Submit authorized findings to same-run OpenSpec admission.
  • Concurrent End-of-Prompt Delivery Closure: Run documentation/comment reconciliation and bounded theme.tools, install.doctor, and agent-skills extraction reviews concurrently with proportional tests and release preparation. After reconciling those changes and generated outputs, revalidate the exact final tree. Commit only that tested tree, push it normally to main, promote it through the approved production rail, and run production smoke plus critical E2E verification. Fail closed without mutating production when authority, credentials, spending permission, review, recovery, validation, or provenance gates are missing; record the exact blocker instead.
  • DeepSeek-first parallel dispatch At intake and after each dependency clears, dispatch independent OpenSpec changes concurrently whenever doing so reduces time to verified delivery. Delegate suitable whole OpenSpec changes to OpenCode with DeepSeek through LiteLLM when it meets the acceptance bar and improves throughput. Use Codex, Gemini, or Claude for work that benefits materially from premium capability or independent review, and record concrete reasons for premium routing or limited dispatch. Scale worker count to ready work, isolation, and approved capacity.

正文来自原始仓库, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

原始仓库

作者的项目地址:https://github.com/heymegabyte/agent-skills

标签

securitypassword-managerclidevopsautomationbackendproductivity

同类 Skill