autoactivator

AutoActivator - Manage your Python Virtual Environments Effortlessly

Cover image representing AutoActivator, a tool for managing virtual environments

Workflow Supported Python version Code style pre-commit License: MIT

Autoactivator is a powerful tool designed to streamline your workflow when working with virtual environments. With Autoactivator, you can easily activate your virtual environments as soon as you enter a corresponding project directory, and stay activated for as long as you’re working in that directory. Once you’re done with the project and move out of the directory, Autoactivator automatically deactivates the virtual environment for you, ensuring that you don’t accidentally use the wrong environment in future projects. This feature makes it easier for developers and programmers to manage multiple virtual environments without having to manually activate or deactivate them every time they switch projects.

Dependencies

Before installing AutoActivator, please ensure that you have the following dependencies installed on your system:

These dependencies are essential for the proper installation and usage of AutoActivator. Please make sure they are installed before proceeding with the installation instructions mentioned below.

Installation

To install AutoActivator, you can use the following curl command for a quick setup:

curl -sSL https://aymenkrifa.github.io/autoactivator/setup.sh | bash -s <shell1> <shell2> ...

Replace shell1, shell2, and so on with the shells you want to install. You can specify either zsh, bash, or both, in any order.

Here are a few examples:

Toggle to show commands in case the above installation method didn't work. 1. Clone the repository ```bash git clone https://github.com/aymenkrifa/autoactivator.git ``` 2. Navigate into the cloned directory ```bash cd autoactivator ``` 3. Run the installation script ```bash sudo chmod +x ./setup.sh ./setup.sh ... ``` </details> \ To apply the changes, restart your terminal or source your shell configuration file: ```bash source ~/.bashrc # for Bash source ~/.zshrc # for Zsh ``` ## Updating AutoActivator To update AutoActivator to the latest version, you can use the `autoactivator update` command. Follow the steps below: 1. Open your terminal. 2. Run the following command: ```bash autoactivator update ``` ## Removing AutoActivator To remove AutoActivator from your system, you can delete the cloned repository and remove the configuration from your shell configuration file. Follow the steps below: ```bash # Delete the cloned repository rm -rf ~/.autoactivator ``` Next, remove the configuration from your shell configuration file, it would typically be in `~/.bashrc` for Bash and `~/.zshrc` for Zsh. Open the file in a text editor and delete the following lines: ```bash ############################# AutoActivator ############################# source /home/user/.autoactivator/autoactivator_config.sh ######################################################################### ``` Optionally, you can get back your original shell configuration file by restoring it from the created backup file (`~/.zshrc.pre-autoactivator` or `~/.bashrc.pre-autoactivator`). To do this, run the following command: ```bash # For Zsh mv ~/.zshrc.pre-autoactivator ~/.zshrc # For Bash mv ~/.bashrc.pre-autoactivator ~/.bashrc ``` Finally, restart your terminal or source your shell configuration file: ```bash source ~/.bashrc # for Bash source ~/.zshrc # for Zsh ``` ## Contributing Contributions are always welcome! See `contributing.md` for ways to get started. Please adhere to this project's `code of conduct`.