Metadata-Version: 2.4
Name: picsellia-pipelines-cli
Version: 0.3.2
Author-email: Sonia Garrouch <sonia.garrouch@picsellia.com>, Pierre-Nicolas Tiffreau <pierre-nicolas@picsellia.com>
Maintainer-email: Sonia Garrouch <sonia.garrouch@picsellia.com>, Pierre-Nicolas Tiffreau <pierre-nicolas@picsellia.com>
License: MIT
License-File: LICENSE
Keywords: cli,computer-vision,cv-engine,picsellia,pipeline,vision
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
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: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.10
Requires-Dist: dotenv<1.0,>=0.9.9
Requires-Dist: picsellia<7.0.0,>=6.20.0
Requires-Dist: semver<4.0.0,>=3.0.0
Requires-Dist: toml<1.0,>=0.10.2
Requires-Dist: typer<0.16.0,>=0.15.2
Description-Content-Type: text/markdown

# 🧪 Picsellia Pipelines CLI

A command-line tool to create, test, deploy, and manage training and processing pipelines for [Picsellia](https://picsellia.com/).

Built with [Typer](https://typer.tiangolo.com/) for intuitive CLI usage.

---

## Installation

Install the CLI directly from GitHub (no need to clone the repo):

#### Using Poetry:

```bash
poetry add picsellia-pipelines-cli
```

#### Using uv (faster, works with requirements.txt or pyproject.toml):

```bash
uv pip install picsellia-pipelines-cli
```

You can now use:

```bash
pxl-pipeline --help
```

## Available Commands
🔹 All CLI commands are structured like this:

```bash
pxl-pipeline [init|test|deploy|smoke-test|sync] <pipeline_name>
```
The pipeline type is resolved automatically from its config file (config.toml), except during init.


## 🔧 Initialize a Pipeline

```bash
pxl-pipeline init <pipeline_name> --type [training|processing] --template <template>
```

Examples:
```bash
pxl-pipeline init yolov8 --type training --template ultralytics
pxl-pipeline init resize-images --type processing --template dataset_version_creation
```

This generates:

- a `config.toml` with pipeline metadata

- a `Dockerfile`, `.dockerignore`, and dependency file (`pyproject.toml` or `requirements.txt`)

- scripts for both `picsellia_pipeline.py` and `local_pipeline.py`

- pre-filled `steps.py` and utility files

You can customize templates in your own extensions later.

### After Initialization

Once the pipeline is initialized:

- A local virtual environment is automatically created inside the pipeline directory (`<pipeline_name>/.venv`)
- You can directly activate it and run any pipeline-related commands:

```bash
cd <pipeline_name>
source .venv/bin/activate  # or .venv\Scripts\activate.bat on Windows
```

You can still use the CLI from inside the venv:
```bash
pxl-pipeline test <pipeline_name>
```

## 🧪 Test Locally

```bash
pxl-pipeline test <pipeline_name>
```

Runs the pipeline in a local virtualenv (.venv/) and prompts for required parameters (e.g., dataset version ID, experiment ID, etc.).

## 🔥 Smoke Test in Docker

```bash
pxl-pipeline smoke-test <pipeline_name>
```

Builds the Docker image for the pipeline and runs it locally to validate that everything (code + dependencies + env) works inside the container.


## 🚀 Deploy to Picsellia

```bash
pxl-pipeline deploy <pipeline_name>
```

Builds and pushes the Docker image to your configured registry and registers the pipeline in Picsellia (either as a training pipeline or a dataset processing job).

## 🔁 Sync Parameters (Processing Only)

```bash
pxl-pipeline sync <pipeline_name>

```

For processing pipelines, this updates the default parameters stored in Picsellia based on your Parameters class and config.toml.

Training sync is not yet implemented.

## 📁 Project Structure Example

```bash
resize-images/
├── config.toml
├── Dockerfile
├── picsellia_pipeline.py
├── local_pipeline.py
├── steps.py
├── utils/
│   ├── parameters.py
│   └── processing.py
└── pyproject.toml
```

## 💡 Tips

- You can override the output directory on init with --output-dir
- Virtual environments are created in `<pipeline_name>/.venv` by default
- You can always edit config.toml to change pipeline metadata or execution scripts

--------------------------------

Made with ❤️ by the Picsellia team.
