"Move to environment variable" action — convert a plaintext secret into a ${VAR} reference in place #83
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #76, which lands the authoring and safety layer for
${VAR}references but no way to get one without typing it by hand.What
After #76, BCC warns when a config holds a raw credential and points the user toward
${VAR}. It doesn't help them make the change. The gap is a one-click conversion:${KEY_NAME}(defaulting the variable name to the row's key, editable).args_secret_warningflags.The conversion itself is trivial; the useful part is that BCC then knows the variable name and can tell the user what to do next.
The bit that needs thought
Replacing the value deletes the actual secret from the config. If the user hasn't set the variable in their environment, the server stops working and the credential may be gone from the only place they had it.
So the action needs to hand the secret back before removing it — copy to clipboard, plus the exact shell line for their platform:
Worth checking whether the variable is already set in BCC's environment and skipping the ceremony when it is.
Gating
Only offer this on profiles whose client expands references —
client_expands_env_refs()from #76. Offering it on a Claude Desktop profile would walk the user into a broken config, which is the failure mode #76 exists to prevent.Tests
The rewrite is pure (
datain →dataout) and belongs inbcc_core: value replaced with the right reference, variable name derived from the key and sanitised to a legal shell name, non-secret rows untouched, and the action refusing to fire on a non-expanding profile.