Skip to content

Latest commit

 

History

History
82 lines (64 loc) · 4.04 KB

File metadata and controls

82 lines (64 loc) · 4.04 KB

hcloud config

Manage configuration

Synopsis

This command allows you to manage options for the Hetzner Cloud CLI. Options can be set inside the configuration file, through environment variables or with flags.

The hierarchy for configuration sources is as follows (from highest to lowest priority):

  1. Flags
  2. Environment variables
  3. Configuration file (context)
  4. Configuration file (global)
  5. Default values

Option values can have following types:

  • string
  • integer
  • boolean (true/false, yes/no)
  • duration (in the Go duration format, e.g. "1h30m")
  • any of the above as a list

Most options are 'preferences' - these options can be set globally and can additionally be overridden for each context. Below is a list of all non-preference options:

Option Description Type Config key Environment variable Flag
config Config file path (default "~/.config/hcloud/cli.toml") string HCLOUD_CONFIG --config
context Currently active context string active_context HCLOUD_CONTEXT --context
token Hetzner Cloud API token string token HCLOUD_TOKEN

Since the above options are not preferences, they cannot be modified with 'hcloud config set' or 'hcloud config unset'. However, you are able to retrieve them using 'hcloud config get' and 'hcloud config list'. Following options are preferences and can be used with set/unset/add/remove:

Option Description Type Config key Environment variable Flag
debug Enable debug output boolean debug HCLOUD_DEBUG --debug
debug-file File to write debug output to string debug_file HCLOUD_DEBUG_FILE --debug-file
default-ssh-keys Default SSH Keys for new Servers and Storage Boxes string list default_ssh_keys HCLOUD_DEFAULT_SSH_KEYS
endpoint Hetzner Cloud API endpoint string endpoint HCLOUD_ENDPOINT --endpoint
hetzner-endpoint Hetzner API endpoint string hetzner_endpoint HETZNER_ENDPOINT --hetzner-endpoint
no-experimental-warnings If true, experimental warnings are not shown boolean no_experimental_warnings HCLOUD_NO_EXPERIMENTAL_WARNINGS --no-experimental-warnings
poll-interval Interval at which to poll information, for example action progress duration poll_interval HCLOUD_POLL_INTERVAL --poll-interval
quiet If true, only print error messages boolean quiet HCLOUD_QUIET --quiet
sort.<resource> Default sorting for resource string list sort.<resource> HCLOUD_SORT_<RESOURCE>

Options will be persisted in the configuration file. To find out where your configuration file is located on disk, run 'hcloud config get config'.

Options

  -h, --help   help for config

Options inherited from parent commands

      --config string              Config file path (default "~/.config/hcloud/cli.toml")
      --context string             Currently active context
      --debug                      Enable debug output
      --debug-file string          File to write debug output to
      --endpoint string            Hetzner Cloud API endpoint (default "https://api.hetzner.cloud/v1")
      --hetzner-endpoint string    Hetzner API endpoint (default "https://api.hetzner.com/v1")
      --no-experimental-warnings   If true, experimental warnings are not shown
      --poll-interval duration     Interval at which to poll information, for example action progress (default 500ms)
      --quiet                      If true, only print error messages

SEE ALSO