PHPackages                             softbricks/php-set-env - 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. softbricks/php-set-env

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

softbricks/php-set-env
======================

Tool for setting options in .ENV files over the CLI

v1.0.1(8y ago)03.4kPHP

Since Oct 17Pushed 8y ago4 watchersCompare

[ Source](https://github.com/SoftBricks/php-set-env)[ Packagist](https://packagist.org/packages/softbricks/php-set-env)[ RSS](/packages/softbricks-php-set-env/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

php-set-env
===========

[](#php-set-env)

This tool helps setting `.env` file configs via the command line.

Install
-------

[](#install)

We recommend installing the package via composer.

```
composer require softbricks/php-set-env

```

After that, it is most practical to create a composer script (within `composer.json`) for easier usage:

```
{
    "scripts": {
        "set-env": [
            "SoftBricks\\CLI\\SetEnv::execute"
        ]
    }
}
```

Usage
-----

[](#usage)

Let's say we have a `.env` file that looks like this ...

```
FOO=BAR

[CATEGORY1]
NESTED_PARAM=Hi, I am nested

```

... and we want reset the value of `FOO`. This can be done with:

```
composer set-env -- --key=FOO --value="not bar anymore"

```

This call results in the following `.env` file:

```
FOO=not bar anymore

[CATEGORY1]
NESTED_PARAM=Hi, I am nested

```

It is also possible to add new key / value pairs, with the same call structure. For example:

```
composer set-env -- --key=NEW --value="wow I'm so new"

```

To set the `NESTED_PARAM` within `CATEGORY1` we have to structure our call like this:

```
composer set-env -- --category=CATEGORY1 --key=NESTED_PARAM --value="Changed nested param"

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

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 ~0 days

Total

2

Last Release

3133d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aa0568219fed7cfc11ffb890699311f5d35f1a42ee405cc7636af575375eb599?d=identicon)[SMenigat](/maintainers/SMenigat)

---

Top Contributors

[![SMenigat](https://avatars.githubusercontent.com/u/7868768?v=4)](https://github.com/SMenigat "SMenigat (5 commits)")

### Embed Badge

![Health badge](/badges/softbricks-php-set-env/health.svg)

```
[![Health](https://phpackages.com/badges/softbricks-php-set-env/health.svg)](https://phpackages.com/packages/softbricks-php-set-env)
```

###  Alternatives

[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M63](/packages/react-react)[jorenvanhocht/laravel-share

Optional package for Laravel to generate social share links.

5341.1M5](/packages/jorenvanhocht-laravel-share)[level-2/dice

A minimalist Dependency injection container (DIC) for PHP. Please note: 3.0+ is only compatible with PHP 7.0. The 2.0 branch is compatbile with PHP 5.6.

437730.3k17](/packages/level-2-dice)[fp4php/functional

PHP Functional Programming library

201284.8k10](/packages/fp4php-functional)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

44763.4k2](/packages/pimcore-data-importer)[symfony-cmf/slugifier-api

Provides a basic slugifier interface to transform text into strings suitable for URLs

281.7M5](/packages/symfony-cmf-slugifier-api)

PHPackages © 2026

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