envops
A single-file CLI to inspect and manipulate .env files, designed to be safe by default: values that look like secrets are masked in all output unless you explicitly ask otherwise.
Built with Python stdlib only — a plain python3 (≥3.10) runs it.
Though it works as a regular CLI, envops is first and foremost a skill for AI agents: the bundled skill (skills/envops/SKILL.md) makes the agent route every .env operation through envops — never cat or read env files directly, prefer masked output, treat --unsafe as a last resort — so credentials never leak into the conversation, logs, or context.
Install
Install the skill into your agent (Claude Code, etc.) with skills:
npx skills add reorx/envops
Or with skm:
skm install https://github.com/reorx/envops
That's all — the skill carries the CLI's own install steps, so the agent sets up the envops command by itself the first time it needs it.
Usage
show — print key-value pairs (secrets masked)
envops show ./test.env
FOO=hello
API_SECRET=sk******ij
DATABASE_URL=po******pp
DEBUG=true
Show only certain keys; add --unsafe to expose masked values — use with caution and compromise in mind:
envops show ./test.env -k FOO BAR
envops show ./test.env -k API_SECRET --unsafe
list-keys — list keys only
envops list-keys ./test.env
copy — copy pairs from source to dest
Specify keys with -k, or --full to copy every pair. Changes made to the dest file are printed (masked):
envops copy ./test.env /path/to/dest.env -k FOO BAR
envops copy ./test.env /path/to/dest.env --full
+ BAR="quoted value"
~ FOO=hello (was old_foo)
updated /path/to/dest.env: 2 change(s)
+ means the key was added, ~ means its value was updated. Keys already equal in dest are left untouched. Unrelated lines, comments, and formatting in dest are preserved; the dest file is created if it doesn't exist.
set — set a key's value from stdin
echo value | envops set ./test.env -k FOO
pbpaste | envops set ./test.env -k API_SECRET
One trailing newline is stripped from stdin. Existing keys are updated in place; new keys are appended.
delete — remove key(s) from an env file
envops delete ./test.env -k FOO
envops delete ./test.env -k FOO BAR
- FOO=hello
deleted 1 key(s) from ./test.env
Deleted pairs are reported in the copy diff style with values masked, so you can confirm what went without exposing it. If any key is missing the command fails and the file is left completely untouched — no half-applied deletion. All occurrences of a duplicate key are removed, so an earlier value can't come back to life.
read-value — print a key's raw value
Only use this when the other commands cannot solve the problem, as it exposes the value. --unsafe is required; without it the command fails:
envops read-value ./test.env -K FOO --unsafe
Remote files over SSH
Any file argument may be an scp-style remote path ([user@]host:/path, a colon before the first slash marks it remote). Hosts, keys, and options come from your regular ssh config:
envops show foo@bar:/app/.env
envops copy /tmp/test.env foo@bar:/app/.env --full
envops copy foo@bar:/app/.env ./local.env -k DATABASE_URL
Remote handling keeps the tool's safety guarantees:
- remote content is only ever held in memory — no plaintext temp file lands on the local disk
- writes are atomic: content goes to a
mktempfile next to the target, thenmvreplaces it, so a dropped connection can't leave a half-written.env - the target's permissions are preserved (
stat -con Linux,stat -fon macOS/BSD remotes;600for newly created files) - output masking works exactly as for local files
Secret detection
A value is masked when any of these match — except pure-numeric values (timeouts, sizes, retry counts like AUTH_TOKEN_EXPIRE=604800), which are never treated as secrets:
- Key name contains
SECRET,TOKEN,PASSWORD,API_KEY,ACCESS_KEY,PRIVATE,CREDENTIAL,AUTH,SALT,SIGNING,DSN, ... (case-insensitive) — unless the key's last word marks plain config (URL,URI,ENDPOINT,HOST,PORT,DOMAIN,PATH,NAME,TELEMETRY, ...), soBETTER_AUTH_URLis not treated as a secret by its name alone - Value prefix matches known credential formats:
sk-,ghp_,glpat-,xoxb-,AKIA..., JWT (eyJ...), etc. - Random-looking token run: the value contains an unbroken alphanumeric run of ≥20 chars that mixes letters and digits with Shannon entropy ≥3.5
The entropy check works on alphanumeric runs, so structured values — hostnames (oss-cn-beijing.aliyuncs.com), bucket names (myapp-demo-snapshot), db names — are cut into short segments by - . _ / and pass in the clear.
URL-shaped values (<scheme>://..., any scheme word) are masked per segment instead of as a whole, so the recognizable parts stay readable:
- the userinfo password is always masked — weak passwords are still passwords
- random-looking runs in the path/query are masked (webhook tokens, etc.)
- scheme, username, host, and port stay in the clear
NEO4J_URL=neo4j://neo4j:12******cc@102.10.101.125:7687
SLACK_WEBHOOK=https://hooks.slack.com/services/T01ABCDEFGH/B02JKLMNOPQ/x9******ty
Masked form keeps the first and last 2 characters (sk******ij) so you can tell credentials apart without leaking them.
Env file handling
- Supports
export KEY=value, single/double quotes, inline#comments on unquoted values - Duplicate keys: last occurrence wins (dotenv semantics)
- On write, values containing spaces or special characters are double-quoted with escaping
- Writes preserve comments, blank lines, and unrelated lines byte-for-byte
Development
uv run pytest
Tests invoke the CLI as a subprocess and assert on real command behavior.
Metadata
Release files for envops 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| envops-0.2.0.tar.gz | 22.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envops-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.5 kB
Release files / envops-0.2.0.tar.gz
| Download URL | envops-0.2.0.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9088c88f5612e90f6cd3e8c064b0698e37e0e38da546e1a1395578a8ca432d42
|
|
BLAKE2b-256 checksum How to use checksums |
548668a0943932966d13530dc43b9c06563c8fd6d84b8d746e209d3bf1902c8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / envops-0.2.0-py3-none-any.whl
| Download URL | envops-0.2.0-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e38982a83dadd81a09cfa5f98a4dcf47db2de956bf7ee609036f12a0974a321e
|
|
BLAKE2b-256 checksum How to use checksums |
0f807dd0e50385b264432c5d504e9fc4e35116d1be26570282425058165a57e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for envops 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.