PHPackages                             stefanocbt/phpdotenv-sync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stefanocbt/phpdotenv-sync

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stefanocbt/phpdotenv-sync
=========================

A package that makes sure that your .env file is in sync with your .env.example

1.3.0(2y ago)168.3k↓83.4%MITPHPPHP &gt;=7.4

Since Dec 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/StefanoCbt/phpdotenv-sync)[ Packagist](https://packagist.org/packages/stefanocbt/phpdotenv-sync)[ RSS](/packages/stefanocbt-phpdotenv-sync/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (7)Versions (14)Used By (0)

[![Tests Actions Status](https://github.com/StefanoCbt/phpdotenv-sync/workflows/Tests/badge.svg)](https://github.com/StefanoCbt/phpdotenv-sync/actions)[![Tests Actions Status](https://github.com/StefanoCbt/phpdotenv-sync/workflows/Codequality/badge.svg)](https://github.com/StefanoCbt/phpdotenv-sync/actions)

phpdotenv-sync
==============

[](#phpdotenv-sync)

A package that makes sure that your .env file is in sync with your .env.example

Usage
-----

[](#usage)

add the library to your project with composer:

```
composer require stefanocbt/phpdotenv-sync

```

using the library: phpdotenv-sync has the following operations:

- check: to check diffs between two dotenv files (Example: .env.example and .env)
- sync: to sync two dotenv files (add missing dotenv parameters to destination dotenv file)

#### Executing:

[](#executing)

```
./vendor/bin/phpdotenvsync [options]

Options:
    --opt[=OPT]               Specify the right operation (Required) ("check" or "sync")
    --src[=SOURCE]            Specify the source dotenv file (Optional) (default: current-folder-path/.env.example)
    --dest[=DESTINATION]      Specify the destination dotenv file (Optional) (default: current-folder-path/.env)
    --no-interaction          Avoid all kind of user interactions. Default action is to syncing by copying all parameters with their default values (Optional)

```

if you are in a standard environment and you have .env.example and .env inside the root project folder you can just execute the following command to sync .env.example and .env files:

```
./vendor/bin/phpdotenvsync --opt=sync

```

for --src and --dest options you can use absolute and/or relative paths. If, for example, you have the files inside the current pwd folder but dotenv files have different filenames you can launch phpdotenvsync this way:

```
./vendor/bin/phpdotenvsync --opt=sync --src=./[SRC_FILENAME] --dest=./[DEST_FILENAME]

```

or if you want to specify an absolute path:

```
./vendor/bin/phpdotenvsync --opt=sync --src=/absolute/path/to/[SRC_FILENAME] --dest=/absolute/path/to/[DEST_FILENAME]

```

Development
-----------

[](#development)

##### testing CHECK command into development environment (execute from project root dir):

[](#testing-check-command-into-development-environment-execute-from-project-root-dir)

```
php bin/phpdotenvsync --opt=check --src="./bin/dev_testing/.env.example" --dest="./bin/dev_testing/.env"

```

#### testing SYNC command into development environment (execute from project root dir):

[](#testing-sync-command-into-development-environment-execute-from-project-root-dir)

```
php bin/phpdotenvsync --opt=sync --src="./bin/dev_testing/.env.example" --dest="./bin/dev_testing/.env"

```

Codequality tests
-----------------

[](#codequality-tests)

##### phpcs

[](#phpcs)

```
automatic fix with phpcs:
php vendor/bin/phpcbf --standard=PSR12 -n -p src/

```

###  Health Score

33

—

LowBetter than 73% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~86 days

Recently: every ~251 days

Total

13

Last Release

969d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.3

1.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ad47ec2a4db62d3a6f2d797e0b17c608d5b88d864d16d066b1a78b183f0b16b?d=identicon)[StefanoCbt](/maintainers/StefanoCbt)

---

Top Contributors

[![StefanoCbt](https://avatars.githubusercontent.com/u/39333731?v=4)](https://github.com/StefanoCbt "StefanoCbt (23 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stefanocbt-phpdotenv-sync/health.svg)

```
[![Health](https://phpackages.com/badges/stefanocbt-phpdotenv-sync/health.svg)](https://phpackages.com/packages/stefanocbt-phpdotenv-sync)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k456.5k2](/packages/roots-bedrock)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[vinkla/wordplate

The WordPlate boilerplate

2.2k5.3k](/packages/vinkla-wordplate)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

317117.1k1](/packages/cognesy-instructor-php)[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41759.2k3](/packages/lullabot-drainpipe)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
