From chainenv
Operate the `chainenv` CLI for local secret workflows across macOS Keychain, Linux keyring, and optional 1Password integration. Use when requests mention `chainenv`, `.chainenv.toml`, `chainenv.toml`, keychain vs 1Password, shell export generation, copying secrets between backends, or troubleshooting backend availability and `op` token loading.
How this skill is triggered — by the user, by Claude, or both
Slash command
/chainenv:chainenvThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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.
npx claudepluginhub dvcrn/skills --plugin chainenvGuides 1Password CLI (op) integration for secret management in dev workflows with .op.env files, Makefile/Docker Compose/Kamal/CI patterns for infrastructure, deployments, local dev.
Manages full lifecycle of secrets and environment variables: decides placement (constant, .env, CI secret, env var), scaffolds .env.example/.gitignore, add/update/rotate/remove/migrate/audit/provision across envs. Language-agnostic.
Guides secure secrets management using Vault, AWS Secrets Manager, Azure Key Vault, environment variables, rotation, scanning tools, and CI/CD security. For implementing storage, rotation, leak prevention, credentials review.