# straza keygen

Have the background service generate the Ed25519 key an AI agent enrolls with headless


## Synopsis

Asks the Straza background service to generate the keypair a headless AI agent
or service account authenticates with. The service keeps the private half;
print-out includes the `strazactl users nhi-key set` line an administrator
runs to register the public half, after which `straza enroll --headless` works.

```
straza keygen [flags]
```

## Options

```
      --force         replace an existing key (the registered public key stops working)
      --user string   the username this key will be registered under, printed in the registration line and used by enroll when --user is left out
```

## See also

* [straza](https://docs.straza.ai/reference/cli/straza/index.md): Straza client: enroll this machine, wire the hooks and decide each tool call



