Metadata-Version: 2.4
Name: roptal-cli
Version: 1.0.0
Summary: Local environment scanner and deployment client for Roptal ML deployments.
Author: Oryvo AI
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://roptal.com
Project-URL: Documentation, https://docs.roptal.com
Keywords: roptal,mlops,deployment,dockerfile,cuda
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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 :: Build Tools
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Roptal CLI

A lightweight, zero-dependency command-line tool for [Roptal](https://roptal.com): scan the environment where your model works, generate deployment files that match it, and deploy into your own cloud account.

## Installation

```bash
pip install roptal-cli
```

Requires Python 3.10 or later. The package uses only the Python standard library, so it adds nothing else to your environment. The command is `roptal`.

## Local commands

These run entirely on your machine; no account or API key is needed. Run them from the root of your Python project.

### `roptal scan`

```bash
roptal scan
```

- Checks `nvcc`, `nvidia-smi` and the local `torch` install for your exact CUDA version and GPU.
- Resolves your exact Python version (e.g. `3.11.8`).
- Uses AST parsing to trace the libraries your code imports, pinned to your installed versions, and the system packages they need (like `libgl1` for OpenCV).
- **Writes:** `roptal_env.json`.

`roptal scan --legacy-name` writes the same file as `ezdeploy_env.json`, the name older tooling expects.

### `roptal detect`

```bash
roptal detect
```

Writes a version-pinned `requirements.txt` and a production `Dockerfile` for your environment.

### `roptal detect --push`

```bash
roptal detect --push
```

Same as `detect`, then commits the two files and runs `git push`.

## API commands

These call the Roptal API and need an API key. Create one in the [Roptal console](https://www.roptal.com/console) under **Settings → API keys**: `deployments:write` to deploy, `deployments:read` for status and logs.

### `roptal login`

```bash
roptal login
```

Prompts for the key (or reads it from `--api-key` or stdin), checks it against the API and saves it in your user config directory (`%APPDATA%\roptal\config.json` on Windows, `~/Library/Application Support/roptal/config.json` on macOS, `~/.config/roptal/config.json` on Linux). The `ROPTAL_API_KEY` environment variable takes precedence over the saved key, so CI can use the CLI without logging in.

### `roptal deploy`

```bash
roptal deploy your-org/your-model --platform huggingface --credential-id <credential-uuid>
```

Starts a deployment of a GitHub repository connected through the Roptal GitHub App. `--platform` is `aws`, `azure` (CPU only) or `huggingface`; `--credential-id` is a cloud credential saved in the console. Optional: `--branch`, `--installation-id` (needed for private repositories and `--dockerfile enhance`), `--hardware-tier`, `--region`, `--project-name`, `--dockerfile none|enhance`, `--json`.

### `roptal status <id>`

```bash
roptal status <deployment-id>
```

Shows the deployment's status, progress, URL and, on failure, a summary with a suggested fix. Add `--json` for the raw response.

### `roptal logs <id>`

```bash
roptal logs <deployment-id> --follow
```

Prints the deployment's logs. `--follow` keeps polling until the deployment finishes; `--json` prints JSON.

The API base URL defaults to `https://api.roptal.com`. Override it with `--api-url`, the `ROPTAL_API_URL` environment variable, or `roptal login --api-url`.

## From scan to a running deployment

1. Run `roptal scan` to record your exact runtime in `roptal_env.json`.
2. Run `roptal detect --push` to commit a matching `Dockerfile` and `requirements.txt`.
3. Deploy, either in the [Roptal console](https://www.roptal.com/console) (choose the **Enhance** Dockerfile option in the deploy wizard) or with `roptal deploy ... --dockerfile enhance`.
4. Watch it with `roptal logs <deployment-id> --follow`.

## Upgrading from ezdeploy-cli

The package was published as `ezdeploy-cli` before 1.0. The `EzDeployCLI` command still works as a deprecated alias that forwards to `roptal`.

Full documentation: <https://docs.roptal.com/cli-install>

## License

Proprietary. Copyright (c) 2025-2026 Oryvo AI. See `LICENSE`.
