CLI Automation

Automate GPU rentals with the clore CLI — bash scripts, CI/CD pipelines, monitoring, and batch operations

circle-check

Basic Workflow

The core loop: search → deploy → connect → cancel.

# 1. Find a GPU
clore search --gpu "RTX 4090" --max-price 2.0 --sort price --limit 5

# 2. Deploy (use a server ID from step 1)
clore deploy 142 \
  --image cloreai/ubuntu22.04-cuda12 \
  --type on-demand \
  --currency bitcoin \
  --ssh-password MySecurePass \
  --port 22:tcp \
  --port 8888:http

# 3. Check your orders
clore orders

# 4. SSH into the server
clore ssh 38

# 5. Cancel when done
clore cancel 38

# 6. Check wallet balance
clore wallets

CLI Command Reference

Command
Description

clore search

Search GPU marketplace

clore deploy <server_id>

Create a new order

clore orders

List active orders

clore orders --completed

List all orders including completed

clore ssh <order_id>

SSH into an active order

clore cancel <order_id>

Cancel an order

clore wallets

Show wallet balances

clore servers

List your hosted servers

clore server-config <name>

Show server configuration

clore spot <server_id>

View spot market for a server

clore spot-price <order_id> <price>

Set spot price for an order

clore config set <key> <value>

Set config value

clore config get <key>

Get config value

clore config show

Show all config


Scripting with CLI

Deploy and Wait for SSH

Find Cheapest GPU and Deploy

Cancel All Orders


CI/CD Integration

GitHub Actions: Deploy GPU for Training

GitLab CI: Batch Processing


Monitoring

Check Orders Periodically

Python Monitoring Script


Batch Operations

Deploy on Multiple Servers

Batch Deploy with Python (Async)

Usage:

Spot Market Scanner


Cron Jobs

Daily GPU Price Check

Hourly Balance Check


Tips

  1. Always set CLORE_API_KEY as an environment variable in scripts and CI

  2. Add sleep 6 between deploy commands in bash loops to respect rate limits

  3. Use --type spot for batch/CI jobs — cheaper and interruptible is fine

  4. Cancel orders in after_script / if: always() to avoid forgotten billing

  5. Store SSH passwords in secrets (GitHub Secrets, GitLab CI Variables, etc.)

  6. Use clore orders --completed to audit past usage


Next Steps

Last updated

Was this helpful?