> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/clore.ai/clore.ai-eng-de/entwickler/cli-guide.md).

# CLI-Referenz

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

***

## Installation

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

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

**Voraussetzungen:** Python 3.9+

***

## Konfiguration

### API-Schlüssel festlegen

Holen Sie Ihren Schlüssel aus dem [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 Konfiguration anzeigen
clore config show

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

***

## Befehle

| Befehl                                | Beschreibung                                   |
| ------------------------------------- | ---------------------------------------------- |
| `clore search`                        | GPU-Marktplatz durchsuchen                     |
| `clore deploy <server_id>`            | Neue Bestellung erstellen (Server mieten)      |
| `clore orders`                        | Bestellungen auflisten                         |
| `clore cancel <order_id>`             | Bestellung stornieren                          |
| `clore ssh <order_id>`                | Per SSH mit einer aktiven Bestellung verbinden |
| `clore wallets`                       | Wallet-Guthaben anzeigen                       |
| `clore servers`                       | Gehostete Server auflisten                     |
| `clore server-config <name>`          | Serverkonfiguration abrufen                    |
| `clore spot <server_id>`              | Spot-Markt für einen Server anzeigen           |
| `clore spot-price <order_id> <price>` | Spot-Preis festlegen                           |
| `clore config set <key> <value>`      | Konfigurationswert festlegen                   |
| `clore config get <key>`              | Konfigurationswert abrufen                     |
| `clore config show`                   | Gesamtkonfiguration anzeigen                   |
| `clore --version`                     | Version anzeigen                               |

***

## Detaillierte Verwendung

### `clore search`

GPU-Marktplatz mit Filtern und Sortierung durchsuchen.

```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 Maximalpreis filtern
clore search --gpu "RTX 4090" --max-price 5.0

# Multi-GPU-Systeme
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`   | Ganzzahl       | Mindestanzahl an GPUs                            |
| `--min-ram`   | Gleitkommazahl | Mindest-RAM in GB                                |
| `--max-price` | Gleitkommazahl | Maximaler Preis in USD/Stunde                    |
| `--sort`      | Auswahl        | Sortieren nach: `Preis` (Standard), `GPU`, `RAM` |
| `--limit`     | Ganzzahl       | Maximal anzuzeigende Ergebnisse (Standard: 20)   |

**Beispielausgabe:**

```
🔍 GPU-Marktplatz
┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ ID  ┃ GPU                             ┃ Count ┃ RAM (GB) ┃ CPU                          ┃ Price/h (USD) ┃ Location ┃
┡━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ 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>`

Neue Bestellung erstellen, 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 (abrufen 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         | Öffentlicher SSH-Schlüssel                                                                       |
| `--port`         | Text           | Nein         | Port-Zuordnung (mehrfach möglich), Format: `PORT:PROTOCOL`                                       |
| `--env`          | Text           | Nein         | Umgebungsvariable (mehrfach möglich), Format: `KEY=VALUE`                                        |
| `--spot-price`   | Gleitkommazahl | Nein         | Spot-Preis pro Tag (für Spot-Bestellungen erforderlich)                                          |
| `--gpu-count`    | Ganzzahl       | Nein         | Nur N GPUs mieten (Teilvermietung, nur On-Demand)                                                |
| `--gpu-indices`  | Text           | Nein         | Durch Kommas getrennte GPU-Slots aus `partial_gpu_rental.free_indices` (erfordert `--gpu-count`) |

***

### `clore orders`

Ihre aktiven Bestellungen auflisten.

```bash
# Aktive Bestellungen
clore orders

# Abgeschlossene/abgelaufene Bestellungen einschließen
clore orders --completed
```

**Optionen:**

| Option        | Beschreibung                                         |
| ------------- | ---------------------------------------------------- |
| `--completed` | Abgeschlossene/abgelaufene Bestellungen einschließen |

**Beispielausgabe:**

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

***

### `clore cancel <order_id>`

Eine aktive Bestellung stornieren.

```bash
# Bestellung stornieren
clore cancel 38

# Stornieren mit Problembericht
clore cancel 38 --issue "GPU was overheating"
```

**Argumente:**

| Argument     | Beschreibung               |
| ------------ | -------------------------- |
| `Bestell-ID` | Zu stornierende Bestell-ID |

**Optionen:**

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

***

### `clore ssh <order_id>`

Automatische Verbindung per SSH zu einer laufenden Bestellung. Die CLI löst den Hostnamen und den Port aus Ihren Bestelldetails auf.

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

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

**Argumente:**

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

**Optionen:**

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

***

### `clore wallets`

Zeigen Sie Ihre Wallet-Guthaben und Einzahlungsadressen an.

```bash
clore wallets
```

**Beispielausgabe:**

```
💰 Wallet-Guthaben
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Währung         ┃ Guthaben     ┃ 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 von Ihnen gehosteten Servers abrufen.

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

**Beispielausgabe:**

```
Server: MyGPU
ID: 42
Verbunden: Wahr
Online: Wahr
Sichtbarkeit: öffentlich
Maximale 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 Spot-Marktangebote für einen Server anzeigen.

```bash
clore spot 6
```

**Beispielausgabe:**

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

***

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

Preis Ihres Spot-Marktangebots aktualisieren.

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

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

***

### `clore config`

CLI-Konfiguration verwalten.

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

# Einen Wert abrufen
clore config get api_key

# Alle Konfiguration 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. Eine RTX 4090 unter 5 $/Stunde finden
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 Status Ihrer Bestellung prüfen
clore orders

# 4. Per SSH mit der Instanz verbinden (z. B. Bestell-ID 456)
clore ssh 456

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

### Guthaben vor dem Mieten ü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
```

### Spot-Markt-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
```

### Server-Hosting-Verwaltung

```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) — Rohdokumentation der API
* [**On-Demand vs. Spot**](/clore.ai/clore.ai-eng-de/fur-mieter/on-demand-vs-spot.md) — Preismodelle verstehen


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
