Metadata-Version: 2.4
Name: powertech-cli
Version: 0.1.0
Summary: PowerTech CLI for batch video upload and result download.
Author: PowerTech
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: alibabacloud-oss-v2<2,>=1.3.2
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: build<2,>=1.2; extra == "dev"
Requires-Dist: ruff<1,>=0.9; extra == "dev"

# PowerTech CLI

Command-line client for uploading video batches and downloading processing results.

## Development install

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
```

The same package is used in every environment. Production is the default;
development and staging select another API URL during login and keep their local
CLI state in separate directories.

## Environments

### Development

Start `powertech-api` at `http://127.0.0.1:8000`, then create a CLI token in the
development SaaS web app:

```bash
POWERTECH_CLI_HOME=~/.powertech/dev \
powertech login --token <development_token> --api-url http://127.0.0.1:8000
```

### Staging

Use the same editable installation and save staging credentials separately:

```bash
POWERTECH_CLI_HOME=~/.powertech/staging \
powertech login \
  --token <staging_token> \
  --api-url https://api-staging.powertech-ai.com
```

Set the same `POWERTECH_CLI_HOME` when running later commands. The saved
configuration is private to the current operating-system user.

### Production

PyPI releases default to the production API:

```bash
powertech login --token <production_token>
```

Use `--api-url` only for development, staging, or a private deployment. The URL
is saved with the token, so later upload and download commands do not repeat it.

## Upload

Each command creates one upload batch. Directory uploads preserve relative paths,
and `--resume` retains the batch and completed OSS parts after interruption.

```bash
POWERTECH_CLI_HOME=~/.powertech/staging powertech upload ./video.mp4 --resume
POWERTECH_CLI_HOME=~/.powertech/staging powertech upload ./videos --recursive --resume
POWERTECH_CLI_HOME=~/.powertech/staging powertech status <upload_batch_id>
```

Supported input formats: MP4 and MOV.

## Download

```bash
POWERTECH_CLI_HOME=~/.powertech/staging \
powertech download --upload-batch <upload_batch_id> --output ./results
```

The output always contains `manifest.json`. Result files are downloaded into the
paths returned by the API.

## Local Test Mode

The isolated mock adapter does not use RDS or OSS:

```bash
powertech login --token dev_token --api-url local
powertech upload ./videos --recursive --resume
```

CLI state is stored under `~/.powertech/`. Set `POWERTECH_CLI_HOME` to use another
directory during tests.

## Continuous integration

Pull requests and pushes to `main` run Ruff, the unit tests, and a packaging smoke
test. The packaging check is release preparation; staging does not deploy or
require a separate CLI package. PyPI publication is a separate, manually
triggered GitHub Actions workflow.
