> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bizyair.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# BizyAir CLI

> Command-line tool for managing model files on BizyAir

## Introduction

BizyAir CLI is a command-line tool for managing model files on BizyAir. It provides two usage modes — an **interactive interface (TUI)** and a **command-line interface (CLI)** — enabling you to easily upload and manage BizyAir models.

| Mode               | Best for                                     |
| ------------------ | -------------------------------------------- |
| Interactive (TUI)  | Newcomers or those unfamiliar with CLI flags |
| Command-line (CLI) | Scripting, CI/CD, batch operations           |

***

## Releases

For all published releases, please [view them here](https://github.com/siliconflow/bizyair-cli/releases).

***

## Installation

### Download

BizyAir CLI supports Linux, macOS, and Windows. Prebuilt binaries for all platforms are available from:

* **bizyair.ai** — User Center → Publish Model page: ([https://bizyair.ai/publish/model)](https://bizyair.ai/publish/model)
* **GitHub Releases:** ([https://github.com/siliconflow/bizyair-cli/releases](https://github.com/siliconflow/bizyair-cli/releases))

### Linux Installation

**Download**

```bash theme={null}
# Set the version (replace with the latest)
VERSION=0.2.8

# Download Linux amd64
wget https://github.com/siliconflow/bizyair-cli/releases/download/v${VERSION}/bizyair-v${VERSION}-linux-amd64.tar.gz

# Or download Linux arm64
# wget https://github.com/siliconflow/bizyair-cli/releases/download/v${VERSION}/bizyair-v${VERSION}-linux-arm64.tar.gz
```

**Extract and install**

```bash theme={null}
# Extract the archive
tar -xzvf bizyair-v${VERSION}-linux-amd64.tar.gz

# Install to system path
sudo install bizyair /usr/local/bin/bizyair

# Or install to user directory (no sudo required)
# mkdir -p ~/.local/bin
# install bizyair ~/.local/bin/bizyair
# Ensure ~/.local/bin is in your PATH
```

**Verify installation**

```bash theme={null}
bizyair --version
```

### macOS Installation

**Download**

```bash theme={null}
# Set the version (replace with the latest)
VERSION=0.2.8

# Download macOS arm64 (Apple Silicon, e.g. M1/M2/M3)
curl -LO https://github.com/siliconflow/bizyair-cli/releases/download/v${VERSION}/bizyair-v${VERSION}-macos-arm64.tar.gz

# Or download macOS amd64 (Intel chips)
# curl -LO https://github.com/siliconflow/bizyair-cli/releases/download/v${VERSION}/bizyair-v${VERSION}-macos-amd64.tar.gz
```

**Extract and install**

```bash theme={null}
# Extract the archive
tar -xzvf bizyair-v${VERSION}-macos-arm64.tar.gz

# Grant execute permission
chmod +x bizyair

# Install to system path
sudo install bizyair /usr/local/bin/bizyair

# Or install to user directory (no sudo required)
# mkdir -p ~/.local/bin
# install bizyair ~/.local/bin/bizyair
# Ensure ~/.local/bin is in your PATH
```

**Handle macOS security warning**

On first run, macOS may show a security warning.

```bash theme={null}
# Remove the quarantine attribute
sudo xattr -d com.apple.quarantine /usr/local/bin/bizyair
```

Or allow it via System Settings:

* Open **System Settings** → **Privacy & Security**
* Find the blocked `bizyair` and click **Open Anyway**

**Verify installation**

```bash theme={null}
bizyair --version
```

### Windows Installation

* Download the latest version from the [Releases page](https://github.com/siliconflow/bizyair-cli/releases)
* Download the `bizyair-v{VERSION}-windows-amd64.zip` file

**Extract**

* Right-click the downloaded `.zip` file
* Choose **Extract All** or use a tool like 7-Zip
* Extract `bizyair.exe` to a directory of your choice (e.g. `C:\Program Files\BizyAir\`)

**Add to system PATH (recommended)**

* Right-click **This PC** → **Properties** → **Advanced system settings**
* Click **Environment Variables**
* Under **System variables**, find `Path` and click **Edit**
* Click **New** and add the directory containing `bizyair.exe`
* Click **OK** to save

**Verify installation** (open **Command Prompt** or **PowerShell**)

```powershell theme={null}
bizyair --version
```

> 💡 If not added to PATH, run with the full path: `C:\Program Files\BizyAir\bizyair.exe --version`

***

## Build from Source

BizyAir CLI currently requires Go v1.22.x or higher. To build from source:

* Clone the repository
* Build and run the executable

```bash theme={null}
make build && ./execs/bizyair
```

**Platform-specific build commands:**

| Platform      | Command                  |
| ------------- | ------------------------ |
| Windows       | `make build_windows`     |
| macOS         | `make build_mac`         |
| Linux (amd64) | `make build_linux`       |
| Linux (arm64) | `make build_linux_arm64` |

***

## Upgrade to the Latest Version

BizyAir CLI supports one-click upgrade to the latest version:

```bash theme={null}
# Check for updates
bizyair upgrade --check

# Perform the upgrade
sudo bizyair upgrade
```

***

## Quick Start

### Use the Interactive Interface (Recommended)

**Launch the TUI**

```bash theme={null}
bizyair
```

**First-time login**

* Enter your API Key (obtained from [BizyAir](https://bizyair.ai))
* Press Enter to confirm

**Choose a feature**

| Menu item    | Description                                 |
| ------------ | ------------------------------------------- |
| Upload Model | Interactively collect parameters and upload |
| My Models    | View uploaded models in the browser         |
| Logout       | Clear the local API Key                     |
| Exit         | Quit the CLI                                |

**Upload a model**

* Follow the prompts to enter information step by step
* Supports a file picker or manual path entry
* Supports multi-version uploads
* Automatically shows upload progress and speed

### Use the Command Line

#### Login

BizyAir CLI uses an API Key for authentication. To log in, run:

```bash theme={null}
# If you have set the BIZYAIR_API_KEY environment variable
bizyair login

# Or specify it with the --key/-k flag
bizyair login -k $BIZYAIR_API_KEY
```

#### Upload a Model

**Single-version example:**

```bash theme={null}
bizyair upload -n mymodel -t LoRA \
  -p /local/path/model.safetensors \
  -b "Flux.1 D" \
  -cover "/path/to/cover.jpg" \
  --intro "A LoRA model in anime style"
```

**Multi-version example:**

```bash theme={null}
bizyair upload -n mymodel -t Checkpoint \
  -v "v1.0" -p /path/file1.safetensors -b SDXL --intro "Version one" -cover "/path/cover1.jpg" \
  -v "v2.0" -p /path/file2.safetensors -b "SD 1.5" --intro "Version two" -cover "/path/cover2.jpg"
```

**Core parameters:**

| Flag            | Description                                                 |
| --------------- | ----------------------------------------------------------- |
| `-n, --name`    | Model name (required)                                       |
| `-t, --type`    | Model type (required, e.g. LoRA, Checkpoint, Controlnet)    |
| `-p, --path`    | Model file path (required, repeatable)                      |
| `-b, --base`    | Base model (required, e.g. "Flux.1 D", SDXL, "SD 1.5")      |
| `-cover`        | Cover file or URL (required)                                |
| `-i, --intro`   | Model description text (required)                           |
| `--intro-path`  | Import description from file (mutually exclusive with `-i`) |
| `-v, --version` | Version name (optional, default v1.0)                       |
| `--public`      | Whether the version is public (optional, default false)     |

#### Cover Upload (Required)

The cover supports both **local files** and **URLs**; it is automatically uploaded to OSS and converted to WebP:

```bash theme={null}
# Use a local file
bizyair upload -n mymodel -t LoRA -p model.safetensors -b "Flux.1 D" \
  -cover "/path/to/cover.jpg" --intro "Description text"

# Use a URL
bizyair upload -n mymodel -t LoRA -p model.safetensors -b "Flux.1 D" \
  -cover "https://example.com/cover.jpg" --intro "Description text"
```

**Supported formats:**

| Type  | Extensions                           |
| ----- | ------------------------------------ |
| Image | `.jpg` `.jpeg` `.png` `.gif` `.webp` |
| Video | `.mp4` `.webm` `.mov` (max 100 MB)   |

> 💡 **WebP conversion:** Image covers are automatically converted to WebP to optimize loading. If conversion fails, the original format is used as a fallback.

#### Description Text

Two ways to provide a model description (up to 5,000 characters):

```bash theme={null}
# Enter text directly
bizyair upload -n mymodel -t LoRA -p model.safetensors -b "Flux.1 D" \
  -cover cover.jpg --intro "Detailed description of the model..."

# Import from file (.txt and .md)
bizyair upload -n mymodel -t LoRA -p model.safetensors -b "Flux.1 D" \
  -cover cover.jpg --intro-path intro.md
```

#### YAML Batch Upload

Use a YAML config file to upload multiple models at once:

```bash theme={null}
bizyair upload -f config.yaml
```

For full details, see [example.yaml](https://github.com/siliconflow/bizyair-cli/blob/main/example.yaml).

**Example:**

```yaml theme={null}
models:
  - name: "anime_style_lora"
    type: "LoRA"
    versions:
      - name: "v1.0"
        base_model: "Flux.1 D"
        model_path: "models/anime_v1.safetensors"
        cover_path: "covers/anime_v1.jpg"
        intro: "First version of the anime-style model"
        public: true

      - name: "v2.0"
        base_model: "Flux.1 D"
        model_path: "models/anime_v2.safetensors"
        cover_url: "https://example.com/cover.jpg"
        intro_path: "descriptions/v2_intro.txt"
        public: false

  - name: "realistic_checkpoint"
    type: "Checkpoint"
    versions:
      - base_model: "SD 1.5"
        model_path: "checkpoints/realistic.ckpt"
        cover_path: "covers/realistic.webp"
        intro_path: "descriptions/realistic.md"
```

**Field reference:**

| Field                      | Description                                 |
| -------------------------- | ------------------------------------------- |
| `model_path`               | Model file path (relative to the YAML file) |
| `cover_path` / `cover_url` | Cover file or URL (choose one)              |
| `intro` / `intro_path`     | Description text or file (choose one)       |
| `name`                     | Version name (optional, auto-incremented)   |
| `public`                   | Whether public (optional, default false)    |

#### Resumable Upload

If an upload is interrupted, re-running the same command resumes from the breakpoint:

```bash theme={null}
# First attempt (interrupted)
bizyair upload -n mymodel -t Checkpoint -p large-model.safetensors -b SDXL \
  -cover cover.jpg --intro "Description"
# ^C (interrupted)

# Re-run the same command to resume
bizyair upload -n mymodel -t Checkpoint -p large-model.safetensors -b SDXL \
  -cover cover.jpg --intro "Description"
# ✓ Resumed from the breakpoint
```

> 💡 Resumable-upload checkpoint files are stored in `~/.bizyair/uploads/`.

#### View Models

```bash theme={null}
# List my models (opens in the browser)
bizyair model ls
```

#### Logout

```bash theme={null}
bizyair logout
```

***

## Command Reference

**Full command cheat sheet:**

| Command                    | Purpose                                 |
| -------------------------- | --------------------------------------- |
| `bizyair`                  | Launch the interactive TUI              |
| `bizyair --version`        | Show version                            |
| `bizyair login`            | Log in with the`BIZYAIR_API_KEY`env var |
| `bizyair login -k <KEY>`   | Log in with a specific key              |
| `bizyair logout`           | Log out and clear local credentials     |
| `bizyair upload [flags]`   | Upload a model                          |
| `bizyair upload -f <file>` | Batch upload via a YAML file            |
| `bizyair model ls`         | List my models (browser)                |
| `bizyair upgrade --check`  | Check for updates                       |
| `bizyair upgrade`          | Perform the upgrade                     |
