# CLI-Referenz

Die `clore` Die CLI ermöglicht es Ihnen, den Clore.ai GPU-Marktplatz direkt von Ihrem Terminal aus zu verwalten — suchen Sie nach GPUs, starten Sie Instanzen, verbinden Sie sich per SSH und verwalten Sie Bestellungen, ohne Code zu schreiben.

***

## Installation

```bash
pip install clore-ai
```

Dies installiert sowohl das Python-SDK als auch das `clore` CLI-Kommando.

**Voraussetzungen:** Python 3.9+

***

## Konfiguration

### Setzen Sie Ihren API-Schlüssel

Holen Sie Ihren Schlüssel vom [Clore.ai-Dashboard](https://clore.ai) → **API** Bereich, und konfigurieren Sie dann:

```bash
clore config set api_key YOUR_API_KEY
```

Dies speichert den Schlüssel in `~/.clore/config.json`.

### Oder verwenden Sie eine Umgebungsvariable

```bash
export CLORE_API_KEY=your_api_key_here
```

### Aktuelle Konfiguration anzeigen

```bash
# Alle Konfigurationen anzeigen
clore config show

# Einen bestimmten Wert abrufen
clore config get api_key
```

***

## Befehle

| Befehl                                | Beschreibung                                   |
| ------------------------------------- | ---------------------------------------------- |
| `clore search`                        | Den GPU-Marktplatz durchsuchen                 |
| `clore deploy <server_id>`            | Eine neue Bestellung erstellen (Server mieten) |
| `clore orders`                        | Ihre Bestellungen auflisten                    |
| `clore cancel <order_id>`             | Eine Bestellung stornieren                     |
| `clore ssh <order_id>`                | Per SSH in eine aktive Bestellung einloggen    |
| `clore wallets`                       | Wallet-Salden anzeigen                         |
| `clore servers`                       | Ihre gehosteten Server auflisten               |
| `clore server-config <name>`          | Serverkonfiguration abrufen                    |
| `clore spot <server_id>`              | Spotmarkt für einen Server anzeigen            |
| `clore spot-price <order_id> <price>` | Spot-Preis setzen                              |
| `clore config set <key> <value>`      | Einen Konfigurationswert setzen                |
| `clore config get <key>`              | Einen Konfigurationswert abrufen               |
| `clore config show`                   | Alle Konfiguration anzeigen                    |
| `clore --version`                     | Version anzeigen                               |

***

## Detaillierte Nutzung

### `clore search`

Durchsuchen Sie den GPU-Marktplatz mit Filtern und Sortierung.

```bash
# Alle verfügbaren Server auflisten (nach Preis sortiert, Top 20)
clore search

# Nach GPU-Modell filtern
clore search --gpu "RTX 4090"

# Nach GPU und Max-Preis filtern
clore search --gpu "RTX 4090" --max-price 5.0

# Multi-GPU-Rigs
clore search --min-gpu 4

# Nach GPU-Anzahl sortieren, Top 10 anzeigen
clore search --sort gpu --limit 10

# Filter kombinieren
clore search --gpu "A100" --min-ram 128 --max-price 10.0 --sort price --limit 5
```

**Optionen:**

| Option        | Typ     | Beschreibung                                     |
| ------------- | ------- | ------------------------------------------------ |
| `--gpu`       | Text    | Nach GPU-Modell filtern (z. B. `"RTX 4090"`)     |
| `--min-gpu`   | int     | Minimale GPU-Anzahl                              |
| `--min-ram`   | float   | Minimale RAM-Größe in GB                         |
| `--max-price` | float   | Maximaler Preis in USD/Stunde                    |
| `--sort`      | Auswahl | Sortieren nach: `Preis` (Standard), `GPU`, `RAM` |
| `--limit`     | int     | Maximale Anzahl an Ergebnissen (Standard: 20)    |

**Beispielausgabe:**

```
🔍 GPU-Marktplatz
┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ ID  ┃ GPU                             ┃ Anzahl┃ RAM (GB) ┃ CPU                          ┃ Preis/h (USD) ┃ Standort ┃
┡━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ 123 │ 1x NVIDIA GeForce RTX 4090      │     1 │    64.0  │ AMD Ryzen 9 5900X            │       $0.3200 │ US       │
│ 456 │ 2x NVIDIA GeForce RTX 4090      │     2 │   128.0  │ Intel Core i9-13900K         │       $0.5800 │ DE       │
└─────┴─────────────────────────────────┴───────┴──────────┴──────────────────────────────┴───────────────┴──────────┘
Es werden 2 Server angezeigt
```

***

### `clore deploy <server_id>`

Erstellen Sie eine neue Bestellung, um einen GPU-Server zu mieten.

```bash
# On-Demand-Bestellung mit SSH
clore deploy 123 \
  --image cloreai/ubuntu22.04-cuda12 \
  --type on-demand \
  --currency bitcoin \
  --ssh-password MySecurePass123 \
  --port 22:tcp \
  --port 8888:http

# Spot-Bestellung
clore deploy 123 \
  --image cloreai/pytorch \
  --type spot \
  --currency bitcoin \
  --spot-price 0.000005 \
  --port 22:tcp

# Mit Umgebungsvariablen
clore deploy 123 \
  --image cloreai/ubuntu22.04-cuda12 \
  --type on-demand \
  --currency bitcoin \
  --ssh-password MyPass123 \
  --port 22:tcp \
  --env WANDB_API_KEY=your_key \
  --env HF_TOKEN=your_token
```

**Argumente:**

| Argument    | Beschreibung                                       |
| ----------- | -------------------------------------------------- |
| `server_id` | Server-ID zum Mieten (erhalten von `clore search`) |

**Optionen:**

| Option           | Typ     | Erforderlich | Beschreibung                                            |
| ---------------- | ------- | ------------ | ------------------------------------------------------- |
| `--image`        | Text    | Ja           | Docker-Image (z. B. `cloreai/ubuntu22.04-cuda12`)       |
| `--type`         | Auswahl | Ja           | `on-demand` oder `spot`                                 |
| `--currency`     | Text    | Ja           | Zahlungswährung (z. B. `bitcoin`)                       |
| `--ssh-password` | Text    | Nein         | SSH-Passwort (alphanumerisch, max. 32 Zeichen)          |
| `--ssh-key`      | Text    | Nein         | SSH-Public-Key                                          |
| `--port`         | Text    | Nein         | Port-Mapping (wiederholbar), Format: `PORT:PROTOKOLL`   |
| `--env`          | Text    | Nein         | Umgebungsvariable (wiederholbar), Format: `KEY=VALUE`   |
| `--spot-price`   | float   | Nein         | Spot-Preis pro Tag (erforderlich für Spot-Bestellungen) |

***

### `clore orders`

Ihre aktiven Bestellungen auflisten.

```bash
# Aktive Bestellungen
clore orders

# Abgeschlossene/abgelaufene Bestellungen einbeziehen
clore orders --completed
```

**Optionen:**

| Option        | Beschreibung                                        |
| ------------- | --------------------------------------------------- |
| `--completed` | Abgeschlossene/abgelaufene Bestellungen einbeziehen |

**Beispielausgabe:**

```
📦 Meine Bestellungen
┏━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ID ┃ Server ID ┃ Typ       ┃ Status ┃ Image                             ┃ IP                      ┃
┡━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 38 │ 6         │ on-demand │ Aktiv  │ cloreai/ubuntu22.04-cuda12        │ n1.c1.clorecloud.net    │
└────┴───────────┴───────────┴────────┴───────────────────────────────────┴─────────────────────────┘
Insgesamt: 1 Bestellung
```

***

### `clore cancel <order_id>`

Eine aktive Bestellung stornieren.

```bash
# Bestellung stornieren
clore cancel 38

# Mit Fehlerbericht stornieren
clore cancel 38 --issue "GPU wurde überhitzt"
```

**Argumente:**

| Argument   | Beschreibung              |
| ---------- | ------------------------- |
| `order_id` | Bestell-ID zum Stornieren |

**Optionen:**

| Option    | Beschreibung                      |
| --------- | --------------------------------- |
| `--issue` | Stornierungsgrund / Fehlerbericht |

***

### `clore ssh <order_id>`

Automatische Verbindung per SSH zu einer laufenden Bestellung. Die CLI löst Hostname und Port aus Ihren Bestelldaten auf.

```bash
# Als root verbinden (Standard)
clore ssh 38

# Als anderer Benutzer verbinden
clore ssh 38 --user ubuntu
```

**Argumente:**

| Argument   | Beschreibung                              |
| ---------- | ----------------------------------------- |
| `order_id` | Bestell-ID, mit der verbunden werden soll |

**Optionen:**

| Option   | Standard | Beschreibung     |
| -------- | -------- | ---------------- |
| `--user` | `root`   | SSH-Benutzername |

***

### `clore wallets`

Zeigen Sie Ihre Wallet-Salden und Einzahlungsadressen an.

```bash
clore wallets
```

**Beispielausgabe:**

```
💰 Wallet-Salden
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Währung          ┃ Saldo        ┃ Einzahlungsadresse                       ┃
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ bitcoin          │ 0.00153176   │ tb1q6erw7v02t7hakgmlcl4wfnlykzqj05alndruwr │
│ CLORE-Blockchain │ 150.00000000 │ cLr1q8x...                                │
└──────────────────┴──────────────┴───────────────────────────────────────────┘
```

***

### `clore servers`

Server auflisten, die Sie auf dem Marktplatz hosten.

```bash
clore servers
```

***

### `clore server-config <name>`

Die Konfiguration eines bestimmten Servers abrufen, den Sie hosten.

```bash
clore server-config "MyGPU"
```

**Beispielausgabe:**

```
Server: MyGPU
ID: 42
Verbunden: True
Online: True
Sichtbarkeit: public
Minimale Mietdauer: 72
GPUs: NVIDIA GeForce RTX 4090
On-Demand-Preis (USD): $0.35
Spot-Preis (USD): $0.18
CPU: AMD Ryzen 9 5900X 12-Core Prozessor
RAM: 64.0 GB
GPU: 1x NVIDIA GeForce RTX 4090
```

***

### `clore spot <server_id>`

Aktuelle Spotmarkt-Angebote für einen Server anzeigen.

```bash
clore spot 6
```

**Beispielausgabe:**

```
📊 Spotmarkt - Server 6
┏━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Bestell-ID ┃ Preis     ┃
┡━━━━━━━━━━╇━━━━━━━━━━━┩
│ 39       │ 4.2e-06   │
└──────────┴───────────┘
```

***

### `clore spot-price <order_id> <price>`

Den Preis Ihres Spotmarkt-Angebots aktualisieren.

```bash
clore spot-price 39 0.000003
```

> **Hinweis:** Sie können Spot-Preise nur alle 600 Sekunden senken und nur um eine begrenzte Schrittgröße.

***

### `clore config`

CLI-Konfiguration verwalten.

```bash
# API-Schlüssel setzen
clore config set api_key YOUR_API_KEY

# Einen Wert abrufen
clore config get api_key

# Alle Konfigurationen anzeigen
clore config show
```

Die Konfiguration wird gespeichert in `~/.clore/config.json`.

***

## Workflows

### Suchen → Mieten → SSH → Stornieren

Ein typischer End-to-End-Workflow:

```bash
# 1. Finden Sie eine RTX 4090 für unter $5/Stunde
clore search --gpu "RTX 4090" --max-price 5.0 --sort price --limit 5

# 2. Auf dem günstigsten Server bereitstellen (z. B. ID 123)
clore deploy 123 \
  --image cloreai/ubuntu22.04-cuda12 \
  --type on-demand \
  --currency bitcoin \
  --ssh-password MyPass123 \
  --port 22:tcp \
  --port 8888:http

# 3. Den Bestellstatus prüfen
clore orders

# 4. Per SSH in die Instanz (z. B. Bestell-ID 456)
clore ssh 456

# 5. Wenn fertig, die Bestellung stornieren
clore cancel 456
```

### Kontostände vor der Anmietung überwachen

```bash
# Prüfen Sie, ob Sie genügend Guthaben haben
clore wallets

# Suchen und mieten
clore search --gpu "A100" --sort price --limit 3
clore deploy 789 \
  --image cloreai/ubuntu22.04-cuda12 \
  --type on-demand \
  --currency bitcoin \
  --ssh-password SecurePass \
  --port 22:tcp
```

### Spotmarkt-Workflow

```bash
# 1. Spot-Angebote für einen Server prüfen
clore spot 6

# 2. Eine Spot-Bestellung erstellen
clore deploy 6 \
  --image cloreai/pytorch \
  --type spot \
  --currency bitcoin \
  --spot-price 0.000005 \
  --ssh-password MyPass123 \
  --port 22:tcp

# 3. Ihren Spot-Preis anpassen
clore spot-price 39 0.000003
```

### Verwaltung des Server-Hostings

```bash
# Ihre Server anzeigen
clore servers

# Die Konfiguration eines Servers prüfen
clore server-config "MyGPU"
```

***

## Nächste Schritte

* [**Python-SDK**](/clore.ai/clore.ai-eng-de/entwickler/python-sdk.md) — Workflows mit Python automatisieren
* [**REST-API**](/clore.ai/clore.ai-eng-de/fur-hosts/api.md) — Roh-API-Dokumentation
* [**On-Demand vs Spot**](/clore.ai/clore.ai-eng-de/fur-mieter/on-demand-vs-spot.md) — Preisgestaltungsmodelle verstehen


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clore.ai/clore.ai/clore.ai-eng-de/entwickler/cli-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
