Chainenv
Use this skill when the user wants to work with the installed chainenv CLI. This skill is for operating the product, not for changing its source code.
Prerequisites
chainenvmust be installed and available onPATH.- Start with
chainenv diagto confirm backend availability on the current machine. - For 1Password flows, the
opCLI must be installed. Authentication can come from an activeopsession or fromOP_SERVICE_ACCOUNT_TOKEN. - If config-driven behavior matters, read
references/auth.mdfor.chainenv.tomllayout and token-loading behavior.
When To Use It
Use this skill for:
- backend diagnostics
- reading stored secrets with
getorget-env - generating shell exports for bash, zsh, fish, or plain output
- writing or updating secrets with
setandupdate - copying secrets between keychain and 1Password
- explaining how
.chainenv.tomlaffects provider selection and default fallbacks
Read references/commands.md when you need exact command forms.
Read references/usage.md when you need workflow guidance or troubleshooting.
Operating Guidance
- Confirm the CLI is installed and run
chainenv diag. - Prefer read-only commands first:
ls,list,get, orget-env. - Check whether config should drive provider selection or default fallbacks.
- Use write commands only after the target key and backend are explicit.
- Prefer keychain for day-to-day reads when 1Password latency is a concern.
Command Selection
- Use
chainenv lsto list all stored accounts in the selected backend. - Use
chainenv listto list keys declared in config. - Use
chainenv get <KEY>for one secret. - Use
chainenv get-env ... --shell <shell>for multi-key shell exports. - Use
chainenv get-env --shell <shell>with no keys only when config files define the keys to load. - Use
chainenv setto create a secret and register it in config. - Use
chainenv updateto change an existing secret. - Use
chainenv copyorchainenv cpto move secrets between backends.
Prefer --shell fish|bash|zsh for new examples. The legacy --fish, --bash, and --zsh flags still work when matching older user setups.
Failure Guidance
- If
chainenv diagshows the keychain backend unavailable, the host may not support the selected backend or the keyring service is missing. - If 1Password commands fail, check for
oponPATH, signed-in state, and whetherOP_SERVICE_ACCOUNT_TOKENis set or can be loaded from config. - If
get-envwithout explicit keys printsNo config foundorNo keys found, switch to explicit key arguments or fix the config file. defaultvalues in config are plaintext fallbacks, not encrypted secrets.- Prefer live
chainenv --helpand subcommand help over stale documentation when they differ.