> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ubiquex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ubx suggest

> Generate .iac blocks from a natural language description.

`ubx suggest` reads existing `.iac` files for context, generates new blocks using Claude, and appends them to a target file after confirmation.

<Note>
  Requires `UBX_AI_API_KEY` or `ai.api_key` in `ubx.yaml`.
</Note>

## Usage

```bash theme={null}
ubx suggest "<description>" [flags]
```

## Examples

```bash theme={null}
ubx suggest "add a PostgreSQL RDS instance with 20GB storage"
ubx suggest "add an S3 bucket for logs" --append main.iac
ubx suggest "add EKS cluster with 3 nodes" --dry-run
ubx suggest "add Redis ElastiCache" --yes
```

## Flags

| Flag              | Description                                              |
| ----------------- | -------------------------------------------------------- |
| `--append string` | File to append generated blocks to (default: `main.iac`) |
| `--dry-run`       | Show generated blocks without writing to disk            |
| `--yes`           | Append blocks without confirmation prompt                |

## Output

```
→ Generated an S3 bucket for logs with versioning enabled.
  Resources: aws_s3_bucket_v2, aws_s3_bucket_versioning, aws_s3_bucket_public_access_block

  ⚠  No lifecycle policies configured — consider adding expiration rules
  ⚠  No encryption specified — consider adding server-side encryption

--- a/main.iac
+++ b/main.iac
@@ -2,1 +2,15 @@

+# S3 bucket for storing logs
+unit "aws_s3_bucket_v2" "logs" {
+  bucket = "logs-${input.env}"
+}
+
+unit "aws_s3_bucket_versioning" "logs" {
+  bucket = ~unit.aws_s3_bucket_v2.logs.id
+  versioning_configuration { status = "Enabled" }
+}

Append to main.iac? [y/N]
```

## Context Awareness

`ubx suggest` reads all existing `.iac` files before generating, so it can reference existing resources with `~unit.type.name.attr`.
