Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9a1a2e7
wip: storage box init and wip
lukasmetzner Aug 20, 2025
f8cc3ef
wip
phm07 Aug 20, 2025
ef30a6e
describe command
phm07 Aug 20, 2025
0523bd9
label commands
phm07 Aug 27, 2025
d08e0a7
add storage box client mock
phm07 Aug 27, 2025
65845eb
support storage box ssh keys during creation
phm07 Aug 27, 2025
d60a7a1
update hcloud-go
phm07 Aug 27, 2025
d9fbdaa
implement test cases for create
phm07 Aug 27, 2025
43d598c
implement test cases for delete
phm07 Aug 27, 2025
786e8de
fix describe indent + describe test
phm07 Sep 3, 2025
aea79a0
fix
phm07 Sep 3, 2025
768be52
folders + labels test
phm07 Sep 3, 2025
1cfb19c
list command + test
phm07 Sep 3, 2025
42e673e
rebase
phm07 Sep 3, 2025
dd92733
"unlimited" -> "-"
phm07 Sep 3, 2025
059a2fc
"available" -> "active"
phm07 Sep 3, 2025
af002d0
add yaml + json support for listing folders
phm07 Sep 3, 2025
3ec5694
storage box now allows partial updates
phm07 Sep 3, 2025
4f36597
update command
phm07 Sep 3, 2025
ca2d1ac
fix import order
phm07 Sep 3, 2025
11e064e
stringify weekday
phm07 Sep 5, 2025
fdf172c
print server and username after storage box creation
phm07 Sep 5, 2025
54afc33
use util.OptionalString
phm07 Sep 5, 2025
2d005a3
fix ci
phm07 Sep 5, 2025
ad075da
resolve SSH keys in create
phm07 Sep 5, 2025
e36cc6a
fix test
phm07 Sep 5, 2025
576dce5
drop TODO
phm07 Sep 5, 2025
cbb8c68
fix describe indent
phm07 Sep 8, 2025
e1364ed
add plural command alias
phm07 Sep 8, 2025
e1f16b9
fix: remaining review feedback
lukasmetzner Sep 8, 2025
0ac7c08
fix: missing go generate
lukasmetzner Sep 8, 2025
299426e
docs: shorter description
lukasmetzner Sep 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/reference/manual/hcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ A command-line interface for Hetzner Cloud
* [hcloud server](hcloud_server.md) - Manage Servers
* [hcloud server-type](hcloud_server-type.md) - View Server Types
* [hcloud ssh-key](hcloud_ssh-key.md) - Manage SSH Keys
* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
* [hcloud storage-box-type](hcloud_storage-box-type.md) - View Storage Box Types
* [hcloud version](hcloud_version.md) - Print version information
* [hcloud volume](hcloud_volume.md) - Manage Volumes
35 changes: 35 additions & 0 deletions docs/reference/manual/hcloud_storage-box.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## hcloud storage-box

Manage Storage Boxes

### Options

```
-h, --help help for storage-box
```

### 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

* [hcloud](hcloud.md) - Hetzner Cloud CLI
* [hcloud storage-box add-label](hcloud_storage-box_add-label.md) - Add a label to a Storage Box
* [hcloud storage-box create](hcloud_storage-box_create.md) - Create a new Storage Box
* [hcloud storage-box delete](hcloud_storage-box_delete.md) - Delete a Storage Box
* [hcloud storage-box describe](hcloud_storage-box_describe.md) - Describe a Storage Box
* [hcloud storage-box folders](hcloud_storage-box_folders.md) - List folders of a Storage Box
* [hcloud storage-box list](hcloud_storage-box_list.md) - List Storage Boxes
* [hcloud storage-box remove-label](hcloud_storage-box_remove-label.md) - Remove a label from a Storage Box
* [hcloud storage-box update](hcloud_storage-box_update.md) - Update a Storage Box
32 changes: 32 additions & 0 deletions docs/reference/manual/hcloud_storage-box_add-label.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## hcloud storage-box add-label

Add a label to a Storage Box

```
hcloud storage-box add-label [--overwrite] <storage-box> <label>...
```

### Options

```
-h, --help help for add-label
-o, --overwrite Overwrite label if it exists already (true, false)
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
44 changes: 44 additions & 0 deletions docs/reference/manual/hcloud_storage-box_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## hcloud storage-box create

Create a new Storage Box

```
hcloud storage-box create [options] --name <name> --type <type> --location <location> --password <password>
```

### Options

```
--enable-protection strings Enable protection (delete) (default: none)
--enable-samba Whether the Samba subsystem should be enabled
--enable-ssh Whether the SSH subsystem should be enabled
--enable-webdav Whether the WebDAV subsystem should be enabled
--enable-zfs Whether the ZFS Snapshot folder should be visible
-h, --help help for create
--label stringToString User-defined labels ('key=value') (can be specified multiple times) (default [])
--location string Location (ID or name) (required)
--name string Storage Box name (required)
-o, --output stringArray output options: json|yaml
--password string The password that will be set for this Storage Box (required)
--reachable-externally Whether the Storage Box should be accessible from outside the Hetzner network
--ssh-key stringArray SSH public keys in OpenSSH format or as the ID or name of an existing SSH key
--type string Storage Box Type (ID or name) (required)
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
31 changes: 31 additions & 0 deletions docs/reference/manual/hcloud_storage-box_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## hcloud storage-box delete

Delete a Storage Box

```
hcloud storage-box delete <storage-box>...
```

### Options

```
-h, --help help for delete
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
32 changes: 32 additions & 0 deletions docs/reference/manual/hcloud_storage-box_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## hcloud storage-box describe

Describe a Storage Box

```
hcloud storage-box describe [options] <storage-box>
```

### Options

```
-h, --help help for describe
-o, --output stringArray output options: json|yaml|format
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
33 changes: 33 additions & 0 deletions docs/reference/manual/hcloud_storage-box_folders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## hcloud storage-box folders

List folders of a Storage Box

```
hcloud storage-box folders <storage-box>
```

### Options

```
-h, --help help for folders
-o, --output stringArray output options: json|yaml
--path string Relative path for which the listing is to be made
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
56 changes: 56 additions & 0 deletions docs/reference/manual/hcloud_storage-box_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## hcloud storage-box list

List Storage Boxes

### Synopsis

Displays a list of Storage Boxes.

Output can be controlled with the -o flag. Use -o noheader to suppress the
table header. Displayed columns and their order can be set with
-o columns=age,created (see available columns below).

Columns:
- age
- created
- id
- labels
- location
- name
- server
- size
- status
- system
- type
- username

```
hcloud storage-box list [options]
```

### Options

```
-h, --help help for list
-o, --output stringArray output options: noheader|columns=...|json|yaml
-l, --selector string Selector to filter by labels
-s, --sort strings Determine the sorting of the result
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
32 changes: 32 additions & 0 deletions docs/reference/manual/hcloud_storage-box_remove-label.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## hcloud storage-box remove-label

Remove a label from a Storage Box

```
hcloud storage-box remove-label <storage-box> (--all | <label>...)
```

### Options

```
-a, --all Remove all labels
-h, --help help for remove-label
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
32 changes: 32 additions & 0 deletions docs/reference/manual/hcloud_storage-box_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## hcloud storage-box update

Update a Storage Box

```
hcloud storage-box update [options] <storage-box>
```

### Options

```
-h, --help help for update
--name string Storage Box name
```

### 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

* [hcloud storage-box](hcloud_storage-box.md) - Manage Storage Boxes
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/hetznercloud/hcloud-go/v2 => github.com/hetznercloud/hcloud-go/v2 v2.22.1-0.20250902143326-ace27a0a28dc
replace github.com/hetznercloud/hcloud-go/v2 => github.com/hetznercloud/hcloud-go/v2 v2.22.1-0.20250908103136-a25d71b20732
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/guptarohit/asciigraph v0.7.3 h1:p05XDDn7cBTWiBqWb30mrwxd6oU0claAjqeytllnsPY=
github.com/guptarohit/asciigraph v0.7.3/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag=
github.com/hetznercloud/hcloud-go/v2 v2.22.1-0.20250902143326-ace27a0a28dc h1:vAz2KQ8aJFsaHz7AJRkT38hjKnsgPpup3tjWnZn4lXc=
github.com/hetznercloud/hcloud-go/v2 v2.22.1-0.20250902143326-ace27a0a28dc/go.mod h1:rDpBO6bbG1aP6wcScPCOx880e7EB4uRxDYhQ/+qE/+w=
github.com/hetznercloud/hcloud-go/v2 v2.22.1-0.20250908103136-a25d71b20732 h1:gQ0IvtSLuLigEg+njl0vqElx+cEDHkDWRTBCnqgmjlE=
github.com/hetznercloud/hcloud-go/v2 v2.22.1-0.20250908103136-a25d71b20732/go.mod h1:rDpBO6bbG1aP6wcScPCOx880e7EB4uRxDYhQ/+qE/+w=
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
Expand Down
2 changes: 2 additions & 0 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/hetznercloud/cli/internal/cmd/server"
"github.com/hetznercloud/cli/internal/cmd/servertype"
"github.com/hetznercloud/cli/internal/cmd/sshkey"
"github.com/hetznercloud/cli/internal/cmd/storagebox"
"github.com/hetznercloud/cli/internal/cmd/storageboxtype"
"github.com/hetznercloud/cli/internal/cmd/util"
"github.com/hetznercloud/cli/internal/cmd/version"
Expand Down Expand Up @@ -61,6 +62,7 @@ func NewRootCommand(s state.State) *cobra.Command {
firewall.NewCommand(s),
placementgroup.NewCommand(s),
primaryip.NewCommand(s),
storagebox.NewCommand(s),
storageboxtype.NewCommand(s),
)

Expand Down
Loading