> ## 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.

# Quick Start

> Deploy your first ubx stack in 5 minutes.

## Prerequisites

* [Go 1.21+](https://golang.org/dl/)
* [Pulumi CLI](https://www.pulumi.com/docs/install/)
* [Node.js 18+](https://nodejs.org/)
* Cloud credentials (AWS, GCP, or Azure)

## Install

```bash theme={null}
go install github.com/ubiquex/ubx@latest
ubx version
# ubx v1.0.0
```

## Create a Project

```bash theme={null}
ubx init my-infra
cd my-infra
```

This scaffolds:

```
my-infra/
  ubx.yaml      # project config
  stack.iac     # your infrastructure
  .ubx/         # generated output (git-ignored)
```

## Write Your First Stack

Edit `stack.iac`:

```hcl theme={null}
input "env" {
  type    = "string"
  default = "dev"
}

unit "aws_s3_bucket_v2" "assets" {
  bucket        = "${input.env}-my-assets"
  force_destroy = true
}

output "bucket_name" {
  value       = ~unit.aws_s3_bucket_v2.assets.bucket
  description = "S3 bucket name"
}
```

## Validate

```bash theme={null}
ubx validate
#   ◆ Compile    stack.iac
#   ✓  valid
```

## Preview

```bash theme={null}
ubx plan
#   ◆ Compile    stack.iac → .ubx/index.ts
#   ◆ Stack      dev
#   ◆ Packages   ready
#
#   ─── Preview ────────────────────────
#   +  aws:s3:BucketV2    assets
#
#   1 to create
```

## Deploy

```bash theme={null}
ubx apply
#   ◆ Compile    stack.iac → .ubx/index.ts
#   ◆ Stack      dev
#   ◆ Packages   ready
#
#   ─── Applying ───────────────────────
#   +  aws:s3:BucketV2    assets    3s
#
#   ✓  done in 4s · 1 created · 0 changed · 0 destroyed
#
#   ─── Outputs ────────────────────────
#   bucket_name  =  "dev-my-assets"
```

## Clean Up

```bash theme={null}
ubx destroy
```

## Wire Outputs to Apps

The real power of ubx — wiring cloud outputs directly into app deployments:

```hcl theme={null}
unit "aws_rds_instance" "db" {
  engine              = "postgres"
  instance_class      = "db.t3.micro"
  allocated_storage   = 20
  username            = "admin"
  password            = secret("aws_secrets_manager", "prod/db/password")
  skip_final_snapshot = true
}

deploy "helm" "backend" {
  chart     = "my-backend"
  namespace = "backend"
  values = {
    database = {
      host = ~unit.aws_rds_instance.db.endpoint  # auto-wired
    }
  }
}
```

No manual steps. No pipeline glue. The `~` prefix wires it automatically.

## Next Steps

<CardGroup cols={2}>
  <Card title="Multi-environment" icon="layers" href="/v1/guides/multi-environment">
    Staging vs production with extend blocks
  </Card>

  <Card title="AI features" icon="sparkles" href="/v1/guides/ai-features">
    ubx explain, fix, suggest, review, upgrade
  </Card>

  <Card title="Language reference" icon="book" href="/v1/language/overview">
    All block types and syntax
  </Card>

  <Card title="CLI reference" icon="terminal" href="/v1/cli/overview">
    All ubx commands
  </Card>
</CardGroup>
