Metadata-Version: 2.4
Name: odoogci
Version: 0.2.6
Summary: Utility to clone odoo modules repository with requirements installation
License: GNU/GPL V2
Author: Alitux
Author-email: alitux@disroot.org
Requires-Python: >=3.9,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: gitpython (>=3.1.46,<4.0.0)
Requires-Dist: typer (>=0.15.1,<0.16.0)
Description-Content-Type: text/markdown

# odoogci

A utility for cloning Git repositories, removing unnecessary files, and installing dependencies from `requirements.txt`. It is specifically designed to facilitate building Odoo Docker images.

## Features

- **Recursive Cloning:** Automatically handles submodules recursively.
- **Authentication Support:** Easy integration with GitHub and GitLab tokens.
- **JSON Batch Processing:** Clone multiple repositories with a single command.
- **Verbose Mode:** Detailed real-time progress of cloning, updates, and submodule processing.
- **Safe Authentication:** Prevents hangs by disabling interactive prompts during Git operations.

## Requirements

Ensure you have the following tools installed on your system:

- Python ^3.9
- Git
- pip (Python package manager)

## Installation

### Via pipx (Recommended for CLI)
```sh
pipx install odoogci
```

### Via pip
```sh
pip install odoogci
```

### In a Dockerfile (From source)
Add the following line to your Dockerfile:

```Dockerfile
RUN pip3 install git+https://github.com/Alitux/odoogci.git
```

## Usage

The general usage of the tool is:

```sh
odoogci [URL] [OPTIONS]
```

### Arguments

*   `URL`: URL of the repository to clone.

### Options

*   `--branch TEXT`: Branch of the repository.
*   `--repositories TEXT`: JSON string with a list of repositories to clone.
*   `--requirements / --no-requirements`: Install dependencies from `requirements.txt`. [default: no-requirements]
*   `--repopath TEXT`: Local path where the repository will be cloned.
*   `--token TEXT`: Access token for the repository (supports GitHub and GitLab).
*   `--verbose / -v`: Enable detailed output of all operations.

### Examples

#### Simple Clone
```sh
odoogci https://github.com/ingadhoc/odoo-argentina --branch 16.0
```

#### Clone Multiple Repositories using JSON
You can specify the token, branch, and path per repository.

```sh
odoogci --repositories '[
    {
        "url": "https://github.com/org/repo1",
        "branch": "18.0",
        "repo_path": "repo1",
        "token": "your_github_token"
    },
    {
        "url": "https://github.com/OCA/commission",
        "branch": "18.0",
        "repo_path": "oca/commission"
    }
]'
```

#### Verbose Output
See exactly what is happening, including submodule updates:
```sh
odoogci https://github.com/ingadhoc/odoo-argentina -v
```

#### Usage in a Dockerfile

```Dockerfile
RUN cd /usr/lib/python3/dist-packages/odoo/addons/ && \
    odoogci https://github.com/ingadhoc/odoo-argentina --branch 16.0 && \
    odoogci https://github.com/ingadhoc/account-invoicing --branch 16.0
```

## Parameter Precedence
When using the `--repositories` (JSON) option:
1.  **Branch:** If a global `--branch` is provided, it overrides all branches in the JSON. If not, the branch in the JSON is used. If none is specified, it clones the default branch.
2.  **Token:** If a global `--token` is provided, it overrides all tokens in the JSON.
3.  **Recursivity:** All operations (clones and updates) are performed with `--recursive` by default.

