PHPackages                             curology/envloader - 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. curology/envloader

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

curology/envloader
==================

Loads values from AWS Parameter store and uses them to generate a .env file

v0.2.1(4y ago)454MITPHPPHP ^8.0

Since Feb 8Pushed 4y ago2 watchersCompare

[ Source](https://github.com/curology/envloader)[ Packagist](https://packagist.org/packages/curology/envloader)[ RSS](/packages/curology-envloader/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

envloader
=========

[](#envloader)

[![CircleCI Status](https://camo.githubusercontent.com/c3ffd3a93b2dece513750fec0ccebc5fe31bb2bd74e673d3879e6fd08c00506c/68747470733a2f2f636972636c6563692e636f6d2f67682f6375726f6c6f67792f656e766c6f616465722e7376673f7374796c653d736869656c64)](https://circleci.com/gh/curology/envloader)[![GitHub License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE)

Loads parameters from AWS SSM Parameter Store and uses them to generate a dotenv file.

Installation
------------

[](#installation)

You can install envloader via composer:

```
composer require curology/envloader

```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

Before you can use the envloader, you must create a json config file. By default, envloader will look for a file named `envloader.json`.

```
touch envloader.json

```

Example `envloader.json`:

```
{
    "awsProfile": "development",
    "awsRegion": "us-east-1",
    "environment": "development",
    "envPath": ".env.development",
    "envOverridePath": ".env.development.override",
    "workingDir": "/Users/curology/envloader",
    "parameterPrefix": "/envloader/development/",
    "parameterList": [
        "param1:1",
        "param2:5",
        "param3:2"
    ]
}
```

The config file should contain the following entries:

NameTypeRequiredDefaultDescriptionawsProfileStringNodefaultThe AWS profile from your `~/.aws/config` file that you wish to use. Alternatively, you can set the envloader-specific AWS environment variables `AWS_SSM_ACCESS_KEY_ID` and `AWS_SSM_SECRET_ACCESS_KEY`. If both the `awsProfile` and environment variables are unspecified, envloader will fall back to AWS's environment variables or default profile. The order of precedence is: 1. `AWS_SSM_ACCESS_KEY_ID` and `AWS_SSM_SECRET_ACCESS_KEY`
2. `awsProfile`, if specified and not set to the default profile
3. The AWS environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
4. The `default` AWS profile from your `~/.aws/config`

awsRegionStringYes-The AWS region that you would like fetch parameters from.environmentStringNodefaultThe name of the environment that the generated dotenv file will be associated with.envPathStringNo.envThe relative path to the file where the generated dotenv file will be written.envOverridePathStringNo-The relative path to the file containing the override values. Overrides will take precedence over parameters with the same name in AWS. You can also add values to the override file that do not appear in AWS and they will be added to the generated dotenv file.workingDirStringNo`getcwd()`The working directory. `envPath` and `envOverridePath` are relative paths from the working directory.parameterPrefixStringNo-The prefix to the names of your parameters in AWS.parameterListArrayYes-The list of parameter names you would like to fetch from AWS. The parameter names should be in the form `NAME:VERSION`. If you provided a `parameterPrefix`, it should be removed form the beginning of the names in the `parameterList`.### Run

[](#run)

To list the commands available:

```
vendor/bin/envloader list

```

If you do not specify a path to your config file in the commands below, envloader will use `envloader.json`.

To generate your dotenv file:

```
vendor/bin/envloader generate PATH/TO/YOUR/CONFIG/FILE

```

To print the key, value pairs in your dotenv file in a formatted table:

```
vendor/bin/envloader show PATH/TO/YOUR/CONFIG/FILE --with-values

```

Remove the `--with-values` option to hide the parameter values.

Testing
-------

[](#testing)

### Setup

[](#setup)

#### Install Composer Dependencies

[](#install-composer-dependencies)

```
composer install

```

#### Create AWS Resources

[](#create-aws-resources)

To enable tests that require real data, set the `ENVLOADER_TEST_ENABLE_AWS` environment variable to `true`:

```
export ENVLOADER_TEST_ENABLE_AWS=true

```

If this variable is not set, the data-dependent tests will be skipped and you will not have to create any AWS resources.

To run all the tests, you will need real data in AWS SSM Parameter Store, and the required permissions to create the data. The following instructions use the AWS CLI (`version 2.0.46` and above) - you can install it [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). You can alternatively create the parameters via the AWS console UI.

1. Create a user that will have permissions to edit and view the parameters

```
aws iam create-user --user-name envloader-test --no-cli-pager

```

2. Create an access key for the user. Keep track of the `AccessKeyId` and `SecretAccessKey` in the response.

```
aws iam create-access-key --user-name envloader-test

```

3. Add the `AccessKeyId` and `SecretAccessKey` from the response to your `~/.aws/credentials` file, along with your aws region:

```
[envloader-test]
region = `REGION`
aws_access_key_id = `AccessKeyId`
aws_secret_access_key = `SecretAccessKey`

```

4. Grant the user permissions to the SSM Parameters you will create.
    Open `tests/command/setup/iam_policy.json` and replace `REGION` and `ACCOUNT_ID` with the aws region and account ID where you will be creating the parameters.

```
aws iam put-user-policy \
    --user-name envloader-test \
    --policy-document file://tests/command/setup/iam_policy.json \
    --policy-name EnvLoaderTest \
    --no-cli-pager

```

5. Create the SSM Parameters.

```
./tests/Command/setup/create_parameters.sh

```

6. The command tests use `us-east-1` as the AWS region. You will have to change `tests/fixtures/config/test_envloader_config.json` to include the correct AWS region should you decide to use a different region.

### Run

[](#run-1)

Unit Tests

```
composer test-unit

```

Command Tests

```
composer test-command

```

All Tests

```
composer test

```

### Cleanup

[](#cleanup)

If you want to destroy the AWS resources created for testing, run the following commands:

1. Delete the parameters.

```
./tests/Command/setup/delete_parameters.sh

```

2. Delete the user policy

```
aws iam delete-user-policy --user-name envloader-test --policy-name EnvLoaderTest --no-cli-pager

```

3. Delete the access key. Replace `AccessKeyId` with the value from your `~/.aws/config`

```
aws iam delete-access-key --user-name envloader-test --no-cli-pager --access-key-id `AccessKeyId`

```

3. Delete the user

```
aws iam delete-user --user-name envloader-test --no-cli-pager

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

1698d ago

PHP version history (2 changes)v0.1.0PHP ^7.4

v0.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/89ef7e80762e7d3562d1d447bea64636475a616bb9e31da80e8828d26d19216c?d=identicon)[oliviakim321](/maintainers/oliviakim321)

---

Top Contributors

[![oliviakim321](https://avatars.githubusercontent.com/u/7674322?v=4)](https://github.com/oliviakim321 "oliviakim321 (9 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/curology-envloader/health.svg)

```
[![Health](https://phpackages.com/badges/curology-envloader/health.svg)](https://phpackages.com/packages/curology-envloader)
```

###  Alternatives

[cognesy/instructor-php

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

310107.9k1](/packages/cognesy-instructor-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)

PHPackages © 2026

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