Tasks people actually reach for envctl to do.
DATABASE_URL=$(envctl get .env DATABASE_URL) || exit 1get writes the raw value to a pipe, so command substitution keeps working.
Exit 1 means the key has no active definition, which is worth checking rather
than carrying an empty string forward.
envctl --dry-run set .env FEATURE_X true # look first
envctl set .env FEATURE_X true # then do itThe dry run prints the exact diff and writes nothing.
envctl disable .env DEBUG # becomes #DEBUG=verbose
envctl enable .env DEBUG # back, same valueBetter than deleting and retyping, since the value stays in the file where you can still read it.
envctl --dry-run set .env API_TOKEN "$new" # confirm the target
envctl set .env API_TOKEN "$new"
envctl --redact get .env API_TOKEN # confirm without printing itThe value is literal, so no quoting rules inside it can bite you.
npm run build 2>&1 | envctl redact
terraform apply 2>&1 | envctl redact prod.env
kubectl describe pod api 2>&1 | envctl redact --envThe env file supplies literal values to match, on top of the shape heuristics.
--env uses the process environment instead, which is what you want when the
secrets came from the environment rather than a file.
envctl env # instead of env
envctl env --sort # alphabeticalAlways redacted, one entry per line, control bytes escaped. A LESS_TERMCAP_*
value cannot restyle the terminal and a value containing a newline cannot forge
extra entries.
envctl redact <(sops -d secrets.env)
envctl get <(sops -d secrets.env) DATABASE_URLRead commands accept any openable path, so process substitution works.
envctl --redact list .env --valuesAnything printed as <redacted> matched a rule. Anything printed in full did
not, which is the useful direction to read it in when you are checking coverage
before sharing a file.
envctl --paranoid list .env --values--paranoid applies the entropy bar regardless of key name, so
RANDOM_THING=<44 random chars> gets masked too. Trivial values, plain paths,
and digest-like names stay visible.
diff <(envctl --redact list a.env --values --sort) \
<(envctl --redact list b.env --values --sort)--sort puts both sides in key order, and --redact keeps the secrets out of
the diff while still showing which keys differ.
envctl list .env --all | grep '(disabled)'Get-EnvctlKey -File .env | Where-Object Disabled
Get-EnvctlEnvironment | Where-Object Redacted | Select-Object KeySee shells.md for loading the module.
Agents that inherit a TTY get redaction automatically, and there is nothing to configure. To make it explicit in a prompt or a tool definition:
envctl --redact list .env --values # never prints a real secret
envctl redact < .env # same, for the whole fileBoth are safe to put in front of a model. --raw is the escape hatch when a
human genuinely needs the value.