Skip to main content

🐸 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 .env as a named environment

    • --from-current - Use your current .env file
    • --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 .env file

  • 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 .env before 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leapfrog_env-1.0.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

leapfrog_env-1.0.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file leapfrog_env-1.0.0.tar.gz.

File metadata

  • Download URL: leapfrog_env-1.0.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for leapfrog_env-1.0.0.tar.gz
Algorithm Hash digest
SHA256 26ec5852aead728ad032088ce7c440cf615493783a84b400167728b3fa47da58
MD5 aac509dbfb24695d1236e779f070f24d
BLAKE2b-256 fd41fcdb5ed98ee93577d211ee5fd35c5137f50cb0417ba3658605767eb99dce

See more details on using hashes here.

File details

Details for the file leapfrog_env-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: leapfrog_env-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for leapfrog_env-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca4275bde18dead418b092e60dd198beaa1c982533f83435c15ebde210cfe319
MD5 2fcdd5e75e1f93c4f406a911cd454c60
BLAKE2b-256 974444dc3ad2adab76232f8892bc12a6149a2b5ffc017580ab5178d3ae0f2e11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page