env-sync

Crates.ioenv-sync
lib.rsenv-sync
version0.1.0
created_at2025-09-20 19:02:16.72927+00
updated_at2025-09-20 19:02:16.72927+00
descriptionEasily update your local env file with a git-trackable file
homepage
repositoryhttps://github.com/anotherempty/env-sync
max_upload_size
id1848125
size70,579
(anotherempty)

documentation

https://docs.rs/env-sync

README

env-sync

A Rust CLI tool and library for synchronizing an environment file with a template file while preserving local customizations and comments.

Purpose

Keep your .env files in sync with a git-trackable .env.template file. The tool preserves your local values, comments, and customizations while adopting the structure from the template.

Usage

# Sync .env with .env.template (default)
env-sync

# Specify custom files
env-sync -l .env.local -t .env.example

# Enable verbose logging
env-sync -v    # debug level
env-sync -vv   # trace level

How it works

  1. Uses the template file as the base structure
  2. For each variable in the template:
    • If template value is empty but local has a value, keeps the local value
    • If template has no comments but local does, preserves local comments
  3. Writes the result back to the local file

Installation

# Using cargo
cargo install env-sync

# Using cargo-binstall
cargo binstall env-sync

License

MIT OR Apache-2.0

Commit count: 6

cargo fmt