Metadata-Version: 2.4
Name: proxy-platform
Version: 0.32.0
Summary: CLI client for the Proxy Platform
Author: Proxy Platform B.V.
License: Proprietary - Proxy Platform B.V.
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: typer<0.26,>=0.15.0
Requires-Dist: click>=8.0
Requires-Dist: rich==13.7.1
Requires-Dist: requests>=2.33.0
Provides-Extra: dev
Requires-Dist: pytest>=9.0.3; extra == "dev"
Requires-Dist: pytest-cov==6.0.0; extra == "dev"
Requires-Dist: pytest-mock==3.14.0; extra == "dev"
Requires-Dist: httpx==0.28.1; extra == "dev"
Requires-Dist: ruff==0.14.1; extra == "dev"
Requires-Dist: mypy==1.14.0; extra == "dev"
Requires-Dist: types-requests==2.32.4.20250913; extra == "dev"

# Proxy Platform CLI

A command-line client for the Proxy Platform.

## Installation

```bash
pipx install proxy-platform
```

Or with pip:

```bash
pip install proxy-platform
```

## Quick Start

```bash
# Show available commands
proxy-platform --help

# Log in
proxy-platform login

# Browse the product catalog
proxy-platform products list

# List your clusters
proxy-platform clusters list

# List your managed databases
proxy-platform databases list

# List your managed Nextcloud environments
proxy-platform nextcloud list

# Back up a Nextcloud environment now and list its backups (needs the backup add-on)
proxy-platform nextcloud backups create <instance-id>
proxy-platform nextcloud backups list <instance-id>

# Browse the marketplace
proxy-platform marketplace list
proxy-platform marketplace pricing-tiers <listing-id>

# Reply to a review, for example on your own listing
proxy-platform marketplace reply <review-id> --text "Thanks, fixed in 1.4.2"

# View your invoices
proxy-platform billing invoices

# Follow the deployment of an order
proxy-platform orders deploy-status <order-id>

# Costs and payments per month, and your PO number on an order
proxy-platform billing spending-history
proxy-platform billing set-reference <order-id> PO-2026-0042

# View your profile
proxy-platform users profile
```

## Working in an organization

If you are a member of one or more organizations, choose the context the CLI works in.
Clusters, Nextcloud, databases and firewalls are listed and created in that context.

```bash
# List your organizations and your role in each
proxy-platform organizations list

# Work in an organization
proxy-platform organizations use <organization-id>

# Back to your personal account
proxy-platform organizations use personal

# Show the active context
proxy-platform organizations current
```

The choice is remembered. For scripts you can override it per command with the
`PROXY_PLATFORM_CONTEXT` environment variable (an organization ID or `personal`).

## Ordering

Orders go through the cart, like in the web portal:

```bash
proxy-platform cart add --product <product-id> --tier <tier-id> --type cluster --name prod \
    --config '{"provider": "hetzner", "region": "fsn1"}'
proxy-platform cart show

# Optional: turn the cart into a quote (PDF)
proxy-platform cart quote --reference PO-2026-114 --output quote.pdf

# Order everything in the cart; you must accept the documents explicitly
proxy-platform documents list
proxy-platform cart checkout --accept-documents
```

## Nextcloud backups

Your Nextcloud environments are backed up automatically. With the backup add-on (a paid option) you can
see those backups, make one yourself, delete one, and restore one:

```bash
proxy-platform nextcloud backups activate <instance-id>                 # turn on the add-on
proxy-platform nextcloud backups list <instance-id> [--json]
proxy-platform nextcloud backups create <instance-id> [--wait]          # back up now; --wait follows it step by step
proxy-platform nextcloud backups delete <instance-id> <backup-id>
proxy-platform nextcloud backups restore <instance-id> <backup-id> [--wait]
proxy-platform nextcloud backups restores <instance-id> [--json]        # restores and their status
proxy-platform nextcloud backups watch <instance-id> <id>               # follow a backup or restore started earlier
```

A restore replaces what is on the environment now: everything changed after the backup is lost. To confirm,
you type the name of the environment again (or pass `--confirm-name`). The request is checked and queued.
During the restore your environment is in maintenance mode, so nothing changes while the backup is put back;
once the restored environment has been checked, it runs on from the backup.

`--wait` and `watch` show each step as it starts and ends, until the backup or restore is done. A backup is
followed for up to 30 minutes and a restore for up to 70; change that with `--timeout <minutes>`. For scripts they
end with an exit code: 0 done, 1 failed or not found, 2 the time ran out (the job goes on; `watch` it again),
3 waiting for approval. `--json` prints a list as JSON, as the platform returns it.

## Commands

| Command group | Purpose |
|---------------|---------|
| `auth` | Login, logout, and session management |
| `organizations` | Organizations, the active context, members, invites, and resource locks |
| `products` | Browse the product catalog |
| `cart` | Cart, quotes, and checkout |
| `orders` | View your orders and follow their deployment, or order a single product directly |
| `clusters` | Manage your Kubernetes clusters, including scaling and logs |
| `apps` | Install, configure, upgrade, and remove marketplace apps on your clusters |
| `gpu-requests` | Request a GPU cluster, change it while it awaits review, and order it once approved |
| `databases` | Manage your managed databases |
| `nextcloud` | Manage your Nextcloud environments: upgrades, modules, login credentials, custom domain, backups and restores |
| `marketplace` | Browse marketplace apps, versions, pricing tiers, and reviews; write reviews and reply to them |
| `billing` | Invoices, billing information, payments, spending history, and PO references |
| `subscriptions` | View your subscriptions, cancel per the end of the month, or undo a cancellation |
| `firewall` | Manage firewall rules |
| `providers` | Cloud provider regions and server types |
| `documents` | Download your documents |
| `settings` | Manage your account preferences |
| `users` | View and update your profile |
| `support` | Open and track support tickets |
| `feedback` | Submit feedback and feature requests, vote, comment, close your own items, and follow items for updates |

Run any command with `--help` for usage details:

```bash
proxy-platform clusters --help
proxy-platform databases list --help
proxy-platform orders create --help
```

## Shell Completion

Enable tab completion in your shell:

```bash
proxy-platform --install-completion
```

## Configuration

Configuration and tokens are stored in `~/.proxy-platform/`. Tokens are saved with `0600` permissions and refreshed automatically.

## Requirements

- Python 3.11 or newer

## License

Proprietary. © Proxy Platform B.V.
