Skip to main content

Switch between envrc files

Project description

envrc-switcher

Switch between different .envrc files using an interactive menu.

How it works

Create a envrc file in your home directory for each configuration, named .envrc.<example>. Running envrc-switcher presents an arrow-key menu of available configs. Selecting one copies that file to ~/.envrc and runs direnv allow to activate it.

Installation

Install from PyPi:

pip install -U envrc-switcher

Alternatively you can run directly using uvx:

uvx envrc-switcher

Setup

Create envrc files in a directory, e.g. ~/:

# ~/.envrc.foo
export foobar=foo
export foo=foo

# ~/.envrc.bar
export foobar=bar
export bar=bar

Config names are derived from the file suffix, so .envrc.foo appears as foo in the menu.

Usage

envrc-switcher [directory]

The optional directory argument specifies where to look for .envrc.* files. Defaults to the current directory.

? Select config:
> foo
  bar

After selecting, .envrc in the target directory is updated and direnv allow is run. Open a new shell or run direnv reload if the environment does not update immediately.

Requirements

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

envrc_switcher-1.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

envrc_switcher-1.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file envrc_switcher-1.0.1.tar.gz.

File metadata

  • Download URL: envrc_switcher-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for envrc_switcher-1.0.1.tar.gz
Algorithm Hash digest
SHA256 981d5cfc47e461410a60b1e0807366175be9f3560cd242de54f8123799fd8648
MD5 e1cd5a41c2041adfef42676e8447cca0
BLAKE2b-256 37aa05482ad017ef27399bba97bb8892cd6f15ba8da5ed54a855679c2417e47d

See more details on using hashes here.

File details

Details for the file envrc_switcher-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: envrc_switcher-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for envrc_switcher-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee773650a4df67fdbbc9cb5702b4c0f2f55dc04c6f31bc0e0332c2773644e8c7
MD5 59348d5473c457ebd6d52b6921b84515
BLAKE2b-256 ab30c8f1d668ad58e0a839710bf53d3bb9d3d0a750c078f8098a4659663386d3

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