PHPackages                             metacomet-technologies/env-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. metacomet-technologies/env-sync

ActiveLibrary

metacomet-technologies/env-sync
===============================

This package provides Artisan commands for syncing your .env files to your preferred secrets manager for ease of storage and use.

v0.0.7(1mo ago)1591[1 issues](https://github.com/Metacomet-Technologies/env-sync/issues)MITPHPPHP ^8.2CI passing

Since Aug 12Pushed 1mo agoCompare

[ Source](https://github.com/Metacomet-Technologies/env-sync)[ Packagist](https://packagist.org/packages/metacomet-technologies/env-sync)[ Docs](https://github.com/metacomet-technologies/env-sync)[ RSS](/packages/metacomet-technologies-env-sync/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (28)Versions (9)Used By (0)

Laravel Environment Sync
========================

[](#laravel-environment-sync)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8aab86b44d064a61e5839313406d9c4551da63f15282a8777e7fc7d7c3374b8a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d657461636f6d65742d746563686e6f6c6f676965732f656e762d73796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/metacomet-technologies/env-sync)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a82f8ae28d01277fa5dab38dbe89408c061cb51fc7d7a6d6e0fc9a0a53d7170e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d657461636f6d65742d746563686e6f6c6f676965732f656e762d73796e632f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/metacomet-technologies/env-sync/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d20e9ce461197ed9aa7b4756d5ad53d38f6e115ef84cb7679fa889d71bb9c379/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d657461636f6d65742d746563686e6f6c6f676965732f656e762d73796e632f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/metacomet-technologies/env-sync/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/cbca0d53f47ad6bedd413e47bb053c73e0f0a744bebf9d69f24d9cf28e209142/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d657461636f6d65742d746563686e6f6c6f676965732f656e762d73796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/metacomet-technologies/env-sync)

A Laravel package for secure synchronization of environment variables across development machines using 1Password and AWS Secrets Manager, with support for additional secret managers on the roadmap.

Features
--------

[](#features)

- 🔐 **1Password Integration**: Full support for secure environment synchronization
- ☁️ **AWS Secrets Manager**: Store and retrieve environment files from AWS
- 🔄 **Bidirectional Sync**: Push to and pull from your secret manager
- 📁 **Multi-Environment**: Support for local, staging, production, etc.
- 🎯 **Smart Detection**: Auto-detects repository and environment names
- 💾 **Automatic Backups**: Creates backups before overwriting files
- 🏷️ **Consistent Naming**: Uses Git repository info for consistent naming
- ♻️ **Laravel Integration**: Seamless integration with Laravel projects
- 🚀 **Extensible**: Architecture ready for additional providers

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

[](#installation)

You can install the package via composer:

```
composer require metacomet-technologies/env-sync
```

You can publish the config file with:

```
php artisan vendor:publish --tag="env-sync-config"
```

Supported Providers
-------------------

[](#supported-providers)

### ✅ 1Password (Available)

[](#-1password-available)

Full integration with complete support for vaults, automatic title generation, and base64 encoding.

**Prerequisites:**

```
# macOS
brew install --cask 1password-cli

# Windows and Linux
# https://developer.1password.com/docs/cli/get-started/

# Sign in
eval $(op signin)
```

### ✅ AWS Secrets Manager (Available)

[](#-aws-secrets-manager-available)

Store and retrieve environment files securely in AWS Secrets Manager with full support for regions, profiles, and IAM roles.

**Prerequisites:**

```
# Install AWS SDK for PHP
composer require aws/aws-sdk-php

# Configure AWS credentials (choose one):
# Option 1: AWS CLI
aws configure

# Option 2: Environment variables
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret

# Option 3: IAM Role (automatic on EC2/ECS/Lambda)
```

### 🚧 Roadmap

[](#-roadmap)

The following providers are planned for future releases:

#### Bitwarden (Coming Soon)

[](#bitwarden-coming-soon)

- Open-source password manager
- Self-hosted instance support
- Organization vault support

#### Other Planned Providers

[](#other-planned-providers)

- HashiCorp Vault
- Azure Key Vault
- Google Secret Manager

Usage
-----

[](#usage)

### Push Environment to Secret Manager

[](#push-environment-to-secret-manager)

```
# Push to default provider (1Password or AWS)
php artisan env:push

# Push specific environment
php artisan env:push staging
php artisan env:push production

# Force push even if identical
php artisan env:push --force

# 1Password specific:
php artisan env:push --vault="Company Vault"
php artisan env:push --title="my-custom-title"

# AWS Secrets Manager specific:
php artisan env:push --provider=aws
php artisan env:push --provider=aws --region=us-west-2
php artisan env:push --provider=aws --profile=production
```

### Pull Environment from Secret Manager

[](#pull-environment-from-secret-manager)

```
# Pull from default provider
php artisan env:pull

# Pull specific environment
php artisan env:pull staging
php artisan env:pull production

# Force pull even if identical
php artisan env:pull --force

# 1Password specific:
php artisan env:pull --vault="Company Vault"

# AWS Secrets Manager specific:
php artisan env:pull --provider=aws
php artisan env:pull --provider=aws --region=us-west-2
php artisan env:pull --provider=aws --profile=production
```

### Interactive Sync Mode

[](#interactive-sync-mode)

```
# Interactive mode with menu
php artisan env:sync

# For specific environment
php artisan env:sync production

# With custom vault
php artisan env:sync --vault="Company Vault"
```

Interactive mode provides:

- Status checking
- Push/Pull operations
- File comparison
- List all environments
- Visual diff display

Configuration
-------------

[](#configuration)

Edit `config/env-sync.php`:

```
return [
    'default' => env('ENV_SYNC_PROVIDER', '1password'),

    'providers' => [
        '1password' => [
            'vault' => env('ONEPASSWORD_VAULT', 'Private'),
        ],

        'aws' => [
            'region' => env('ENV_SYNC_AWS_REGION', 'us-east-1'),
            'profile' => env('AWS_PROFILE'),
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'prefix' => env('AWS_SECRET_PREFIX', ''),
        ],
    ],

    'required_variables' => [
        'APP_KEY',
        'DB_CONNECTION',
        // Add your critical variables
    ],
];
```

Environment File Mapping
------------------------

[](#environment-file-mapping)

EnvironmentFile Path`local``.env``staging``.env.staging``production``.env.production``testing``.env.testing`Naming Conventions
------------------

[](#naming-conventions)

Items are automatically named based on your Git repository:

- **Format**: `{organization}/{repository}/{environment}/.env`
- **Examples**:
    - `metacomet/my-app/local/.env`
    - `metacomet/my-app/production/.env`

Security
--------

[](#security)

- ✅ Files are encrypted at rest by each provider
- ✅ Base64 encoding prevents data corruption (1Password)
- ✅ Authentication required for all operations
- ✅ Automatic backups before overwriting
- ✅ No sensitive data in command history
- ✅ Provider-specific security features respected

Current Provider Features
-------------------------

[](#current-provider-features)

### 1Password

[](#1password)

- ✅ Full vault support
- ✅ Automatic title generation based on Git info
- ✅ Base64 encoding for data integrity
- ✅ Interactive sync mode
- ✅ Multi-environment support
- ✅ Automatic backups
- ✅ File comparison and diff display

### AWS Secrets Manager

[](#aws-secrets-manager)

- ✅ Multi-region support
- ✅ AWS profile and credential support
- ✅ IAM role integration
- ✅ Automatic secret naming based on Git info
- ✅ Base64 encoding for data integrity
- ✅ Secret tagging for organization
- ✅ Soft delete with recovery window
- ✅ Interactive sync mode
- ✅ Multi-environment support
- ✅ Automatic backups

Workflow Examples
-----------------

[](#workflow-examples)

### Initial Setup

[](#initial-setup)

```
# 1. Install the package
composer require metacomet-technologies/env-sync

# 2. Push your local .env to 1Password
php artisan env:push

# 3. Push other environments
php artisan env:push staging
php artisan env:push production
```

### Team Member Setup

[](#team-member-setup)

```
# 1. Clone repository
git clone git@github.com:your-org/your-app.git

# 2. Install dependencies
composer install

# 3. Pull environment file from 1Password
php artisan env:pull

# 4. Start developing!
```

### After Making Changes

[](#after-making-changes)

```
# 1. Check differences
php artisan env:sync
# Select option 3 (Compare)

# 2. Push changes
php artisan env:push

# 3. Team members pull updates
php artisan env:pull
```

Migrating from Previous Version
-------------------------------

[](#migrating-from-previous-version)

If you were using the Laravel-specific 1Password commands from a previous implementation, the commands remain the same:

Old CommandNew Command`php artisan env:push``php artisan env:push``php artisan env:pull``php artisan env:pull``php artisan env:sync``php artisan env:sync`The package defaults to 1Password, maintaining full backward compatibility. To use AWS Secrets Manager, set:

```
ENV_SYNC_PROVIDER=aws
```

Or specify in commands:

```
php artisan env:push --provider=aws
```

Troubleshooting
---------------

[](#troubleshooting)

### 1Password CLI Not Available

[](#1password-cli-not-available)

```
# The commands will show installation instructions:
php artisan env:sync

# macOS installation:
brew install --cask 1password-cli
```

### Authentication Issues

[](#authentication-issues)

```
# 1Password authentication
eval $(op signin)

# AWS authentication
aws configure
# or use environment variables:
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
```

### Files Are Identical

[](#files-are-identical)

Use `--force` flag to overwrite anyway:

```
php artisan env:push --force
php artisan env:pull --force
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance69

Regular maintenance activity

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% 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 ~37 days

Recently: every ~56 days

Total

7

Last Release

57d ago

PHP version history (2 changes)v0.0.1PHP ^8.1

v0.0.6PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/72bca4835ee6aab70db2e2dcd049e0c4f4795b6aa7a05890991c3034dd99c256?d=identicon)[DGarbs51](/maintainers/DGarbs51)

---

Top Contributors

[![DGarbs51](https://avatars.githubusercontent.com/u/58236685?v=4)](https://github.com/DGarbs51 "DGarbs51 (25 commits)")[![alexjustesen](https://avatars.githubusercontent.com/u/1144087?v=4)](https://github.com/alexjustesen "alexjustesen (1 commits)")

---

Tags

laravelMetacomet Technologiesenv-sync

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/metacomet-technologies-env-sync/health.svg)

```
[![Health](https://phpackages.com/badges/metacomet-technologies-env-sync/health.svg)](https://phpackages.com/packages/metacomet-technologies-env-sync)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[nativephp/mobile

NativePHP for Mobile

82724.0k43](/packages/nativephp-mobile)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

203330.1k2](/packages/wnx-laravel-backup-restore)[spatie/laravel-site-search

A site search engine

300129.1k](/packages/spatie-laravel-site-search)

PHPackages © 2026

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