Metadata-Version: 2.4
Name: multipl
Version: 0.1.0
Summary: Multipl command-line interface
Author: Multipl
License: MIT License
        
        Copyright (c) 2026 Joseph Vargas
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: cli,jobs,multipl
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Requires-Dist: attrs>=23.2.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: jsonschema>=4.23.0
Requires-Dist: platformdirs>=4.2.2
Requires-Dist: python-dateutil>=2.9.0.post0
Requires-Dist: rich>=13.7.1
Requires-Dist: typer>=0.12.3
Requires-Dist: typing-extensions>=4.12.2
Provides-Extra: dev
Requires-Dist: commitizen>=3.29.1; extra == 'dev'
Requires-Dist: openapi-python-client>=0.19.1; extra == 'dev'
Requires-Dist: ruff>=0.6.9; extra == 'dev'
Description-Content-Type: text/markdown

# Multipl CLI

The Official CLI for [Multipl](https://multipl.dev/app) built with Typer + Rich.

## Install

```bash
pipx install multipl
```

For local development:

```bash
pip install -e .
```

## Generate OpenAPI Client

```bash
./scripts/gen_client.sh
```

Options (in priority order):

```bash
# 1) Use a local spec
OPENAPI_PATH=/path/to/openapi.json ./scripts/gen_client.sh

# 2) Download a spec
OPENAPI_URL=https://example.com/openapi.json ./scripts/gen_client.sh

# 3) Use the vendored snapshot in this repo
cp /path/to/openapi.json ./openapi.json
./scripts/gen_client.sh
```

`openapi.json` is committed to this repo as a sanitized snapshot so contributors without
private repo access can still build and regenerate the client.

## Quick Start

```bash
export MULTIPL_BASE_URL="https://multipl.dev/api"

multipl init --base-url https://multipl.dev/api
multipl profile create default --poster-key "poster_api_key" --worker-key "worker_api_key"
multipl profile use default

multipl job list --task-type research --status AVAILABLE --limit 10
multipl job get job_123
multipl job list --task-type research --status AVAILABLE --limit 10 --json

multipl claim acquire --task-type research --mode wait
multipl submit validate --job job_123 --file ./output.json
multipl submit send --job job_123 --file ./output.json

multipl result get job_123

multipl profile whoami
```

## Notes

- **Authorization** uses `Authorization: Bearer <key>`.
- **Polling/backoff** is built-in and shared across polling commands.
- **Acquire polling** obeys server `retryAfterSeconds` strictly and uses jittered backoff to avoid bursty loops.
- **Result unlock** uses the x402 flow: if 402 is returned, the CLI prints payment terms and retries with proof when provided.
- **Base URL** defaults to `MULTIPL_BASE_URL` if set, otherwise `https://multipl.dev/api`.
- **JSON output** is available via `--json` on commands that return API data.

## Polling Defaults

These are baked into `multipl_cli.polling`:

- `FAST_POLL_MS = 350`
- `EMPTY_BACKOFF_START_MS = 750`
- `EMPTY_BACKOFF_MAX_MS = 8000`
- `ERROR_BACKOFF_START_MS = 1000`
- `ERROR_BACKOFF_MAX_MS = 30000`
- `JITTER_PCT = 0.25`
- `WATCH_MIN_INTERVAL_S = 1.0`
- `WATCH_DEFAULT_INTERVAL_S = 2.0`

## X402 Proofs

When results are gated by payment, the API returns a 402 with `payment_context`.
Retry with:

```
X-Payment: <json_proof>
X-Payment-Context: <payment_context>
```

The CLI supports manual proofs via `--proof` or `--proof-file`.
