{"id":13489391,"url":"https://github.com/hetznercloud/cli","last_synced_at":"2025-05-14T03:07:03.544Z","repository":{"id":37706198,"uuid":"112504630","full_name":"hetznercloud/cli","owner":"hetznercloud","description":"A command-line interface for Hetzner Cloud","archived":false,"fork":false,"pushed_at":"2025-05-07T00:07:46.000Z","size":8856,"stargazers_count":1231,"open_issues_count":24,"forks_count":79,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-05-07T01:20:45.528Z","etag":null,"topics":["cli","command-line","command-line-tool","commandline-interface","hcloud","hetzner","hetzner-cloud"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hetznercloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-29T17:12:42.000Z","updated_at":"2025-05-07T00:06:46.000Z","dependencies_parsed_at":"2023-10-12T17:35:11.487Z","dependency_job_id":"0bcb4fdf-8486-48a4-b66c-37ff6dc2fff6","html_url":"https://github.com/hetznercloud/cli","commit_stats":{"total_commits":574,"total_committers":51,"mean_commits":"11.254901960784315","dds":0.837979094076655,"last_synced_commit":"f0422c38d3596b33d14323bb47f20a47d445412f"},"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hetznercloud","download_url":"https://codeload.github.com/hetznercloud/cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059501,"owners_count":22007768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","command-line-tool","commandline-interface","hcloud","hetzner","hetzner-cloud"],"created_at":"2024-07-31T19:00:25.773Z","updated_at":"2025-05-14T03:07:03.538Z","avatar_url":"https://github.com/hetznercloud.png","language":"Go","readme":"# hcloud: Command-line interface for Hetzner Cloud\n\n[![Release](https://img.shields.io/github/v/release/hetznercloud/cli)](https://github.com/hetznercloud/cli/releases/latest)\n![Go Version](https://img.shields.io/github/go-mod/go-version/hetznercloud/cli/main?label=Go)\n[![CI](https://github.com/hetznercloud/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/hetznercloud/cli/actions/workflows/ci.yml)\n[![Build](https://github.com/hetznercloud/cli/actions/workflows/build.yml/badge.svg)](https://github.com/hetznercloud/cli/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/hetznercloud/cli/graph/badge.svg?token=fFDgg6Ua6U)](https://codecov.io/gh/hetznercloud/cli)\n\n`hcloud` is a command-line interface for interacting with Hetzner Cloud.\n\n[![asciicast](https://asciinema.org/a/157991.png)](https://asciinema.org/a/157991)\n\n## Installation\n\nYou can download pre-built binaries for Linux, FreeBSD, macOS, and Windows on\nthe [releases page](https://github.com/hetznercloud/cli/releases).\n\nOn macOS and Linux, you can install `hcloud` via [Homebrew](https://brew.sh/):\n\n    brew install hcloud\n\n\nOn Windows, you can install `hcloud` via [Scoop](https://scoop.sh/)\n\n    scoop install hcloud\n\n### Third-party packages\n\nThere are unofficial packages maintained by third-party users. Please note\nthat these packages aren’t supported nor maintained by Hetzner Cloud and\nmay not always be up-to-date. Downloading the binary or building from source\nis still the recommended install method.\n\n### Build manually\n\nIf you have Go installed, you can build and install the latest version of\n`hcloud` with:\n\n    go install github.com/hetznercloud/cli/cmd/hcloud@latest\n\n\u003e Binaries built in this way do not have the correct version embedded. Use our\nprebuilt binaries or check out [`.goreleaser.yml`](.goreleaser.yml) to learn\nhow to embed it yourself.\n\n### Docker\n\nA docker image is published at `hetznercloud/cli`.\n\n```bash\ndocker run --rm -e HCLOUD_TOKEN=\"\u003cyour token\u003e\" hetznercloud/cli:latest \u003ccommand\u003e\n```\n\nIf you want to use (and persist) your configuration, you can mount it to `/config.toml`:\n```bash\ndocker run --rm -v ~/.config/hcloud/cli.toml:/config.toml hetznercloud/cli:latest \u003ccommand\u003e\n```\n\n## Getting Started\n\n1.  Visit the Hetzner Cloud Console at [console.hetzner.cloud](https://console.hetzner.cloud/),\n    select your project, and create a new API token.\n\n2.  Configure the `hcloud` program to use your token:\n\n        hcloud context create my-project\n\n3.  You’re ready to use the program. For example, to get a list of available server\n    types, run:\n\n        hcloud server-type list\n\nSee `hcloud help` for a list of commands.\n\nYou can also check out the [command reference](docs/reference) for help.\n\n## Shell Completion\n\n`hcloud` provides completions for various shells.\n\n### Bash\n\nTo load completions into the current shell execute:\n\n    source \u003c(hcloud completion bash)\n\nIn order to make the completions permanent, append the line above to\nyour `.bashrc`.\n\n### Zsh\n\nIf shell completions are not already enabled for your environment need\nto enable them. Add the following line to your `~/.zshrc` file:\n\n    autoload -Uz compinit; compinit\n\nTo load completions for each session execute the following commands:\n\n    mkdir -p ~/.config/hcloud/completion/zsh\n    hcloud completion zsh \u003e ~/.config/hcloud/completion/zsh/_hcloud\n\nFinally, add the following line to your `~/.zshrc` file, *before* you\ncall the `compinit` function:\n\n    fpath+=(~/.config/hcloud/completion/zsh)\n\nIn the end your `~/.zshrc` file should contain the following two lines\nin the order given here.\n\n    fpath+=(~/.config/hcloud/completion/zsh)\n    #  ... anything else that needs to be done before compinit\n    autoload -Uz compinit; compinit\n    # ...\n\nYou will need to start a new shell for this setup to take effect.\n\n### Fish\n\nTo load completions into the current shell execute:\n\n    hcloud completion fish | source\n\nIn order to make the completions permanent execute once:\n\n     hcloud completion fish \u003e ~/.config/fish/completions/hcloud.fish\n\n### PowerShell:\n\nTo load completions into the current shell execute:\n\n    PS\u003e hcloud completion powershell | Out-String | Invoke-Expression\n\nTo load completions for every new session, run\nand source this file from your PowerShell profile.\n\n    PS\u003e hcloud completion powershell \u003e hcloud.ps1\n\n## Output configuration\n\nYou can control output via the `-o` option:\n\n* For `list` commands, you can specify `-o noheader` to omit the table header.\n\n* For `list` commands, you can specify `-o columns=id,name` to only show certain\n  columns in the table.\n\n* For `describe` commands, you can specify `-o json` to get a JSON representation\n  of the resource. The schema is identical to those in the Hetzner Cloud API which\n  are documented at [docs.hetzner.cloud](https://docs.hetzner.cloud).\n\n* For `create` commands, you can specify `-o json` to get a JSON representation\n  of the API response. API responses are documented at [docs.hetzner.cloud](https://docs.hetzner.cloud).\n  In contrast to `describe` commands, `create` commands can return extra information, for example\n  the initial root password of a server.\n\n* For `describe` commands, you can specify `-o format={{.ID}}` to format output\n  according to the given [Go template](https://golang.org/pkg/text/template/).\n  The template’s input is the resource’s corresponding struct in the\n  [hcloud-go](https://godoc.org/github.com/hetznercloud/hcloud-go/hcloud) library.\n\n## Configuring hcloud\n\nThe hcloud CLI tool can be configured using following methods:\n1. Configuration file\n2. Environment variables\n3. Command line flags\n\nA higher number means a higher priority. For example, a command line flag will \nalways override an environment variable.\n\nThe configuration file is located at `~/.config/hcloud/cli.toml` by default \n(On Windows: `%APPDATA%\\hcloud\\cli.toml`). You can change the location by setting \nthe `HCLOUD_CONFIG` environment variable or the `--config` flag. The configuration file\nstores global preferences, the currently active context, all contexts and \ncontext-specific preferences. Contexts always store a token and can optionally have\nadditional preferences which take precedence over the globally set preferences.\n\nHowever, a config file is not required. If no config file is found, the CLI will\nuse the default configuration. Overriding options using environment variables allows the\nhcloud CLI to function in a stateless way. For example, setting `HCLOUD_TOKEN` is\nalready enough in many cases.\n\nYou can use the `hcloud config` command to manage your configuration, for example \nto get, list, set and unset configuration options and preferences. You can view a list\nof all available options and preferences by running `hcloud config --help`.\n\n## Examples\n\n### List all servers\n\n```\n$ hcloud server list\nID       NAME                    STATUS    IPV4\n210216   test1                   running   78.46.122.12\n210729   ubuntu-8gb-nbg1-dc3-1   running   94.130.177.158\n```\n\n### Create a server\n\n```\n$ hcloud server create --name test --image debian-9 --type cx22 --ssh-key demo\n   7s [====================================================================] 100%\nServer 325211 created\n```\n\n## License\n\nMIT license\n","funding_links":[],"categories":["Go","cli","Tools"],"sub_categories":["Rust"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetznercloud%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhetznercloud%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetznercloud%2Fcli/lists"}