Skip to content

Hetzner Cloud

Clanker supports querying and managing Hetzner Cloud infrastructure using the hcloud CLI.


Authentication

Hetzner Cloud authentication requires an API token.

Obtaining a token

  1. Log in to the Hetzner Cloud Console.
  2. Select your project.
  3. Navigate to Security > API Tokens.
  4. Generate a new token with Read or Read/Write permissions.

Configuration

Add your API token to ~/.clanker.yaml:

yaml
hetzner:
  api_token: "abc123..."

Alternatively, use an environment variable:

bash
export HCLOUD_TOKEN="abc123..."

Token resolution order

  1. hetzner.api_token in the config file
  2. HCLOUD_TOKEN environment variable

Prerequisites

The hcloud CLI must be installed and available on your PATH:

bash
# macOS
brew install hcloud

# Linux
# Download from https://github.com/hetznercloud/cli/releases

# Verify
hcloud version

Clanker passes the API token to hcloud via the HCLOUD_TOKEN environment variable, so you do not need to configure hcloud separately.


Querying Hetzner

Explicit flag

bash
clanker ask --hetzner "What servers are running?"

Automatic routing

If your question mentions Hetzner-specific terms, Clanker routes to Hetzner automatically:

bash
clanker ask "List my Hetzner cloud servers"

Supported Services

Clanker queries Hetzner Cloud services through hcloud. Commonly queried resources include:

  • Servers (virtual machines)
  • Load Balancers
  • Volumes
  • Firewalls
  • Networks (private networking)
  • Floating IPs
  • SSH Keys
  • Images and Snapshots
  • Placement Groups

Maker Pipeline

The maker feature supports Hetzner Cloud infrastructure provisioning:

bash
# Generate a plan
clanker ask --maker --hetzner "Create a server called web-01 with type cx22 in fsn1"

# Apply the plan
clanker ask --apply --plan-file plan.json

Retry Behavior

Clanker includes automatic retry logic for hcloud commands with backoff delays (200ms, 500ms, 1200ms) to handle transient API errors gracefully.