Manage configuration
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):
- Flags
- Environment variables
- Configuration file (context)
- Configuration file (global)
- 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'.
-h, --help help for config
--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
- hcloud - Hetzner Cloud CLI
- hcloud config add - Add values to a list
- hcloud config get - Get a configuration value
- hcloud config list - List configuration values
- hcloud config remove - Remove values from a list
- hcloud config set - Set a configuration value
- hcloud config unset - Unset a configuration value