KosmoKrator

productivity

Hetzner Cloud CLI for AI Agents

Use the Hetzner Cloud CLI from KosmoKrator to call Hetzner Cloud tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Bearer token auth

Hetzner Cloud CLI Setup

Hetzner Cloud can be configured headlessly with `kosmokrator integrations:configure hetzner`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure hetzner --set access_token="$HETZNER_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor hetzner --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token HETZNER_ACCESS_TOKEN Secret secret yes API Token
url HETZNER_URL URL url no API Base URL

Call Hetzner Cloud Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call hetzner.hetzner_list_servers '{
  "per_page": 1,
  "page": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:hetzner hetzner_list_servers '{
  "per_page": 1,
  "page": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs hetzner --json
kosmo integrations:docs hetzner.hetzner_list_servers --json
kosmo integrations:schema hetzner.hetzner_list_servers --json
kosmo integrations:search "Hetzner Cloud" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Hetzner Cloud.

hetzner.hetzner_list_servers

Read read

List Hetzner Cloud servers. Supports pagination with per_page and page parameters.

Parameters
per_page, page

Generic CLI call

kosmo integrations:call hetzner.hetzner_list_servers '{"per_page":1,"page":1}' --json

Provider shortcut

kosmo integrations:hetzner hetzner_list_servers '{"per_page":1,"page":1}' --json

hetzner.hetzner_get_server

Read read

Get details for a specific Hetzner Cloud server by ID.

Parameters
id

Generic CLI call

kosmo integrations:call hetzner.hetzner_get_server '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:hetzner hetzner_get_server '{"id":"example_id"}' --json

hetzner.hetzner_create_server

Write write

Create a new Hetzner Cloud server with specified name, type, and image.

Parameters
name, server_type, image, location, ssh_keys, networks, labels, user_data

Generic CLI call

kosmo integrations:call hetzner.hetzner_create_server '{"name":"example_name","server_type":"example_server_type","image":"example_image","location":"example_location","ssh_keys":"example_ssh_keys","networks":"example_networks","labels":"example_labels","user_data":"example_user_data"}' --json

Provider shortcut

kosmo integrations:hetzner hetzner_create_server '{"name":"example_name","server_type":"example_server_type","image":"example_image","location":"example_location","ssh_keys":"example_ssh_keys","networks":"example_networks","labels":"example_labels","user_data":"example_user_data"}' --json

hetzner.hetzner_list_volumes

Read read

List Hetzner Cloud volumes. Supports pagination with per_page and page parameters.

Parameters
per_page, page

Generic CLI call

kosmo integrations:call hetzner.hetzner_list_volumes '{"per_page":1,"page":1}' --json

Provider shortcut

kosmo integrations:hetzner hetzner_list_volumes '{"per_page":1,"page":1}' --json

hetzner.hetzner_list_networks

Read read

List Hetzner Cloud networks. Supports pagination with per_page and page parameters.

Parameters
per_page, page

Generic CLI call

kosmo integrations:call hetzner.hetzner_list_networks '{"per_page":1,"page":1}' --json

Provider shortcut

kosmo integrations:hetzner hetzner_list_networks '{"per_page":1,"page":1}' --json

hetzner.hetzner_list_ssh_keys

Read read

List Hetzner Cloud SSH keys. Supports pagination with per_page and page parameters.

Parameters
per_page, page

Generic CLI call

kosmo integrations:call hetzner.hetzner_list_ssh_keys '{"per_page":1,"page":1}' --json

Provider shortcut

kosmo integrations:hetzner hetzner_list_ssh_keys '{"per_page":1,"page":1}' --json

hetzner.hetzner_get_current_user

Read read

Get the profile of the currently authenticated Hetzner Cloud user. Useful for verifying credentials and displaying account information.

Parameters
none

Generic CLI call

kosmo integrations:call hetzner.hetzner_get_current_user '{}' --json

Provider shortcut

kosmo integrations:hetzner hetzner_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

hetzner.hetzner_list_servers

List Hetzner Cloud servers. Supports pagination with per_page and page parameters.

Operation
Read read
Schema command
kosmo integrations:schema hetzner.hetzner_list_servers --json
ParameterTypeRequiredDescription
per_page integer no Number of servers per page (default: 25).
page integer no Page number for pagination (1-indexed, default: 1).

hetzner.hetzner_get_server

Get details for a specific Hetzner Cloud server by ID.

Operation
Read read
Schema command
kosmo integrations:schema hetzner.hetzner_get_server --json
ParameterTypeRequiredDescription
id string yes The server ID.

hetzner.hetzner_create_server

Create a new Hetzner Cloud server with specified name, type, and image.

Operation
Write write
Schema command
kosmo integrations:schema hetzner.hetzner_create_server --json
ParameterTypeRequiredDescription
name string yes Server name (must be unique per project).
server_type string yes Server type name or ID (e.g., "cx22", "cx32").
image string yes Image name or ID (e.g., "ubuntu-24.04", "debian-12").
location string no Location name (e.g., "fsn1", "nbg1", "hel1"). Optional if datacenter is set.
ssh_keys array no Array of SSH key names or IDs to inject into the server.
networks array no Array of network IDs to attach the server to.
labels object no Key-value labels to apply to the server.
user_data string no Cloud-init user data (YAML) for server initialization.

hetzner.hetzner_list_volumes

List Hetzner Cloud volumes. Supports pagination with per_page and page parameters.

Operation
Read read
Schema command
kosmo integrations:schema hetzner.hetzner_list_volumes --json
ParameterTypeRequiredDescription
per_page integer no Number of volumes per page (default: 25).
page integer no Page number for pagination (1-indexed, default: 1).

hetzner.hetzner_list_networks

List Hetzner Cloud networks. Supports pagination with per_page and page parameters.

Operation
Read read
Schema command
kosmo integrations:schema hetzner.hetzner_list_networks --json
ParameterTypeRequiredDescription
per_page integer no Number of networks per page (default: 25).
page integer no Page number for pagination (1-indexed, default: 1).

hetzner.hetzner_list_ssh_keys

List Hetzner Cloud SSH keys. Supports pagination with per_page and page parameters.

Operation
Read read
Schema command
kosmo integrations:schema hetzner.hetzner_list_ssh_keys --json
ParameterTypeRequiredDescription
per_page integer no Number of SSH keys per page (default: 25).
page integer no Page number for pagination (1-indexed, default: 1).

hetzner.hetzner_get_current_user

Get the profile of the currently authenticated Hetzner Cloud user. Useful for verifying credentials and displaying account information.

Operation
Read read
Schema command
kosmo integrations:schema hetzner.hetzner_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.