🐸 Leap between development environments with ease
Project description
Leapfrog
A CLI tool for switching between environment configurations. Stop manually editing .env files.
The Problem
You know the drill: you're switching between dev, staging, and production. Every time you need to manually update your .env file with different database URLs, API keys, and port numbers. You forget to change one value and waste 20 minutes debugging why your local app is hitting the production database.
I got tired of this, so I built Leapfrog.
Installation
pip install leapfrog-env
Requires Python 3.7+. Works on Mac, Linux, and Windows.
Usage
Save your current .env as an environment:
leapfrog hatch production --from-current
Create a few more:
leapfrog hatch staging --from-current
leapfrog hatch development --from-current
Switch between them:
leapfrog leap development
leapfrog leap production
See what you have:
leapfrog pond
That's it. Your .env file gets updated, and Leapfrog keeps a backup of what was there before.
Commands
-
hatch <name>- Save current.envas a named environment--from-current- Use your current.envfile--force- Overwrite if it already exists--description "..."- Add a description
-
leap <name>- Switch to a saved environment -
pond- List all your saved environments -
croak- Validate your current.envfile -
prune <name>- Delete an environment you don't need anymore
How it works
Leapfrog stores your environment configurations locally (in ~/Library/Application Support/leapfrog/ on Mac, similar locations on other platforms). When you switch environments, it backs up your current .env and writes the new one.
Everything stays on your machine. No cloud sync, no accounts, no tracking.
Why I built this
At my company we have like 8 different environments: dev, dev1, dev2, dev3, qa, qa1, qa2, staging. Each one has different database credentials, different MongoDB connection strings, different API endpoints. New developers would constantly forget to update everything and spend hours debugging.
I got tired of seeing the same mistakes over and over, so I built this. Now it takes one command to switch between any environment.
Tech stack compatibility
Works with anything that uses .env files:
- Node.js / Express / Next.js / React
- Python / Django / Flask
- Ruby / Rails
- Go
- PHP / Laravel
- Java / Spring Boot
- Whatever else you're using
A few nice things
- Automatically backs up your current
.envbefore switching - Validates environment files and tells you if something's wrong
- Groups variables by type (database, API, security, etc.) for readability
- Hides sensitive values in output
- Suggests similar names if you typo an environment name
- Shows you which environments you've used recently
Contributing
Found a bug? Have a feature idea? Open an issue or PR. I'm pretty responsive.
License
MIT - do whatever you want with it.
Built by someone who got tired of manually editing environment files.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leapfrog_env-1.1.0.tar.gz.
File metadata
- Download URL: leapfrog_env-1.1.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66c9e5316d6ccd3e92f75df4520a0c12d8b25bb047b1781962efeee95a1f79b1
|
|
| MD5 |
4badfda6b17833592c16b4dd55c3e5bb
|
|
| BLAKE2b-256 |
83be9a91a1d6afe9b01217f8736ddba357ba6ebb3ca28df9e7b9d64bef2f9498
|
File details
Details for the file leapfrog_env-1.1.0-py3-none-any.whl.
File metadata
- Download URL: leapfrog_env-1.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf7e09014ead567df28d3cd673da9edecff8167bd4824e25b071a1b6fc27f3d6
|
|
| MD5 |
d25ee7f2e39d8371761a7d955d5312a5
|
|
| BLAKE2b-256 |
1f491b27d2e556907166b2548b9156e388f648a0fbfa08404b02b648afe6e7bd
|