← 返回 Skills 市场
jpj069

Hetzner Cloud CLI

作者 Jens Jung · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
730
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install hcloud
功能描述
Manage Hetzner Cloud infrastructure using the hcloud CLI. Use when working with Hetzner servers, firewalls, networks, volumes, load balancers, or any Hetzner...
使用说明 (SKILL.md)

Hetzner Cloud CLI (hcloud)

Manage Hetzner Cloud infrastructure with the official CLI tool.

Prerequisites

Installation (if not already installed):

# Detect architecture
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
  URL="https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-arm64.tar.gz"
else
  URL="https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz"
fi

# Install
cd /tmp
wget -q "$URL"
tar xzf hcloud-linux-*.tar.gz
sudo mv hcloud /usr/local/bin/
chmod +x /usr/local/bin/hcloud

Configuration (first time):

mkdir -p ~/.config/hcloud
cat > ~/.config/hcloud/cli.toml \x3C\x3CEOF
active_context = "default"

[[contexts]]
name = "default"
token = "YOUR_HETZNER_API_TOKEN"
EOF
chmod 600 ~/.config/hcloud/cli.toml

Verify:

hcloud version
hcloud server list

Common Commands

Servers

# List servers
hcloud server list

# Get server details
hcloud server describe \x3Cname-or-id>

# Create server
hcloud server create \
  --name my-server \
  --type cx11 \
  --image ubuntu-24.04 \
  --ssh-key \x3Ckey-id-or-name> \
  --location nbg1

# Start/stop/reboot
hcloud server start \x3Cname-or-id>
hcloud server stop \x3Cname-or-id>
hcloud server reboot \x3Cname-or-id>

# Delete server
hcloud server delete \x3Cname-or-id>

# SSH into server
hcloud server ssh \x3Cname-or-id>

# Run command on server
hcloud server ssh \x3Cname-or-id> -- 'uname -a'

Firewalls

# List firewalls
hcloud firewall list

# Get firewall details
hcloud firewall describe \x3Cname-or-id>

# Create firewall
hcloud firewall create \
  --name my-firewall \
  --rules-file rules.json

# Add rule to firewall
hcloud firewall add-rule \x3Cname-or-id> \
  --direction in \
  --port 22 \
  --protocol tcp \
  --source-ips 0.0.0.0/0 \
  --source-ips ::/0 \
  --description "SSH"

# Apply firewall to server
hcloud firewall apply-to-resource \x3Cfirewall-name> \
  --type server \
  --server \x3Cserver-name-or-id>

# Remove firewall from server
hcloud firewall remove-from-resource \x3Cfirewall-name> \
  --type server \
  --server \x3Cserver-name-or-id>

# Delete firewall
hcloud firewall delete \x3Cname-or-id>

SSH Keys

# List SSH keys
hcloud ssh-key list

# Add SSH key
hcloud ssh-key create \
  --name my-key \
  --public-key-from-file ~/.ssh/id_ed25519.pub

# Delete SSH key
hcloud ssh-key delete \x3Cname-or-id>

Server Types & Images

# List available server types
hcloud server-type list

# List available images
hcloud image list
hcloud image list --type system  # Only system images

# List locations
hcloud location list

Volumes

# List volumes
hcloud volume list

# Create volume
hcloud volume create \
  --name my-volume \
  --size 10 \
  --location nbg1

# Attach volume to server
hcloud volume attach \x3Cvolume-name> \x3Cserver-name>

# Detach volume
hcloud volume detach \x3Cvolume-name>

# Delete volume
hcloud volume delete \x3Cvolume-name>

Networks

# List networks
hcloud network list

# Create network
hcloud network create \
  --name my-network \
  --ip-range 10.0.0.0/16

# Add subnet
hcloud network add-subnet \x3Cnetwork-name> \
  --type cloud \
  --network-zone eu-central \
  --ip-range 10.0.1.0/24

# Attach server to network
hcloud server attach-to-network \x3Cserver-name> \
  --network \x3Cnetwork-name>

Load Balancers

# List load balancers
hcloud load-balancer list

# Create load balancer
hcloud load-balancer create \
  --name my-lb \
  --type lb11 \
  --location nbg1

# Add target (server)
hcloud load-balancer add-target \x3Clb-name> \
  --server \x3Cserver-name>

# Add service
hcloud load-balancer add-service \x3Clb-name> \
  --protocol http \
  --listen-port 80 \
  --destination-port 80

Firewall Rules Format

For complex firewall rules, use JSON:

[
  {
    "direction": "in",
    "port": "22",
    "protocol": "tcp",
    "source_ips": ["0.0.0.0/0", "::/0"],
    "description": "SSH"
  },
  {
    "direction": "in",
    "port": "80",
    "protocol": "tcp",
    "source_ips": ["0.0.0.0/0", "::/0"],
    "description": "HTTP"
  },
  {
    "direction": "in",
    "port": "443",
    "protocol": "tcp",
    "source_ips": ["0.0.0.0/0", "::/0"],
    "description": "HTTPS"
  },
  {
    "direction": "in",
    "protocol": "icmp",
    "source_ips": ["0.0.0.0/0", "::/0"],
    "description": "ICMP (ping)"
  }
]

Common Server Types

Type vCPU RAM Disk Price/mo (approx)
cx11 1 2 GB 20 GB €4
cx21 2 4 GB 40 GB €6
cx22 2 4 GB 40 GB €6 (deprecated)
cx23 2 4 GB 40 GB €3
cx31 2 8 GB 80 GB €10
cx33 4 8 GB 80 GB €5
cpx11 2 2 GB 40 GB €5
cpx21 3 4 GB 80 GB €10
cpx31 4 8 GB 160 GB €18

cx series: Shared vCPU (cost-optimized)
cpx series: Dedicated vCPU (performance-optimized)

Tips

  • Use --output json for parsing: hcloud server list --output json | jq
  • Context switching: Create multiple contexts in ~/.config/hcloud/cli.toml for different projects/accounts
  • Server labels: Use labels for organization: --labels environment=production,project=web
  • Default location: Set default location to avoid specifying: hcloud context config default-location nbg1
  • Dry run: Many commands support --dry-run or --validate flags

Documentation

Official docs: https://docs.hetzner.cloud/ GitHub: https://github.com/hetznercloud/cli

安全使用建议
This skill appears to be a straightforward guide for the official Hetzner hcloud CLI, but note two issues before installing: (1) the SKILL.md expects you to provide a Hetzner API token (it tells you to put it in ~/.config/hcloud/cli.toml) even though the registry metadata lists no required credential — treat that as a required secret. (2) The install steps download a binary from the project's GitHub releases and move it into /usr/local/bin using sudo — only run those commands if you trust the source and understand you are giving the installer elevated privileges. Recommendations: verify the download URL and upstream project, prefer your OS package manager or vendor-signed release when available, create and use a least-privilege Hetzner token, set tight permissions on the config file, avoid pasting tokens into untrusted prompts, and review any commands that delete or modify cloud resources (they can irreversibly destroy servers/volumes). If the registry metadata could be updated to declare the Hetzner API token as a required credential, that would remove the primary inconsistency and increase confidence.
功能分析
Type: OpenClaw Skill Name: hcloud Version: 1.0.0 The skill bundle is benign. It provides instructions for installing and using the official Hetzner Cloud CLI (`hcloud`). The installation process involves downloading the `hcloud` executable from its official GitHub repository (`github.com/hetznercloud/cli`) using `wget` and installing it system-wide with `sudo`. While these actions involve network access and elevated privileges, they are standard and necessary for installing a CLI tool and are directly aligned with the skill's stated purpose of managing Hetzner Cloud infrastructure. There is no evidence of prompt injection, data exfiltration, persistence mechanisms, or other malicious intent. All commands demonstrated are legitimate `hcloud` CLI operations.
能力评估
Purpose & Capability
Name, description, and the SKILL.md all consistently describe using the official hcloud CLI to manage Hetzner resources (servers, firewalls, volumes, networks, load balancers). The commands and examples shown are coherent with that purpose.
Instruction Scope
The runtime instructions include a full install snippet that downloads a GitHub release archive, extracts a binary, and moves it to /usr/local/bin (uses sudo). They also instruct creating ~/.config/hcloud/cli.toml containing the Hetzner API token and reference ~/.ssh/id_ed25519.pub for SSH-key upload. These are typical for installing/using the hcloud CLI, but they require elevated privileges (sudo) and writing a credential file in the user's home directory — both are operationally sensitive and should be executed only after verification.
Install Mechanism
There is no formal install spec in the registry (instruction-only), but SKILL.md shows downloading from GitHub releases (github.com/hetznercloud/cli/releases/latest/download/...). Using the project's official GitHub releases is reasonable; however the script installs a binary into a system path with sudo and uses the 'latest' redirect which can change over time. No obscure URLs or shorteners are used.
Credentials
The skill metadata declares no required environment variables or primary credential, yet the instructions require a Hetzner API token to be placed in ~/.config/hcloud/cli.toml. That token is necessary and appropriate for the skill's function, but its omission from the declared requirements is an inconsistency that can mislead users about secrets the skill needs. The other referenced files (public SSH key) are relevant and proportionate.
Persistence & Privilege
The skill is not marked 'always' and is user-invocable only. It does not request persistent platform privileges. However, the provided install instructions require sudo to write a binary into /usr/local/bin which is a privileged action — normal for CLI installs but worth highlighting as a risk if you blindly run the commands.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hcloud
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hcloud 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Complete hcloud CLI reference with server management, firewalls, SSH keys, volumes, networks, and load balancers
元数据
Slug hcloud
版本 1.0.0
许可证
累计安装 2
当前安装数 2
历史版本数 1
常见问题

Hetzner Cloud CLI 是什么?

Manage Hetzner Cloud infrastructure using the hcloud CLI. Use when working with Hetzner servers, firewalls, networks, volumes, load balancers, or any Hetzner... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 730 次。

如何安装 Hetzner Cloud CLI?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install hcloud」即可一键安装,无需额外配置。

Hetzner Cloud CLI 是免费的吗?

是的,Hetzner Cloud CLI 完全免费(开源免费),可自由下载、安装和使用。

Hetzner Cloud CLI 支持哪些平台?

Hetzner Cloud CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Hetzner Cloud CLI?

由 Jens Jung(@jpj069)开发并维护,当前版本 v1.0.0。

💬 留言讨论