Metadata-Version: 2.3
Name: chupo
Version: 0.1.3
Summary: CLI tool to upload images to Chevereto (V4 API V1 file upload) with a polished terminal UI.
Requires-Dist: typer>=0.15.0
Requires-Dist: rich>=13.9.0
Requires-Dist: httpx>=0.28.0
Requires-Python: >=3.13
Description-Content-Type: text/markdown

![Chupo](./logo.png)
# chupo

**chupo** is a high-performance CLI utility designed to upload images directly to a [Chevereto](https://chevereto.com/) instance. It streamlines the image sharing workflow, utilizing the [Chevereto API V1 file upload](https://v4-docs.chevereto.com/api/1/file-upload.html) endpoint for fast and reliable uploads.

[![Python >=3.13](https://img.shields.io/badge/python-3.13%2B-blue)](https://www.python.org/)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)

---

## ✨ Features

-   ⚡ **High Performance**: Built with modern Python for fast execution.
-   🛠️ **CLI-First**: Designed for speed and terminal integration using [Typer](https://typer.tiangolo.com/).
-   📊 **Beautiful Output**: Features rich, colored terminal output with progress bars via [Rich](https://rich.readthedocs.io/).
-   🚀 **Simple Setup**: Supports configuration via environment variables or CLI flags.
-   📂 **Batch Upload**: Effortlessly upload multiple files at once.

---

## 🚀 Quick Start

### 1. Installation

Install **chupo** as a global tool using [uv](https://github.com/astral-sh/uv):

```bash
uv tool install .
```

Or, if you prefer using pip:

```bash
pip install .
```

### 2. Usage

Upload a single image:

```bash
chupo photo.png -u https://mysite.com -k YOUR_API_KEY
```

Upload multiple images:

```bash
chupo a.png b.png -u https://mysite.com -k YOUR_API_KEY
```

Interactive styled output (logo, progress, panels):

```bash
chupo img.jpg -u https://mysite.com -k YOUR_API_KEY -f pretty -v
```

---

## 🛠️ Configuration

You can pass flags directly or set environment variables (flags override environment variables).

| Variable            | Flag                | Description                        |
|---------------------|---------------------|------------------------------------|
| `CHEVERETO_URL`     | `-u` / `--base-url` | Site base URL (e.g., `https://img.example.com`) |
| `CHEVERETO_API_KEY` | `-k` / `--key`      | Your Chevereto API key             |

### Options

-   `-f` / `--format`: **`txt`** (default): one URL per line to stdout, no banner. **`json`**: raw JSON response body per file (blank line between files). **`redirect`**: Chevereto redirect mode; stdout is the resolved URL. **`pretty`**: logo, spinner, and Rich panels (uses API `format=json`).
-   `-v` / `--verbose`: With `-f pretty`, prints the full `image` payload in a panel when the server returns JSON.
-   `--raw`: Force plain stdout even with `-f pretty` (emits raw JSON bodies like `-f json`). Errors go to stderr; non-zero exit if any upload fails.

Pipe-friendly (default format is already plain URLs):

```bash
chupo photo.png -u https://mysite.com -k YOUR_API_KEY > url.txt
```

Raw JSON:

```bash
chupo photo.png -u https://mysite.com -k YOUR_API_KEY -f json > out.json
```

---

## 📋 API Scope

This client follows the **[Chevereto V4 — API V1 file upload](https://v4-docs.chevereto.com/api/1/file-upload.html)** specification (`POST /api/1/upload`, multipart `source`, `X-API-Key` header). It is optimized for modern Chevereto V4 instances.

---

## 📄 License

This project is licensed under the MIT License.
