Repository navigation
v0.10.12
evnx v0.10.12
The patch for evnx sync (package R-sync). --check gives one verdict whatever
the output format, looks both ways for a developer and one way for CI and the
pre-commit hook, and every run without a terminal finishes instead of failing on
a prompt.
evnx sync:
sync --checkwithout--directionis two-way (DEC-S3, DEC-S17): a name
only.env.examplehas — a stale entry, or a.envthat has not caught up —
is drift, exit 1. Naming a direction keeps the old one-way check, and that is
the form for CI and hooks:evnx sync --check --direction forward. The
shippedevnx-syncpre-commit hook now runs exactly that, so a teammate whose
.envlacks a template name can still commit.--format jsonadds
template_onlyandsummary.template_onlyto two-way reports (I-119).--check --format jsonis the same verdict as the pretty output (I-117).
It now includes the names[vars]requires in reverse, refuses a credential
inallow_actualand a name--naming-policy errorrefuses (both exit 2, was
1), and reports a missing.envin reverse as drift, exit 1 (was 2), listing
every name.--checkwith an empty.envbeside a populated template is exit 2, no
verdict (I-127, DEC-S14); it passed with a warning. Plainsyncstill warns.- No terminal, or
CIset (to anything but empty,0orfalse): sync uses
placeholder values on an existing template and in reverse too, and says so,
instead of failing with "IO error: not a terminal" (I-124, DEC-S9, DEC-S18).
OnlysyncreadsCI.--placeholderis deprecated and does what--force
does, with a notice. - A misspelt key in a
--template-configfile (allow_actaul) and an invalid
[sync] naming_policyin.evnx.tomlare exit 2, naming the accepted
values; both were ignored without a word (I-121, DEC-S11). The file's value is
checked even when--naming-policyoverrides it, as[validate] fail_onis. --directionhas no default in the parser any more (it is still forward):
evnx::commands::sync::runtakesOption<SyncDirection>.
sync
- Placeholders are chosen by whole words of the name (I-120, DEC-S10):
SUPPORT_EMAILgot8000,MONKEY_COUNTYOUR_KEY_HERE,BYPASS_CACHEa
password placeholder andGHOST_MODElocalhost; nowYOUR_VALUE_HERE.
DEBUG=falsestaysfalse(it becametrue). A URL placeholder follows the
value's scheme —postgres,postgresql,mysql,mongodb(+srv),amqp(s),
redis,rediss,http(s)— where onlypostgresql://,redis://and
http(s)://were recognised;URIandDSNnames count as URLs.add custom
writes the same placeholders. - Reverse with no
.env: the template's own "# Generated from .env" header is
not copied into the new.env(I-129), and names the spec requires are added
under "# Added by evnx sync" (I-275, DEC-S20) — they were left out, so the new
file failedvalidate. - Reverse lists a name that only
[vars]requires as such, not as "in
.env.example" (I-255). - The naming policy also covers the names sync writes into a new
.env.example; it skipped them, so--naming-policy errorlet a template
with a lowercase name through on its first run. - ⛔ Creating
.env.examplewith actual values no longer copies a refused
credential (I-277). The template was.env's text rewritten line by line,
so a multi-line value's continuation lines (a PEM private key's body) and a
line writtenexport<TAB>KEY=…were copied as they were — while the run
said those keys were "kept out" and written as placeholders. The file is now
built from the parsed values, as every other write to the template is; it no
longer carries.env's comments. Its advice to "re-create it withevnx sync --force" did nothing on the existing file; it now says to delete it first
(I-278). - With no
.env,--checkand--skip-without-envload--template-config
too: a misspelt key or a missing file is exit 2 in CI as it is locally
(I-279). - A prompt needs stderr to be a terminal as well as stdin:
evnx sync 2>log
failed "IO error: not a terminal" (I-280). It uses placeholders and says so. --checkand--dry-runsay a missing file "would" be created rather than
"creating" it (I-281). The empty-.envwarning and the no-.envcheck name
the files in the command they suggest (I-282). A new.envkeeps a first
line of the template's own that starts "# Generated from"; only the two
lines sync writes are replaced; and choosing no names in reverse writes
nothing (I-283).- The
--checkverdict names the command that fixes each side, with
--env/--examplewhen they are not the defaults; reverse no longer says
"commit the result" of writing a git-ignored.env(I-118). - Messages name the files in play:
--env nope.envsaid "File not found: .env",
and "Created", "Updated", "Failed to parse" named.env/.env.example
whatever was passed (I-125). - "Added 1 variable", not "1 variables"; one warning for a readable
.env,
worded as everywhere else ("readable by other users (mode 644)" and the
chmod), where reverse printed two, one in0o644form (I-126, I-276). - An interactive comment is written above the variables it describes, in the
same write; it was appended after them (I-126). - The
--dry-runpreview names a symlinked file's target, as the write does. - The "replace placeholders" reminder appears only when something added is one.
Docs
- README: the sync section lists every flag, the two
--checkforms and what
each is for (D-66, D-67); the[sync]config line says a bad value is an
error and where placeholder rules go (D-71). Getting Started step 8 shows the
template sync really writes (D-64).--helpreworded for--direction,
--check,--force,--template-configand--naming-policy(D-69).
Shared code
core::placeholder: the placeholder generator andPlaceholderConfig, moved
fromcommands::syncsoaddno longer imports from another command
(DEC-S19).commands::sync::PlaceholderConfigis re-exported.initand
validate --fixkeep their own placeholder shapes.utils::term::can_prompt: stdin and stderr are both terminals (I-280);
syncuses it, the other prompts still check stdin only.core::classify::has_word,core::envfile::only_in(now also behind
diff's missing/extra lists, output unchanged),utils::term::ci,
utils::string::count(moved fromadd),core::permissions::warn_if_readable
andreadable_warning(safe_write::reportprints through it, unchanged;
report_linkis its symlink half),NamingPolicy::from_configon
core::args::one_of.
Installation
Linux / macOS (shell script)
curl -sSL https://raw.githubusercontent.com/urwithajit9/evnx/main/scripts/install.sh | bashHomebrew (macOS and Linux)
brew install urwithajit9/evnx/evnxScoop (Windows, user-local)
scoop bucket add evnx https://github.com/urwithajit9/scoop-evnx
scoop install evnxWinget (Windows, system-wide)
winget install urwithajit9.evnxnpm / Node.js
npm install -g @evnx/cliPython (pipx)
pipx install evnxCargo
cargo install evnx --all-features
cargo installcompiles from source withdefault = [], so plain
cargo install evnxgives you a binary without theauth,
vaultandcloudcommands. Every other channel above ships them
already — the binaries are built with--all-features.
Checksums
SHA256 checksums are provided for each binary. Verify after download:
sha256sum -c evnx-*.tar.gz.sha256What's Changed
- sync 0.10.12 (R-sync): one verdict for pretty and JSON, two-way --check locally and one-way for CI, no prompt without a terminal by @urwithajit9 in #206
- sync 0.10.12 review fixes: actual-values template never copies a refused credential, config checked without .env, prompts need stderr by @urwithajit9 in #207
- chore(release): 0.10.12 by @urwithajit9 in #208
Full Changelog: v0.10.11...v0.10.12
npm / Node.js
npm install -g @evnx/cli # global install
npx @evnx/cli --version # zero-install usage
npm install --save-dev @evnx/cli # project dev dependency