BM-3003: refactor(ops-skills): migrate credentials to Bitwarden CLI#2006
Open
jonastheis wants to merge 3 commits into
Open
BM-3003: refactor(ops-skills): migrate credentials to Bitwarden CLI#2006jonastheis wants to merge 3 commits into
jonastheis wants to merge 3 commits into
Conversation
Replace the gitignored `network_secrets.toml` with the Bitwarden CLI as
the single source of truth for credentials used by the ops-query umbrella
skill and its four sub-skills (`ops-indexer-query`, `ops-telemetry-query`,
`ops-logs-query`, `ops-pipelines`).
- New shared helpers under `.claude/skills/ops-query/references/`:
- `bw-credentials.sh` — sourced bash helpers (`bw_ensure_ready`,
`bw_load_aws`, `bw_load_indexer`, `bw_load_redshift_url`). All lookups
go through `bw_get_by_name` which does an exact-name match via
`bw list items --search` + jq, working around bw's fuzzy `bw get item`
matching (`prod_base` would otherwise also match `prod_base_sepolia`).
- `bw-credentials.md` — setup, bootstrap, troubleshooting, and a
Known Issues section flagging the v2026.3.0/4.1 regression that breaks
non-interactive use (bitwarden/clients#20703), with the v2026.2.0
npm pin workaround.
- `bw-migrate-from-toml.sh` — idempotent one-shot migration that reads
`network_secrets.toml` and creates 17 derivable items. The 18th
(`boundless-ops-aws-ops`) is seeded directly into the shared vault by
an admin.
- Each SKILL.md credential step collapses to the same pattern:
source .claude/skills/ops-query/references/bw-credentials.sh
bw_ensure_ready || exit 1
bw_load_aws prod # or bw_load_indexer prod_base, etc.
Plaintext TOML fallback paths are removed entirely; the skills fail
loud with install/unlock instructions if `bw` is missing or locked.
Out of scope: `ops-check-balances` still references `network_secrets.toml`
for QuikNode RPC keys (`[networks.<chain>.rpc]`); tracked as a follow-up.
willpote
approved these changes
May 20, 2026
- bw_ensure_ready now probes `bw status` instead of `bw list`. The list probe exited 0 on a locked vault (interactive prompt fails after stdin is closed, but bw still returns success), so the helper falsely reported ready and downstream loaders surfaced the lock as "missing item". - Rename local `status` -> `vault_state`; zsh reserves `status` as a read-only alias for $?, so sourcing the helper from zsh blew up. - Fix install hint to `npm install -g @bitwarden/cli@2026.2.0`; the Homebrew package ships the broken 2026.3.x/2026.4.x releases that the docs already tell users to avoid. - Drop the no-restart "paste !export BW_SESSION=... into the prompt" recovery path. Claude Code's Bash tool spawns a fresh subprocess per call, so an export from the prompt's shell isn't visible to subsequent tool calls. BW_SESSION must be exported in the parent shell before `claude` launches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the gitignored
network_secrets.tomlwith the Bitwarden CLI as the single source of truth for credentials used by theops-queryumbrella skill and its four sub-skills (ops-indexer-query,ops-telemetry-query,ops-logs-query,ops-pipelines).Why:
bw syncpicks up the new value).Changes
New files (under
.claude/skills/ops-query/references/)bw-credentials.sh— sourced bash helpers:bw_ensure_ready,bw_load_aws,bw_load_indexer,bw_load_redshift_url. All lookups go throughbw_get_by_name(exact-name match viabw list items --search+ jq), working around bw's fuzzybw get itemmatching where e.g.prod_basealso matchesprod_base_sepolia.bw-credentials.md— install (npm-pinned to2026.2.0), per-shell unlock, bootstrap (one-time team seed + shared vault), troubleshooting, and a Known Issues section flagging the v2026.3.0/4.1 regression that breaks non-interactive bw use (bitwarden/clients#20703).bw-migrate-from-toml.sh— idempotent one-shot migration. Readsnetwork_secrets.toml, creates 17 items (8 indexer + 6 telemetry + 3 AWS). The 18th itemboundless-ops-aws-opsis added to the shared collection separately by an admin from runbook credentials.SKILL.md updates — each credential-loading step collapses to the same pattern:
```bash
source .claude/skills/ops-query/references/bw-credentials.sh
bw_ensure_ready || exit 1
bw_load_aws prod # or bw_load_indexer prod_base, bw_load_redshift_url prod_base, etc.
```
Plaintext TOML fallback paths are removed entirely — the skills fail loud with install/unlock instructions if
bwis missing or locked.Bitwarden item schema (18 items)
boundless-ops-aws-<prod|staging|dev|ops>boundless-ops-indexer-<env>chain,environmenttext fields)boundless-ops-telemetry-<env>readonly, password, +db_url/chain/environmentRollout
bash .claude/skills/ops-query/references/bw-migrate-from-toml.shagainst their local TOML and moves the resulting items into the sharedBoundless Opscollection (or equivalent).boundless-ops-aws-opsto the same collection.bw syncmakes the items appear locally.Out of scope
ops-check-balancesstill referencesnetwork_secrets.tomlfor QuikNode private RPC keys ([networks.<chain>.rpc]). Those blocks don't exist in the current TOML; tracked as a follow-up.Test plan
bw_load_aws prod && aws sts get-caller-identityreturns the prod accountbw_load_aws ops && aws codepipeline list-pipelinesworksbw_load_indexer prod_base && curl -H "x-api-key: $INDEXER_API_KEY" "$MARKET_INDEXER_URL/v1/market/requests?limit=1"returns databw_load_redshift_url prod_base && psql "$REDSHIFT_URL" -c 'SELECT 1'returns one rowbw_ensure_readyexits non-zero and prints the unlock instructionsmarket-summaryonprod_base) end-to-end with nonetwork_secrets.tomlreads