### Install hcloud CLI via Go Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Install the CLI directly from source using the Go toolchain. ```bash go install github.com/hetznercloud/cli/cmd/hcloud@latest ``` -------------------------------- ### List Load Balancers Source: https://context7.com/hetznercloud/cli/llms.txt Lists all configured load balancers. Includes example output. ```bash # List load balancers hcloud load-balancer list # Output: # ID NAME IPV4 IPV6 TYPE LOCATION NETWORK ZONE # 1234567 web-lb 195.201.x.x 2a01:4f8:c17:xxxx::1 lb11 fsn1 eu-central ``` -------------------------------- ### Install hcloud CLI Source: https://context7.com/hetznercloud/cli/llms.txt Install the hcloud CLI using Homebrew, Go, Docker, or by downloading binaries. Configure authentication with your API token. ```bash # Install via Homebrew (macOS/Linux) brew install hcloud ``` ```bash # Or install via Go go install github.com/hetznercloud/cli/cmd/hcloud@latest ``` ```bash # Or download and install manually (Linux amd64) curl -sSLO https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz sudo tar -C /usr/local/bin --no-same-owner -xzf hcloud-linux-amd64.tar.gz hcloud ``` ```bash # Or run via Docker docker run --rm -e HCLOUD_TOKEN="" hetznercloud/cli:latest server list ``` ```bash # Create a context with your API token hcloud context create my-project # Enter your API token when prompted ``` ```bash # Verify installation hcloud datacenter list ``` -------------------------------- ### Install hcloud CLI via manual binary Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Download and extract the pre-built binary for 64-bit Linux systems. ```bash curl -sSLO https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz sudo tar -C /usr/local/bin --no-same-owner -xzf hcloud-linux-amd64.tar.gz hcloud rm hcloud-linux-amd64.tar.gz ``` -------------------------------- ### Install hcloud CLI via Windows package managers Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Install the CLI on Windows using WinGet or Scoop. ```bash winget install HetznerCloud.CLI ``` ```bash scoop install hcloud ``` -------------------------------- ### Verify Hetzner Cloud CLI Setup Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Run this command to list available datacenters and verify that the hcloud CLI is working correctly. Successful execution will display a list of datacenters. ```bash hcloud datacenter list ``` -------------------------------- ### Zsh Completion Setup Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_completion.md To load Zsh completions, first create a directory for them, then generate the completion file, and finally update your .zshrc to include the new completion path before calling compinit. ```zsh mkdir -p ~/.config/hcloud/completion/zsh hcloud completion zsh > ~/.config/hcloud/completion/zsh/_hcloud ``` ```zsh fpath+=(~/.config/hcloud/completion/zsh) ``` ```zsh autoload -Uz compinit; compinit ``` -------------------------------- ### Fish Completion Setup Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_completion.md To load completions into the current Fish shell, pipe the output of the completion command to 'source'. To make them permanent, redirect the output to a file in the Fish completions directory. ```fish hcloud completion fish | source ``` ```fish hcloud completion fish > ~/.config/fish/completions/hcloud.fish ``` -------------------------------- ### GET /all/list Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_all_list.md Lists all resources in the project including servers, images, volumes, and more. ```APIDOC ## GET hcloud all list ### Description List all resources in the project. This does not include static/public resources like Locations, public ISOs, etc. ### Options - **-o, --output** (stringArray) - Optional - Output format: json|yaml - **--paid** (boolean) - Optional - Only list resources that cost money - **-l, --selector** (string) - Optional - Selector to filter by labels ### Request Example hcloud all list --output json --paid=true ``` -------------------------------- ### Install hcloud CLI via .deb package Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Install the experimental Debian package on Debian or Ubuntu-based distributions. ```bash # Download the package (replace with the actual version and architecture) curl -sSLO https://github.com/hetznercloud/cli/releases/latest/download/hcloud-cli__linux_amd64.deb # Install the package sudo dpkg -i hcloud-cli__linux_amd64.deb ``` -------------------------------- ### Install hcloud CLI via .rpm package Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Install the experimental RPM package on Fedora, RHEL, or CentOS distributions. ```bash # Download the package (replace with the actual version and architecture) curl -sSLO https://github.com/hetznercloud/cli/releases/latest/download/hcloud-cli--1.x86_64.rpm # Install using dnf (Fedora/RHEL 8+/CentOS 8+) sudo dnf install hcloud-cli--1.x86_64.rpm # Or install using rpm sudo rpm -i hcloud-cli--1.x86_64.rpm ``` -------------------------------- ### Bash Completion Setup Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_completion.md To load completions into the current Bash shell, execute this command. Append it to your .bashrc to make completions permanent. ```bash source <(hcloud completion bash) ``` -------------------------------- ### Example Records File Content Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_zone_add-records.md This is an example of the JSON file format required when using the --records-file option. Each object in the array represents a record with its value and an optional comment. ```json [ { "value": "198.51.100.1", "comment": "My web server at Hetzner Cloud." }, { "value": "198.51.100.2", "comment": "My other server at Hetzner Cloud." } ] ``` -------------------------------- ### List Floating IPs Source: https://context7.com/hetznercloud/cli/llms.txt Lists all created floating IP addresses. Includes example output. ```bash # List floating IPs hcloud floating-ip list # Output: # ID TYPE NAME IP SERVER LOCATION # 1234567 ipv4 web-ip 195.201.x.x - fsn1 ``` -------------------------------- ### JSON Primary Nameservers Configuration Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_zone_change-primary-nameservers.md Example structure for the JSON file defining new primary nameservers, including optional port and TSIG authentication settings. ```json [ { "address": "203.0.113.10" }, { "address": "203.0.113.11", "port": 5353 }, { "address": "203.0.113.12", "tsig_algorithm": "hmac-sha256", "tsig_key": "example-key" } ] ``` -------------------------------- ### Get Server Cores with Go Template Source: https://github.com/hetznercloud/cli/blob/main/docs/guides/using-output-options.md Utilize the Go string template format with the --output format flag to extract specific data points, like the number of CPU cores for a server, directly from the command output. ```bash $ hcloud server describe my-server --output '{{.ServerType.Cores}}' 2 ``` -------------------------------- ### Help Option Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_enable-backup.md Displays help information for the enable-backup command. ```bash -h, --help help for enable-backup ``` -------------------------------- ### Get Load Balancer Metrics Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer_metrics.md Use this command to retrieve metrics for a specific load balancer. Specify the desired metric types and optionally set start and end times. The output can be formatted as JSON or YAML. ```bash hcloud load-balancer metrics [options] (--type )... ``` -------------------------------- ### GET hcloud config get Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_config_get.md Retrieves a specific configuration value from the CLI configuration. ```APIDOC ## GET hcloud config get ### Description Retrieves a configuration value based on the provided key. ### Endpoint hcloud config get ### Parameters #### Path Parameters - **key** (string) - Required - The configuration key to retrieve. #### Options - **--allow-sensitive** (boolean) - Optional - Allow showing sensitive values. - **--global** (boolean) - Optional - Get the value globally. - **-h, --help** (boolean) - Optional - Help for get. ### Request Example hcloud config get active_context ### Response Returns the value associated with the specified key. ``` -------------------------------- ### Help option Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_config_add.md Displays help information for the 'add' command. ```bash -h, --help help for add ``` -------------------------------- ### List all resources command syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_all_list.md Basic usage pattern for listing all resources in the project. ```bash hcloud all list [options] ``` -------------------------------- ### Create a Server Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/create-a-server.md Provisions a new server with specified name, type, image, and SSH key. The --ssh-key flag can be omitted if a default is set. ```bash hcloud server create --name my-server --type cpx22 --image ubuntu-24.04 --ssh-key my-ssh-key ``` -------------------------------- ### Install hcloud CLI via Homebrew Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Use the Homebrew package manager to install the CLI on Linux or macOS. ```bash brew install hcloud ``` -------------------------------- ### List all resources Source: https://context7.com/hetznercloud/cli/llms.txt Retrieve a list of all project resources with optional output formatting. ```bash hcloud all list ``` ```bash hcloud all list --output json ``` ```bash hcloud all list --output columns=resource,id,name,status ``` -------------------------------- ### GET /locations Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_location_list.md Lists all available locations in the Hetzner Cloud. ```APIDOC ## GET /locations ### Description Displays a list of available data center locations. Output can be formatted as a table, JSON, or YAML. ### Method GET ### Endpoint hcloud location list ### Parameters #### Options - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Response #### Success Response (200) - **city** (string) - City of the location - **country** (string) - Country of the location - **description** (string) - Human-readable description - **id** (integer) - Unique identifier - **latitude** (float) - Latitude coordinate - **longitude** (float) - Longitude coordinate - **name** (string) - Technical name of the location - **network_zone** (string) - Network zone ``` -------------------------------- ### List Available Images Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/create-a-server.md Fetches a list of all available operating system images that can be used to create a server. ```bash hcloud image list ``` -------------------------------- ### Enable Protection Help Options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_floating-ip_enable-protection.md Displays help information for the enable-protection command. ```bash -h, --help help for enable-protection ``` -------------------------------- ### GET /load-balancer/describe Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer_describe.md Describes a specific Load Balancer by its identifier. ```APIDOC ## GET hcloud load-balancer describe ### Description Retrieves detailed information about a specific Load Balancer. ### Method GET ### Endpoint hcloud load-balancer describe ### Parameters #### Path Parameters - **load-balancer** (string) - Required - The name or ID of the Load Balancer to describe. #### Options - **--expand-targets** (boolean) - Optional - Expand all label_selector targets. - **-o, --output** (stringArray) - Optional - Output format options: json|yaml|format. ``` -------------------------------- ### List configuration values Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_config_list.md Executes the command to display current configuration settings. ```bash hcloud config list ``` -------------------------------- ### GET /volumes Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_volume_list.md Lists all volumes associated with the account, with options for filtering and output formatting. ```APIDOC ## GET hcloud volume list ### Description Displays a list of Volumes. Output can be controlled with the -o flag to suppress headers, select specific columns, or change format to JSON/YAML. ### Method GET ### Endpoint hcloud volume list ### Parameters #### Options - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Request Example hcloud volume list --output json ### Response #### Success Response (200) - **age** (string) - Age of the volume - **created** (string) - Creation timestamp - **id** (integer) - Unique identifier - **labels** (map) - User-defined labels - **linux_device** (string) - Linux device path - **location** (string) - Location of the volume - **name** (string) - Name of the volume - **protection** (object) - Protection status - **server** (integer) - ID of the attached server - **size** (integer) - Size in GB - **status** (string) - Current status ``` -------------------------------- ### GET /storage-box Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_storage-box_list.md Lists all Storage Boxes with options for filtering, sorting, and output formatting. ```APIDOC ## GET storage-box list ### Description Displays a list of Storage Boxes. Output can be controlled with the -o flag to suppress headers or select specific columns. ### Method GET ### Endpoint hcloud storage-box list ### Parameters #### Options - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Available Columns - age - created - id - labels - location - name - server - size - status - system - type - username ``` -------------------------------- ### List server types command syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server-type_list.md Basic usage syntax for listing server types. ```bash hcloud server-type list [options] ``` -------------------------------- ### Describe SSH Key Source: https://context7.com/hetznercloud/cli/llms.txt Get detailed information about a specific SSH key by its name. ```bash hcloud ssh-key describe my-ssh-key ``` -------------------------------- ### Implement Experimental Feature Wrapper in Go Source: https://github.com/hetznercloud/cli/blob/main/CONTRIBUTING.md Use `base.ExperimentalWrapper` to mark features as experimental. Include the product name, maturity level, and a link to relevant documentation. ```go var ( ExperimentalProduct = ExperimentalWrapper("Product", "in beta", "https://docs.hetzner.cloud/changelog#new-product") ) func (c) CobraCommand(s state.State) *cobra.Command { cmd := &cobra.Command{ Use: "command", Short: "My experimental command", Long: "This is an experimental command.", PreRunE: s.EnsureToken, } cmd.Run = func(cmd *cobra.Command, _ []string) {} return ExperimentalProduct(s, cmd) } ``` -------------------------------- ### GET /zone/rrset Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_zone_rrset_list.md Lists all RRSets for a specified zone with options for filtering, sorting, and output formatting. ```APIDOC ## GET hcloud zone rrset list ### Description Displays a list of Zone RRSets for a given zone. Output format and column selection can be customized. ### Method GET ### Endpoint hcloud zone rrset list [options] ### Parameters #### Path Parameters - **zone** (string) - Required - The identifier or name of the zone to list RRSets for. #### Query Parameters - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result - **--type** (strings) - Optional - Only Zone RRSets with one of these types are displayed ### Request Example hcloud zone rrset list my-zone --type A ### Response #### Success Response (200) - **id** (string) - Unique identifier - **labels** (map) - User-defined labels - **name** (string) - Name of the RRSet - **protection** (boolean) - Protection status - **records** (array) - List of records - **ttl** (integer) - Time to live - **type** (string) - Record type ``` -------------------------------- ### Command Options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_create-image.md Available flags for configuring the image creation process. ```bash --description string Image description -h, --help help for create-image --label stringToString User-defined labels ('key=value') (can be specified multiple times) (default []) --type string Image type (backup, snapshot) (required) ``` -------------------------------- ### Enable Public Interface Command Options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer_enable-public-interface.md Help options available for the enable-public-interface command. ```bash -h, --help help for enable-public-interface ``` -------------------------------- ### GET /server list Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_list.md Displays a list of servers with options to filter, sort, and format the output. ```APIDOC ## GET hcloud server list ### Description Displays a list of servers. Output can be controlled with the -o flag to suppress headers or select specific columns. ### Method GET ### Endpoint hcloud server list ### Parameters #### Query Parameters - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result - **--status** (strings) - Optional - Only Servers with one of these statuses are displayed ### Available Columns - age, backup_window, created, datacenter, id, included_traffic, ingoing_traffic, ipv4, ipv6, labels, location, locked, name, outgoing_traffic, placement_group, primary_disk_size, private_net, protection, rescue_enabled, status, type, volumes ``` -------------------------------- ### GET /placement-groups Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_placement-group_list.md Lists all placement groups available in the account with options for filtering and output formatting. ```APIDOC ## GET hcloud placement-group list ### Description Displays a list of Placement Groups. Output can be controlled with the -o flag to suppress headers, select specific columns, or format as JSON/YAML. ### Method GET ### Endpoint hcloud placement-group list ### Parameters #### Query Parameters - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Available Columns - age - created - id - name - servers - type ``` -------------------------------- ### Import Zone File Command Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_zone_import-zonefile.md Imports a zone file into Hetzner Cloud DNS. Use '-' for stdin. Requires the zone name as an argument. ```bash hcloud zone import-zonefile --zonefile ``` -------------------------------- ### GET /networks Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_network_list.md Lists all networks associated with the account, with options for filtering, sorting, and output formatting. ```APIDOC ## GET hcloud network list ### Description Displays a list of Networks. Output can be controlled with the -o flag to suppress headers or select specific columns. ### Method GET ### Endpoint hcloud network list ### Parameters #### Options - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Request Example hcloud network list --output json ### Response #### Success Response (200) - **age** (string) - Age of the network - **created** (string) - Creation timestamp - **expose_routes_to_v_switch** (boolean) - Whether routes are exposed to vSwitch - **id** (integer) - Unique network ID - **ip_range** (string) - IP range of the network - **labels** (map) - User-defined labels - **name** (string) - Name of the network - **protection** (object) - Protection status - **servers** (array) - List of servers in the network ``` -------------------------------- ### Describe Firewall Source: https://context7.com/hetznercloud/cli/llms.txt Get detailed information about a specific firewall, including its rules and applied resources. ```bash hcloud firewall describe web-firewall ``` -------------------------------- ### Create Manual Storage Box Snapshot Source: https://context7.com/hetznercloud/cli/llms.txt Creates a manual snapshot of a Storage Box. ```bash # Create manual snapshot hcloud storage-box snapshot create backups ``` -------------------------------- ### Reboot Command Help Options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_reboot.md Displays help information for the reboot command. ```bash -h, --help help for reboot ``` -------------------------------- ### GET /storage-box-type Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_storage-box-type_list.md Lists all available Storage Box Types with support for custom output formatting and filtering. ```APIDOC ## GET hcloud storage-box-type list ### Description Displays a list of available Storage Box Types. Output can be formatted as a table, JSON, or YAML, and specific columns can be selected for display. ### Method GET ### Endpoint hcloud storage-box-type list ### Parameters #### Options - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Available Columns - automatic_snapshot_limit - deprecated - description - id - name - size - snapshot_limit - subaccounts_limit ### Request Example hcloud storage-box-type list -o json ``` -------------------------------- ### Load Balancer Create Options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer_create.md These options configure the load balancer during creation, such as algorithm, protection, labels, and network settings. ```bash --algorithm-type string Algorithm Type name (round_robin or least_connections) ``` ```bash --enable-protection strings Enable protection (delete) (default: none) ``` ```bash -h, --help help for create ``` ```bash --label stringToString User-defined labels ('key=value') (can be specified multiple times) (default []) ``` ```bash --location string Location (ID or name) ``` ```bash --name string Load Balancer name (required) ``` ```bash --network string Name or ID of the Network the Load Balancer should be attached to on creation ``` ```bash --network-zone string Network Zone ``` ```bash -o, --output stringArray output options: json|yaml ``` ```bash --type string Load Balancer Type (ID or name) (required) ``` -------------------------------- ### GET /ssh-key/describe Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_ssh-key_describe.md Retrieves detailed information about a specific SSH key using the Hetzner Cloud CLI. ```APIDOC ## GET hcloud ssh-key describe ### Description Describe an SSH Key by providing its identifier. ### Method GET ### Endpoint hcloud ssh-key describe [options] ### Parameters #### Path Parameters - **ssh-key** (string) - Required - The name or ID of the SSH key to describe. #### Options - **-o, --output** (stringArray) - Optional - Output format options: json|yaml|format. - **-h, --help** (boolean) - Optional - Show help for the describe command. ### Request Example hcloud ssh-key describe my-ssh-key --output json ``` -------------------------------- ### Create a Zone command syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_zone_create.md Basic command structure for creating a new zone. ```bash hcloud zone create [options] --name [--mode secondary --primary-nameservers ] ``` -------------------------------- ### Power on a Hetzner Cloud server Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_poweron.md Use this command to power on a specific server. Replace `` with the server ID or name. ```bash hcloud server poweron ``` -------------------------------- ### GET /load-balancer/metrics Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer_metrics.md Fetches metrics for a specified Load Balancer. You can specify the type of metrics and a time range. ```APIDOC ## GET /load-balancer/metrics ### Description Retrieves metrics for a specified Load Balancer. Supports filtering by metric type and time range. ### Method GET ### Endpoint `/load-balancer/{load-balancer-id}/metrics` ### Parameters #### Path Parameters - **load-balancer** (int64) - Required - ID of the Load Balancer #### Query Parameters - **type** (string[]) - Required - Types of metrics to show. Possible values: `open_connections`, `connections_per_second`, `requests_per_second`, `bandwidth`. - **start** (string) - Optional - ISO 8601 timestamp for the start of the metric collection period. - **end** (string) - Optional - ISO 8601 timestamp for the end of the metric collection period. ### Request Example ```bash hcloud load-balancer metrics --type open_connections --type bandwidth --start "2023-01-01T10:00:00Z" --end "2023-01-01T12:00:00Z" 12345 ``` ### Response #### Success Response (200) - **metrics** (object) - Contains the requested metrics data. - **time** (string) - Timestamp of the metric. - **open_connections** (int) - Number of open connections. - **connections_per_second** (int) - Number of connections per second. - **requests_per_second** (int) - Number of requests per second. - **bandwidth** (int) - Bandwidth in bytes. #### Response Example ```json { "metrics": [ { "time": "2023-01-01T10:00:00Z", "open_connections": 100, "connections_per_second": 10, "requests_per_second": 5, "bandwidth": 10240 } ] } ``` ``` -------------------------------- ### Create Image Command Syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_create-image.md Basic usage syntax for creating an image from a server. ```bash hcloud server create-image [options] --type ``` -------------------------------- ### GET /load-balancer-types Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer-type_list.md Lists all available Load Balancer Types with support for custom output formatting and filtering. ```APIDOC ## GET /load-balancer-types ### Description Displays a list of Load Balancer Types available in the Hetzner Cloud. ### Method GET ### Endpoint hcloud load-balancer-type list ### Parameters #### Options - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Available Columns - description - id - max_assigned_certificates - max_connections - max_services - max_targets - name ``` -------------------------------- ### Load Balancer describe options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer_describe.md Command-specific flags for expanding targets and defining output formats. ```bash --expand-targets Expand all label_selector targets (true, false) -h, --help help for describe -o, --output stringArray output options: json|yaml|format ``` -------------------------------- ### GET /ssh-keys Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_ssh-key_list.md Lists all SSH keys available in the Hetzner Cloud account with options for filtering and output formatting. ```APIDOC ## GET hcloud ssh-key list ### Description Displays a list of SSH Keys. Output can be controlled with the -o flag to suppress headers or select specific columns. ### Method GET ### Endpoint hcloud ssh-key list ### Parameters #### Options - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml - **-l, --selector** (string) - Optional - Selector to filter by labels - **-s, --sort** (strings) - Optional - Determine the sorting of the result ### Available Columns - age - created - fingerprint - id - labels - name - public_key ``` -------------------------------- ### GET hcloud server describe Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_describe.md Retrieves detailed information about a specific server using the Hetzner Cloud CLI. ```APIDOC ## GET hcloud server describe ### Description Retrieves detailed information about a specific server instance. ### Method GET ### Endpoint hcloud server describe ### Parameters #### Path Parameters - **server** (string) - Required - The name or ID of the server to describe. #### Options - **-o, --output** (stringArray) - Optional - Output format options: json|yaml|format. - **-h, --help** (boolean) - Optional - Show help for the command. ### Request Example hcloud server describe my-server-name ### Response #### Success Response (200) - **output** (object) - Returns the server details in the requested format (default, json, or yaml). ``` -------------------------------- ### List Available Server Types Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/create-a-server.md Retrieves a list of all available server types that can be provisioned in Hetzner Cloud. ```bash hcloud server-type list ``` -------------------------------- ### Describe a Datacenter Command Syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_datacenter_describe.md Basic usage pattern for the datacenter describe command. ```bash hcloud datacenter describe [options] ``` -------------------------------- ### GET hcloud primary-ip describe Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_primary-ip_describe.md Retrieves detailed information for a specific Primary IP using the Hetzner Cloud CLI. ```APIDOC ## GET hcloud primary-ip describe ### Description Describe a specific Primary IP resource. ### Method GET ### Endpoint hcloud primary-ip describe ### Parameters #### Path Parameters - **primary-ip** (string) - Required - The ID or name of the Primary IP to describe. #### Options - **-o, --output** (stringArray) - Optional - Output format options: json|yaml|format. ``` -------------------------------- ### Zone creation options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_zone_create.md Available flags for configuring the zone during creation. ```bash --enable-protection strings Enable protection (delete) (default: none) -h, --help help for create --label stringToString User-defined labels ('key=value') (can be specified multiple times) (default []) --mode string Mode of the Zone (primary, secondary) (default "primary") --name string Zone name (required) -o, --output stringArray output options: json|yaml --primary-nameservers-file string JSON file containing the new primary nameservers. (See 'hcloud zone change-primary-nameservers -h' for help) --ttl int Default Time To Live (TTL) of the Zone --zonefile string Zone file in BIND (RFC 1034/1035) format (use - to read from stdin) ``` -------------------------------- ### GET hcloud context list Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_context_list.md Displays a list of all configured contexts, with options to customize output format and column visibility. ```APIDOC ## GET hcloud context list ### Description Displays a list of contexts. Output can be controlled with the -o flag to suppress headers or select specific columns. ### Method GET ### Endpoint hcloud context list [options] ### Parameters #### Query Parameters - **--allow-sensitive** (boolean) - Optional - Allow showing sensitive values in JSON/YAML output - **-o, --output** (stringArray) - Optional - Output options: noheader|columns=...|json|yaml ### Options inherited from parent commands - **--config** (string) - Optional - Config file path (default "~/.config/hcloud/cli.toml") - **--context** (string) - Optional - Currently active context - **--debug** (boolean) - Optional - Enable debug output - **--debug-file** (string) - Optional - File to write debug output to - **--endpoint** (string) - Optional - Hetzner Cloud API endpoint (default "https://api.hetzner.cloud/v1") - **--hetzner-endpoint** (string) - Optional - Hetzner API endpoint (default "https://api.hetzner.com/v1") - **--no-experimental-warnings** (boolean) - Optional - If true, experimental warnings are not shown - **--poll-interval** (duration) - Optional - Interval at which to poll information (default 500ms) - **--quiet** (boolean) - Optional - If true, only print error messages ``` -------------------------------- ### Expose routes to vSwitch command usage Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_network_expose-routes-to-vswitch.md Basic syntax for the expose-routes-to-vswitch command. ```bash hcloud network expose-routes-to-vswitch [--disable] ``` -------------------------------- ### Describe a Location Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_location_describe.md Use this command to get detailed information about a specific Hetzner Cloud location. Specify the location name or ID as an argument. ```bash hcloud location describe [options] ``` -------------------------------- ### Create a Hetzner Cloud Server Source: https://context7.com/hetznercloud/cli/llms.txt Create a new cloud server with specified name, type, image, location, and SSH key. You can also add labels, enable backups, protection, or specify networks and firewalls. ```bash # Create a server with SSH key hcloud server create \ --name web-server-01 \ --type cpx22 \ --image ubuntu-24.04 \ --location fsn1 \ --ssh-key my-ssh-key \ --label env=production \ --label role=webserver ``` ```bash # Create server with multiple options hcloud server create \ --name db-server-01 \ --type cpx32 \ --image debian-12 \ --location nbg1 \ --ssh-key my-ssh-key \ --enable-backup \ --enable-protection delete \ --network my-network \ --firewall my-firewall \ --user-data-from-file cloud-init.yaml ``` -------------------------------- ### GET /server/ip Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_ip.md Retrieves the IP address of a specified server. By default, it returns the primary IPv4 address, with an option to retrieve the primary IPv6 address. ```APIDOC ## GET hcloud server ip ### Description Print a server's IP address. ### Method GET ### Endpoint hcloud server ip [--ipv6] ### Parameters #### Path Parameters - **server** (string) - Required - The name or ID of the server. #### Options - **--ipv6** (flag) - Optional - Print the first address of the Server's Primary IPv6 network. ### Request Example hcloud server ip my-server ### Response #### Success Response (200) - **ip_address** (string) - The requested IP address of the server. ``` -------------------------------- ### Create a Placement Group command syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_placement-group_create.md Basic command structure for creating a new placement group. ```bash hcloud placement-group create [options] --name --type ``` -------------------------------- ### PowerShell Completion Setup Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_completion.md To load PowerShell completions into the current session, pipe the output to 'Invoke-Expression'. To make them permanent, redirect the output to a file that can be sourced from your PowerShell profile. ```powershell PS> hcloud completion powershell | Out-String | Invoke-Expression ``` ```powershell PS> hcloud completion powershell > hcloud.ps1 ``` -------------------------------- ### List Firewalls Source: https://context7.com/hetznercloud/cli/llms.txt View all firewalls configured in your Hetzner Cloud account. ```bash hcloud firewall list ``` -------------------------------- ### List contexts command usage Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_context_list.md Basic syntax for listing available contexts. ```bash hcloud context list [options] ``` -------------------------------- ### Help Option for Location Describe Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_location_describe.md Display help information for the 'hcloud location describe' command. ```bash -h, --help help for describe ``` -------------------------------- ### Describe Location in JSON Source: https://github.com/hetznercloud/cli/blob/main/docs/guides/using-output-options.md Use the --output json flag to get detailed information about a specific location in JSON format. This output can be piped to tools like jq for further processing. ```bash $ hcloud location describe fsn1 --output json { "id": 1, "name": "fsn1", "description": "Falkenstein DC Park 1", "country": "DE", "city": "Falkenstein", "latitude": 50.47612, "longitude": 12.370071, "network_zone": "eu-central" } ``` -------------------------------- ### Create a Firewall command syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_firewall_create.md Basic command structure for creating a new firewall. ```bash hcloud firewall create [options] --name ``` -------------------------------- ### Create Firewall with Rules from File Source: https://context7.com/hetznercloud/cli/llms.txt Create a new firewall and define its rules by loading them from a JSON file. This is useful for complex rule sets. ```json [ { "direction": "in", "protocol": "tcp", "port": "22", "source_ips": ["0.0.0.0/0", "::/0"], "description": "SSH access" }, { "direction": "in", "protocol": "tcp", "port": "80", "source_ips": ["0.0.0.0/0", "::/0"], "description": "HTTP" }, { "direction": "in", "protocol": "tcp", "port": "443", "source_ips": ["0.0.0.0/0", "::/0"], "description": "HTTPS" } ] ``` ```bash cat > firewall-rules.json << 'EOF' \ [ \ { \ "direction": "in", \ "protocol": "tcp", \ "port": "22", \ "source_ips": ["0.0.0.0/0", "::/0"], \ "description": "SSH access" \ }, \ { \ "direction": "in", \ "protocol": "tcp", \ "port": "80", \ "source_ips": ["0.0.0.0/0", "::/0"], \ "description": "HTTP" \ }, \ { \ "direction": "in", \ "protocol": "tcp", \ "port": "443", \ "source_ips": ["0.0.0.0/0", "::/0"], \ "description": "HTTPS" \ } ] \ EOF hcloud firewall create --name web-firewall --rules-file firewall-rules.json ``` -------------------------------- ### POST hcloud server create Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_create.md Creates a new server instance in the Hetzner Cloud using the CLI. ```APIDOC ## POST hcloud server create ### Description Create a new server instance. Note that the --datacenter flag is deprecated in favor of --location. ### Method POST ### Endpoint hcloud server create ### Parameters #### Options - **--name** (string) - Required - Server name - **--type** (string) - Required - Server Type (ID or name) - **--image** (string) - Required - Image (ID or name) - **--location** (string) - Optional - Location (ID or name) - **--enable-backup** (boolean) - Optional - Enable automatic backups - **--ssh-key** (strings) - Optional - ID or name of SSH Key to inject - **--firewall** (strings) - Optional - ID or name of Firewall to attach - **--network** (strings) - Optional - ID or name of Network to attach - **--volume** (strings) - Optional - ID or name of Volume to attach - **--label** (stringToString) - Optional - User-defined labels ('key=value') - **--start-after-create** (boolean) - Optional - Start Server right after creation (default true) ### Request Example hcloud server create --name my-server --type cx22 --image ubuntu-24.04 --location nbg1 --start-after-create ``` -------------------------------- ### Lenient Command Validation with util.ValidateLenient Source: https://github.com/hetznercloud/cli/blob/main/CONTRIBUTING.md Use `util.ValidateLenient` when argument count checking should be disabled, for example, with optional positional arguments or complex usage patterns. This prevents errors if more arguments than expected are provided. ```go Args: util.ValidateLenient ``` -------------------------------- ### Hetzner Cloud CLI Storage Box Type Help Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_storage-box-type.md Displays help information for the 'storage-box-type' command. Use this to see available subcommands and options. ```bash -h, --help help for storage-box-type ``` -------------------------------- ### Manage Hetzner Cloud Servers Source: https://context7.com/hetznercloud/cli/llms.txt List, describe, and manage servers. This includes getting IP addresses, SSH access, power operations, resetting passwords, creating images, and changing server types. ```bash # List servers hcloud server list ``` ```bash # List servers with custom columns hcloud server list --output columns=id,name,status,location,type ``` ```bash # List servers filtered by label hcloud server list --selector env=production ``` ```bash # Describe a server hcloud server describe web-server-01 ``` ```bash # Get server IP address hcloud server ip web-server-01 ``` ```bash # SSH into a server hcloud server ssh web-server-01 -i ~/.ssh/hcloud ``` ```bash # Power operations hcloud server poweroff web-server-01 hcloud server poweron web-server-01 hcloud server reboot web-server-01 hcloud server shutdown web-server-01 --wait ``` ```bash # Reset root password hcloud server reset-password web-server-01 ``` ```bash # Create an image from server hcloud server create-image web-server-01 --type snapshot --description "Web server backup" ``` ```bash # Change server type (requires poweroff) hcloud server poweroff web-server-01 hcloud server change-type web-server-01 cpx32 ``` -------------------------------- ### Describe a Load Balancer Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_load-balancer_describe.md Basic usage syntax for the load-balancer describe command. ```bash hcloud load-balancer describe [options] ``` -------------------------------- ### Hetzner Cloud Context Create Options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_context_create.md These are the specific options available for the `hcloud context create` command, including help and token source selection. ```bash -h, --help help for create --token-from-env If true, the HCLOUD_TOKEN from the environment will be used without asking ``` -------------------------------- ### Version command options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_version.md Available flags for the version command, including help and long-form output. ```bash -h, --help help for version --long Print more version information (true, false) ``` -------------------------------- ### Command options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_floating-ip_assign.md Displays help information for the assign command. ```bash -h, --help help for assign ``` -------------------------------- ### Completion Help Option Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_completion.md Displays help information for the completion command. ```cli hcloud completion --help ``` -------------------------------- ### Build the binary Source: https://github.com/hetznercloud/cli/blob/main/CONTRIBUTING.md Compiles the hcloud-cli binary from the source code. ```sh go build -o hcloud-cli ./cmd/hcloud ``` -------------------------------- ### Create and Attach Volume to Server Source: https://context7.com/hetznercloud/cli/llms.txt Create a new volume and automatically attach it to a specified server. The volume will be mounted if automount is enabled. ```bash hcloud volume create \ --name app-data \ --size 50 \ --server web-server-01 \ --automount \ --format ext4 ``` -------------------------------- ### Enable Backup for a Server Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_enable-backup.md Use this command to enable the daily backup feature for a specific server. Replace `` with the server ID or name. ```bash hcloud server enable-backup ``` -------------------------------- ### Attach ISO to Server Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_server_attach-iso.md Use this command to attach an ISO to a server. Provide the server ID or name and the ISO ID or name. ```bash hcloud server attach-iso ``` -------------------------------- ### Build with GoReleaser Source: https://github.com/hetznercloud/cli/blob/main/CONTRIBUTING.md Builds the binary for all targets and includes version information. ```sh goreleaser --snapshot --skip-publish --rm-dist ``` -------------------------------- ### List Server Types and Images Source: https://context7.com/hetznercloud/cli/llms.txt View available server types and system images for creating new servers. Filter images by type. ```bash # List available server types hcloud server-type list ``` ```bash # List available images hcloud image list --type system ``` -------------------------------- ### Help for set-rdns command Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_floating-ip_set-rdns.md Displays help information for the `set-rdns` command, including available options. ```bash hcloud floating-ip set-rdns --help ``` -------------------------------- ### Manage Images Source: https://context7.com/hetznercloud/cli/llms.txt Commands for listing, describing, and modifying system images, snapshots, and backups. ```bash hcloud image list ``` ```bash hcloud image list --type system ``` ```bash hcloud image list --type snapshot ``` ```bash hcloud image list --type backup ``` ```bash hcloud image describe ubuntu-24.04 ``` ```bash hcloud image update 12345678 --description "Updated web server snapshot" ``` ```bash hcloud image enable-protection 12345678 delete ``` ```bash hcloud image add-label 12345678 version=1.0 ``` ```bash hcloud image delete 12345678 ``` -------------------------------- ### Describe a Placement Group command syntax Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_placement-group_describe.md Basic usage pattern for the placement-group describe command. ```bash hcloud placement-group describe [options] ``` -------------------------------- ### Create a Hetzner Cloud CLI Context Source: https://github.com/hetznercloud/cli/blob/main/docs/tutorials/setup-hcloud-cli.md Use this command to create a new context for managing Hetzner Cloud tokens and preferences. You will be prompted to enter your API token. ```bash hcloud context create ``` -------------------------------- ### Describe a Storage Box Snapshot Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_storage-box_snapshot_describe.md Basic syntax for describing a specific snapshot of a Storage Box. ```bash hcloud storage-box snapshot describe [options] ``` -------------------------------- ### List Storage Boxes Command Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_storage-box_list.md Basic syntax for listing Storage Boxes. ```bash hcloud storage-box list [options] ``` -------------------------------- ### Expose routes to vSwitch options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_network_expose-routes-to-vswitch.md Available flags for the expose-routes-to-vswitch command. ```bash --disable Remove any exposed routes from the connected vSwitch -h, --help help for expose-routes-to-vswitch ``` -------------------------------- ### Storage Box Snapshot Create Options Source: https://github.com/hetznercloud/cli/blob/main/docs/reference/manual/hcloud_storage-box_snapshot_create.md These are the available options for the `hcloud storage-box snapshot create` command, including description, help, labels, and output format. ```bash --description string Description of the Storage Box Snapshot --label stringToString User-defined labels ('key=value') (can be specified multiple times) (default []) -o, --output stringArray output options: json|yaml ```