semvec/pypi-packages huggingface dataset:
git-variables 0.1.6
Python packages that allows to manage GitLab env variables seamlessly between remote and local respository
License: MIT
Requires Python: <4.0,>=3.10

# git-variables - Manage GitLab Environment Variables

`git-variables` is a Python package designed to simplify the management of GitLab environment variables. It allows you to easily pull environment variables from your GitLab project to your local machine or push local environment variables to your GitLab project. This streamlines your development workflow by ensuring consistency between local and GitLab environments.

## Installation
Install git-variables using pip:

```Bash
pip install git-variables
```
## Usage
git-variables offers two main subcommands: `pull` and `push`.

## Pull
Use the pull command to retrieve environment variables from your GitLab project and store them in a local file.

```Bash
git-variables pull -t <access_token> -r <repository_url> [options]
```

Options:

-t, --access-token: Your GitLab personal access token with sufficient permissions to access environment variables.
-r, --repository-url: The URL of your GitLab repository.
-s, --scope: (Optional) The scope of environment variables to pull. Valid options are project (default), group, or instance.
-o, --output-file: (Optional) Path to the file where downloaded variables will be saved. Defaults to .env.

## Push
Use the push command to update GitLab environment variables from a local file.

```Bash
git-variables push -t <access_token> -r <repository_url> [options]
```

Options:

-t, --access-token: Your GitLab personal access token with sufficient permissions to manage environment variables.
-r, --repository-url: The URL of your GitLab repository.
-s, --scope: (Optional) The scope of environment variables to push. Valid options are project (default), group, or instance.
-e, --env-vars: Path to the file containing environment variables to push. Defaults to .env.

Example:

Pull project environment variables from your GitLab repository and save them to a file named my_env.txt:
```Bash
git-variables pull -t your_access_token -r https://gitlab.com/username/project-name -o .env
```

Push environment variables defined in local_env.env to your GitLab project's group environment variables:
```Bash
git-variables push -t your_access_token -r https://gitlab.com/username/group-name -s group -e local_env.env
```

## Additional Notes
Make sure you have a personal access token with the necessary permissions created in your GitLab account.
Environment variables are stored in a standard .env file format on your local machine (configurable with -o or --output-file).
For detailed information on specific functionalities and error handling, refer to the source code within the package.

## Contributing
We welcome contributions to improve this project. Please refer to the Contributing Guide (if available) for details on how to submit pull requests and participate in development.