Metadata-Version: 2.1
Name: git-variables
Version: 0.1.1
Summary: Python packages that allows to manage GitLab env variables seamlessly between remote and local respository
License: MIT
Author: Gorka
Author-email: riberagorka@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Description-Content-Type: text/markdown

# 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 gitlab-variables using pip:

```Bash
pip install gitlab-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
gitlab-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
gitlab-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
gitlab-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
gitlab-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.


