cli: accept a user name in preauthkeys create --user

Resolved through lookupUser like the users commands, so scripts skip the
users list round trip. Digit-only values stay IDs.
This commit is contained in:
Kristoffer Dalby
2026-09-28 13:34:46 +00:00
committed by Kristoffer Dalby
parent 715c5a4a1c
commit 62f89ca25d
6 changed files with 86 additions and 7 deletions
+2 -2
View File
@@ -105,10 +105,10 @@ Its best suited for automation.
headscale users create <USER>
```
Use the `headscale user list` command to learn its `<USER_ID>` and create a new pre authenticated key for your user:
Create a new pre authenticated key for your user, by name or by the `<USER_ID>` that `headscale user list` shows:
```console
headscale preauthkeys create --user <USER_ID>
headscale preauthkeys create --user <USER>
```
The above prints a pre authenticated key with the default settings (can be used once and is valid for one hour). Use