# amfelt init agent

Initialize the agent identity and generate its keypair.

Initialize the Amfelt agent with machine identity (MI) credentials from your
Amfelt invite. This command:

1. Validates input credentials
2. Creates ~/.amfelt/ and ~/.amfelt/keys/ directories (mode 0700)
3. Generates Ed25519 keypair (locally, never transmitted pre-registration)
4. Stores encrypted config with MI credentials

The private key is encrypted with AES-256-GCM using PBKDF2-derived key.
All setup is offline — no network calls.

```text
Example:
  amfelt init-agent \
    --vault-mi-id mi-550e8400-e29b-41d4-a716 \
    --vault-mi-secret "your-secret-from-infisical" \
    --config-format yaml
```

Next step: Register with the API using `--register` flag.

## Usage

```text
amfelt init-agent [flags]
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--config-format` | `string` | `yaml` | configuration file format; one of yaml, json |
| `--force` | `bool` | `false` | ignore warnings and errors |
| `--vault-mi-id` | `string` | — | machine identity ID from your Amfelt invite (format mi-*) |
| `--vault-mi-secret` | `string` | — | machine identity secret from your Amfelt invite (minimum 32 characters) |
{.clidoc-flags-table}

## Global flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--amfelt-dir` | `string` | `.amfelt` | directory for workspace files (such as plugins); does not move agent identity (controlled by AMFELT_DIR) |
| `--config` | `string` | — | directory or filename of the application configuration |
| `-f`, `--format` | `string` | `default` | log format to use; either default, pretty, or json |
| `-l`, `--level` | `string` | `info` | minimum log level to display; either error, warn, info, or debug |
| `-v`, `--verbose` | `bool` | `false` | trigger to use verbose logging |
{.clidoc-flags-table}

---

Generated from `amfelt` v5.6.3.
