Download the PHP package devkit/env-profiles without Composer

On this page you can find all versions of the php package devkit/env-profiles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package env-profiles

devkit-env-profiles

Named .env profiles, safe switching with backups, and drift reports — all from one Composer binary.

[![PHP](https://img.shields.io/badge/PHP-8.3%2B-777BB4?logo=php&logoColor=white)](https://www.php.net/) [![Packagist](https://img.shields.io/packagist/v/devkit/env-profiles?label=packagist&color=f28d1a&logo=packagist&logoColor=white)](https://packagist.org/packages/devkit/env-profiles) [![License](https://img.shields.io/badge/license-MIT-22c55e)](LICENSE) [![Tests](https://github.com/stuarttodd-dev/devkit-env-profiles/actions/workflows/tests.yml/badge.svg)](https://github.com/stuarttodd-dev/devkit-env-profiles/actions)

Table of Contents


Why this exists

Managing several environments usually means several files: .env, .env.staging, secrets in CI, and the nagging question — "does production still match what we think?"

This tool gives you a small profile store under your repo, a predictable use workflow (with backups and optional post-switch hooks), and a diff command to compare any set of env files side by side or as JSON.


Use case — switching environments in seconds

Imagine a typical Laravel app: local dev uses SQLite and the local filesystem, staging uses MySQL and S3-compatible storage, production uses RDS Aurora, S3, and a Redis queue. Without a tool like this, switching means manually editing .env, hunting down the right values, and hoping you didn't leave APP_DEBUG=true pointing at production.

With devkit-env-profiles:

Then switching is a single command — with an automatic backup and optional post-switch hooks (cache clear, migrations, etc.) running for you:

And when something feels off, diff tells you exactly what diverged:

The profiles live outside version control (auto-added to .gitignore) so secrets never accidentally land in your repo.


Prerequisites

Requirement Version
PHP 8.3+
Composer any recent

Install

From a clone of this repo

Running the CLI

The CLI resolves paths and .devkit-env.json relative to the directory you run it from. Always run from your application root (where composer.json and usually .env live).

Windows: use vendor\bin\devkit-env.bat or php vendor\bin\devkit-env.


Commands at a glance

Command What it does
save Snapshot ./.env (or --from) into a named profile.
use Apply a saved profile to your working .env, with automatic backup.
list Print all saved profile names.
delete Remove a profile from the store (does not touch your live .env).
diff Compare profiles or files; shows missing keys, extra keys, and value drift.
merge Merge two env files or profiles; interactive or scriptable.

Configuration

Drop a .devkit-env.json in your project root to customise store paths and post-switch hooks.

Note: defaultEnv and targetEnv only affect use. When save runs without --from, it always reads ./.env — not these keys.

Key Role
storeDir Directory for saved profile files and registry.json.
backupDir Where use stores timestamped backups of the replaced file.
defaultEnv Path use writes a profile to (often .env). Relative unless absolute.
targetEnv Same as defaultEnv; if both are set, targetEnv wins.
afterSwitch Shell commands run after every successful use.
afterSwitchProfiles Extra commands for specific profile names (runs after afterSwitch).
Full hook example

Files and folders

On first save, use, list, or delete, the store and backups directories are automatically appended to .gitignore. You can safely commit .devkit-env.json (paths only) — keep secrets and env/ local.


Commands

save — snapshot a file into a named profile

Interactive (TTY): run save with no name to pick from a list or type a new one.


use — apply a profile to your working env file

Interactive (TTY): run use without a name to pick from a numbered list.


list — show saved profile names

Prints one name per line, or (no profiles saved yet) if the store is empty.


delete — remove a profile from the store

Interactive (TTY): run delete without a name to pick from a list.


diff — drift between env files

Compares a baseline against one or more targets: missing keys, extra keys, and mismatched values. Sensitive-looking values are masked by default.

Exit codes: 0 = no drift  ·  1 = drift found  ·  2 = error


merge — combine two .env files

--select keybindings | Key | Action | |---|---| | `1`–`N` | Toggle item | | `a` | Select all | | `n` | Select none | | `v` | Toggle value previews | | `d` | Done | | `q` | Cancel |

Library API

Most users only need the CLI. If you want to integrate programmatically:

Namespace Contents
Devkit\Env\Diff\ Parsing, comparison, masking, report formatters.
Devkit\Env\Store\ Config, profile save/apply/list/delete, registry, gitignore hooks, post-switch runner.

Development


Support

If this project saves you time, consider buying me a coffee:

Buy Me a Coffee


License

MIT


All versions of env-profiles with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
symfony/process Version ^7.0
vlucas/phpdotenv Version ^5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devkit/env-profiles contains the following files

Loading the files please wait ...