首页龙虾技能列表 › Hetzner Cloud CLI — 技能工具

Hetzner Cloud CLI — 技能工具

v1.0.0

[自动翻译] Manage Hetzner Cloud infrastructure using the hcloud CLI. Use when working with Hetzner servers, firewalls, networks, volumes, load balancers, or any ...

0· 650·2 当前·2 累计
by @jpj069 (Jens Jung)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/2/26
安全扫描
VirusTotal
无害
查看报告
OpenClaw
可疑
medium confidence
The skill's instructions match its stated purpose (managing Hetzner via the hcloud CLI), but the metadata omits the obvious credential requirement and the runtime install steps ask the user to run privileged actions — those inconsistencies warrant caution.
评估建议
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 so...
详细分析 ▾
用途与能力
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.
指令范围
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.
安装机制
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.
凭证需求
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.
持久化与权限
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.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/2/20

Initial release: Complete hcloud CLI reference with server management, firewalls, SSH keys, volumes, networks, and load balancers

● 无害

安装命令 点击复制

官方npx clawhub@latest install hcloud
镜像加速npx clawhub@latest install hcloud --registry https://cn.clawhub-mirror.com

技能文档

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 <

[[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

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

# Start/stop/reboot hcloud server start hcloud server stop hcloud server reboot

# Delete server hcloud server delete

# SSH into server hcloud server ssh

# Run command on server hcloud server ssh -- 'uname -a'

Firewalls

# List firewalls
hcloud firewall list

# Get firewall details hcloud firewall describe

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

# Add rule to firewall hcloud firewall add-rule \ --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 \ --type server \ --server

# Remove firewall from server hcloud firewall remove-from-resource \ --type server \ --server

# Delete firewall hcloud firewall delete

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

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

# Detach volume hcloud volume detach

# Delete volume hcloud volume delete

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 \ --type cloud \ --network-zone eu-central \ --ip-range 10.0.1.0/24

# Attach server to network hcloud server attach-to-network \ --network

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 \ --server

# Add service hcloud load-balancer add-service \ --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

TypevCPURAMDiskPrice/mo (approx)
cx1112 GB20 GB€4
cx2124 GB40 GB€6
cx2224 GB40 GB€6 (deprecated)
cx2324 GB40 GB€3
cx3128 GB80 GB€10
cx3348 GB80 GB€5
cpx1122 GB40 GB€5
cpx2134 GB80 GB€10
cpx3148 GB160 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

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务