# CLI

Python API: `hubai_sdk.__main__`

Provide the `hubai` command-line interface.

The CLI exposes the same HubAI operations as
[HubAIClient](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/hubai_client.md) without
writing Python code. Install the package to use `hubai`; running `python -m hubai_sdk` is equivalent during development.

## Authentication

Run `hubai login` to open the HubAI API-key page and store the key securely. Use `hubai login --relogin` to replace a stored key
and `hubai logout` to remove it. Alternatively, set `HUBAI_API_KEY` in the environment.

## Command groups

 * `hubai model` manages model metadata: `ls`, `info`, `create`, `update`, and `delete`.
 * `hubai variant` manages model variants: `ls`, `info`, `create`, and `delete`.
 * `hubai instance` manages model artifacts: `ls`, `info`, `create`, `delete`, `config`, `files`, `upload`, and `download`.
 * `hubai convert TARGET` uploads a model, runs hosted conversion, and downloads the output. `TARGET` is one of `rvc2`, `rvc3`,
   `rvc4`, or `hailo`.

## Examples

```bash
hubai login
hubai model ls
hubai model info <model-id-or-slug>
hubai model create my-model --license-type MIT --tasks OBJECT_DETECTION
hubai variant ls
hubai instance ls
hubai convert rvc2 --path /path/to/model.onnx --name my-model
```

## Help and parameter reference

Use `hubai --help` to see command groups and `hubai <command> --help` for the exact CLI syntax, choices, and defaults. For
example, use `hubai convert --help` to see conversion options.

The CLI command parameters are derived from the public service functions. The generated API reference for
[hubai_sdk.services.models](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/services/models.md),
[hubai_sdk.services.variants](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/services/variants.md),
[hubai_sdk.services.instances](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/services/instances.md),
and
[hubai_sdk.services.convert](https://docs.luxonis.com/cloud/hubai/model-registry/hubai-sdk/hubai-sdk-api-reference/services/convert.md)
is the detailed reference for the corresponding resource and conversion parameters. The conversion service also documents
target-specific options and calibration behavior.

## Functions

### convert_cli

```python
def convert_cli(*args: object, **kwargs: object) -> object:
```

Run the conversion command through the shared CLI error handler.

### login

```python
def login(relogin: Annotated[bool, Parameter(['--relogin', '-r'])] = False):
```

Login to HubAI.

Parameters

 * `relogin` (`Annotated[bool, Parameter(['--relogin', '-r'])]`): Relogin if already logged in.

### logout

```python
def logout():
```

Logout from HubAI.

### validate_api_key

```python
def validate_api_key(_: str) -> bool:
```

Placeholder API key validator used by the login flow.

## Attributes

### app
