Back to Ohmyzsh

hcloud plugin

plugins/hcloud/README.md

latest13.0 KB
Original Source

hcloud plugin

This plugin adds completion for the Hetzner Cloud CLI, as well as some aliases for common hcloud commands.

To use it, add hcloud to the plugins array in your zshrc file:

zsh
plugins=(... hcloud)

Aliases

AliasCommandDescription
hchcloudThe hcloud command
Context Management
hcctxhcloud contextManage contexts
hcctxlshcloud context listList all contexts
hcctxuhcloud context useUse a context
hcctxchcloud context createCreate a new context
hcctxdhcloud context deleteDelete a context
hcctxahcloud context activeShow active context
Server Management
hcshcloud serverManage servers
hcslhcloud server listList all servers
hcschcloud server createCreate a server
hcsdhcloud server deleteDelete a server
hcsdeschcloud server describeDescribe a server
hcspoffhcloud server poweroffPower off a server
hcsponhcloud server poweronPower on a server
hcsrhcloud server rebootReboot a server
hcsresethcloud server resetReset a server
hcsshhcloud server sshSSH into a server
hcsehcloud server enable-rescueEnable rescue mode for a server
hcsdrhcloud server disable-rescueDisable rescue mode for a server
hcsiphcloud server ipManage server IPs
hcsahcloud server attach-isoAttach an ISO to a server
hcsdahcloud server detach-isoDetach an ISO from a server
hcsciphcloud server change-typeChange server type
Volume Management
hcvhcloud volumeManage volumes
hcvlhcloud volume listList all volumes
hcvchcloud volume createCreate a volume
hcvdhcloud volume deleteDelete a volume
hcvdeschcloud volume describeDescribe a volume
hcvahcloud volume attachAttach a volume to a server
hcvdahcloud volume detachDetach a volume from a server
hcvrhcloud volume resizeResize a volume
Network Management
hcnhcloud networkManage networks
hcnlhcloud network listList all networks
hcnchcloud network createCreate a network
hcndhcloud network deleteDelete a network
hcndeschcloud network describeDescribe a network
hcnashcloud network add-subnetAdd a subnet to a network
hcndshcloud network delete-subnetDelete a subnet from a network
hcnarhcloud network add-routeAdd a route to a network
hcndrhcloud network delete-routeDelete a route from a network
Floating IP Management
hcfiphcloud floating-ipManage floating IPs
hcfiplhcloud floating-ip listList all floating IPs
hcfipchcloud floating-ip createCreate a floating IP
hcfipdhcloud floating-ip deleteDelete a floating IP
hcfipdeschcloud floating-ip describeDescribe a floating IP
hcfipahcloud floating-ip assignAssign a floating IP to a server
hcfipuahcloud floating-ip unassignUnassign a floating IP from a server
SSH Key Management
hcskhcloud ssh-keyManage SSH keys
hcsklhcloud ssh-key listList all SSH keys
hcskchcloud ssh-key createCreate an SSH key
hcskdhcloud ssh-key deleteDelete an SSH key
hcskdeschcloud ssh-key describeDescribe an SSH key
hcskuhcloud ssh-key updateUpdate an SSH key
Image Management
hcihcloud imageManage images
hcilhcloud image listList all images
hcidhcloud image deleteDelete an image
hcideschcloud image describeDescribe an image
hciuhcloud image updateUpdate an image
Firewall Management
hcfwhcloud firewallManage firewalls
hcfwlhcloud firewall listList all firewalls
hcfwchcloud firewall createCreate a firewall
hcfwdhcloud firewall deleteDelete a firewall
hcfwdeschcloud firewall describeDescribe a firewall
hcfwarhcloud firewall add-ruleAdd a rule to a firewall
hcfwdrhcloud firewall delete-ruleDelete a rule from a firewall
hcfwashcloud firewall apply-to-resourceApply a firewall to a resource
hcfwrshcloud firewall remove-from-resourceRemove a firewall from a resource
Load Balancer Management
hclbhcloud load-balancerManage load balancers
hclblhcloud load-balancer listList all load balancers
hclbchcloud load-balancer createCreate a load balancer
hclbdhcloud load-balancer deleteDelete a load balancer
hclbdeschcloud load-balancer describeDescribe a load balancer
hclbuhcloud load-balancer updateUpdate a load balancer
hclbashcloud load-balancer add-serviceAdd a service to a load balancer
hclbdshcloud load-balancer delete-serviceDelete a service from a load balancer
hclbathcloud load-balancer add-targetAdd a target to a load balancer
hclbdthcloud load-balancer delete-targetDelete a target from a load balancer
Certificate Management
hccerthcloud certificateManage certificates
hccertlhcloud certificate listList all certificates
hccertchcloud certificate createCreate a certificate
hccertdhcloud certificate deleteDelete a certificate
hccertdeschcloud certificate describeDescribe a certificate
hccertuhcloud certificate updateUpdate a certificate
Datacenter and Location Info
hcdchcloud datacenter listList all datacenters
hclochcloud location listList all locations
hcsthcloud server-type listList all server types
hcithcloud image list --type systemList all system images

Requirements

This plugin requires the Hetzner Cloud CLI to be installed.

Installation

Install the Hetzner Cloud CLI using one of the following methods:

macOS (Homebrew):

bash
brew install hcloud

Linux (from source):

bash
go install github.com/hetznercloud/cli/cmd/hcloud@latest

Or download a prebuilt binary from the releases page.

Setup

After installation, create a context and authenticate:

bash
hcloud context create my-project

You'll be prompted to enter your Hetzner Cloud API token, which you can generate in the Hetzner Cloud Console.