envden v0.1.0 is in alpha
Skip to Content
.envden

Push, pull and resolve conflicts

Sync a repo, inspect changes and resolve a file that changed on two devices.

Sync your current repo

Inside a tracked checkout, run:

envden pull
# edit your env files
envden diff
envden push

diff reports key names and change markers without values. push and pull print JSON results. For example, a push that uploads one file without local reconciliation changes prints:

{ "kind": "pushed", "changed": 1, "conflicts": 0 }

Add --all to sync every tracked repo. A push commits its changes in one manifest swap. If another device pushes first, envden retries against the new state. If the head keeps moving, it asks you to retry.

envden pull --all
envden push --all

Pull merges unpushed edits rather than replacing them. Before overwriting a file, envden saves a backup under ~/.envden/conflicts/. Backups expire after 30 days.

Choose which files to sync

By default, envden discovers .env and .env.<name>, excluding .example, .sample, .template and .defaults templates. It never syncs .envrc or git-tracked files. Discovery selects gitignored files and skips build folders such as node_modules, .next, dist and build. The maximum file size is 1 MiB.

To change discovery rules:

envden config env-files '{"include":[".env",".env.*"],"exclude":["*.example","*.sample","*.template","*.defaults"],"extraSkipped":["generated"]}'

This replaces the include and exclude patterns and adds skipped directory names. Patterns without / match basenames; patterns with / match paths relative to the checkout. Tracked files and .envrc remain excluded.

Review a merge

A merge compares the raw bytes of each key's assignment, including its comments. Your local file supplies the layout. New remote keys go at the end in remote order.

Changes to different keys can merge cleanly. envden shows key names and asks you to confirm. --yes accepts clean changes and is required for a push without a terminal. It doesn't resolve conflicts.

A file becomes a conflict when both sides change the same key, or one deletes a key the other edits. Duplicate keys, unterminated quotes, multiline values, changes to export or quoting, and a comment toggle against an edit also need manual resolution.

Resolve a conflict

A push or pull with unresolved conflicts exits with code 3. List them first:

envden resolve --list

The JSON array includes each conflict's checkout root, relative path, editable file, and saved mine and server paths. With no conflicts, it prints [].

Choose a version for one file:

envden resolve .env --repo /path/to/checkout --keep-mine
envden resolve .env --repo /path/to/checkout --take-server

To combine the versions yourself, edit the file path from --list, then run:

envden resolve .env --repo /path/to/checkout

A successful resolution prints:

{ "kind": "resolved", "path": ".env" }

The command must select exactly one conflict. Resolution updates the local file; run envden push to publish it.

Check status and install the shell notice

envden status
envden status --json
envden shell install zsh

The shell notice supports zsh, bash, fish and powershell. It checks a cache on shell start and cd, then prints a line when the checkout is out of sync. A stale cache triggers a background refresh after 60 seconds. The hook doesn't run git or write checkout files, and it doesn't push or pull.

To remove it:

envden shell uninstall zsh

History and deletes

The server retains every version for 90 days and at least the last 20 versions of each file. Deletion records survive history pruning so a device returning from offline can't silently resurrect a deleted file.

On this page