/chainenv:chainenvfrom chainenv
Use chainenv to manage local secrets, copy between backends, or troubleshoot its configuration.
Ships in chainenv. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill to run chainenv safely and produce exact commands for backend diagnostics, config-aware secret retrieval, shell export generation, writes, and backend-to-backend copy flows.
Prefer live CLI help and source behavior over older README snippets when they differ.
Read references/commands.md when you need the command matrix, config examples, or details about backend/provider resolution.
chainenv diag.ls, list, get, or get-env.set, update, copy / cp.Install the CLI with one of:
brew install dvcrn/formulas/chainenv
npm install -g @dvcrn/chainenv
go install github.com/dvcrn/chainenv@latest
Use chainenv diag to confirm which backends are available on the current machine.
security-backed keychain supportop CLI and either a signed-in session or OP_SERVICE_ACCOUNT_TOKENConfig lookup walks upward from the current directory and prefers:
.chainenv.tomlchainenv.tomlUse config to:
chainenv listdefault fallbacks when a secret is missing["1password"].service_account_token_key from keychain into OP_SERVICE_ACCOUNT_TOKENIf the user runs get-env with no explicit keys, chainenv reads keys from config. If a key entry declares provider, that provider overrides the global --backend default for that key.
Use these as canonical examples:
# diagnose backend availability
chainenv diag
# list all stored accounts in the selected backend
chainenv ls
chainenv ls --backend 1password
# list keys declared in config
chainenv list
# get one secret, honoring config-based provider/default when present
chainenv get GITHUB_TOKEN
# export selected keys for shell consumption
chainenv get-env GITHUB_TOKEN,OPENAI_API_KEY --shell zsh
chainenv get-env GITHUB_TOKEN,OPENAI_API_KEY --fish
# export all configured keys from .chainenv.toml / chainenv.toml
chainenv get-env --shell bash
# store a new secret and upsert the key into config
chainenv set GITHUB_TOKEN secret-value
chainenv set FEATURE_FLAG true --default true
# update an existing secret
chainenv update GITHUB_TOKEN new-secret-value
# copy secrets between backends
chainenv copy --from 1password --to keychain GITHUB_TOKEN,OPENAI_API_KEY
chainenv cp --from keychain --to 1password GITHUB_TOKEN
Use --shell fish|bash|zsh by default for new commands.
Legacy --fish, --bash, and --zsh flags still work and are useful when mirroring older examples.
Before write operations:
ls, list, or get before set, update, or copy.copy / cp to move secrets from 1Password to keychain when the user wants faster local reads.default values in config are plaintext fallbacks, not encrypted secrets.If 1Password access fails, check whether op is installed, whether the user is signed in, and whether config points ["1password"].service_account_token_key at a keychain item that can populate OP_SERVICE_ACCOUNT_TOKEN.
Prefer live chainenv --help and subcommand help over README snippets when they differ.
One important example: update is implemented and exposed by live help even though older README sections may omit it from the top-level command list.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dvcrn/skills --plugin chainenv