Skip to main content
ubx chat starts an interactive session where you describe infrastructure in plain English and ubx generates XCL blocks. All existing .xcl files in the current directory are read as context so generated code can reference existing resources.

Usage

ubx chat [flags]

Flags

FlagDescription
--append <file>Append confirmed code blocks to this file (default: main.xcl)
--context <file>Use only this file as context (default: all .xcl files in cwd)

Requirements

Requires UBX_AI_API_KEY environment variable or ai.api_key in workspace.xcl.

Examples

ubx chat                          # reads all .xcl files in cwd as context
ubx chat --append infra.xcl       # append confirmed blocks to infra.xcl
ubx chat --context main.xcl       # use only main.xcl as context

Session commands

InputEffect
(Enter)Send your message
yAppend the generated XCL block to the target file
NDiscard the block and continue chatting
e or editOpen $EDITOR to edit the block before appending
exit or quitEnd the session

Example session

  ◆ Chat       reading 2 .xcl files as context
  ◆ Chat       UBX_AI_API_KEY detected

> Add an S3 bucket for storing application logs, with lifecycle rules to
  move objects to Glacier after 30 days

  logs_bucket = aws.s3.Bucket {
    bucket = "${input.env}-app-logs"
    lifecycle_rules = [{
      id      = "archive-to-glacier"
      enabled = true
      transition = {
        days          = 30
        storage_class = "GLACIER"
      }
    }]
  }

  Append to main.xcl? [y/N/e] y

  ✓  appended to main.xcl

> Add an output for the bucket name
  ...