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

> Compile .xcl files and deploy the stack via Pulumi (runs pulumi up).

`ubx ship` compiles an XCL stack and deploys it using the Pulumi Automation API. It is the equivalent of running `ubx compile` followed by `pulumi up`.

## Usage

```sh theme={"theme":"css-variables"}
ubx ship [path]
```

| Form                    | Description                             |
| ----------------------- | --------------------------------------- |
| `ubx ship`              | Ship the stack in the current directory |
| `ubx ship ./networking` | Ship the stack in `./networking`        |

## What it does

1. **Compile** — runs the full XCL pipeline (lex → parse → typecheck → IR → codegen)
2. **Write** — writes generated files to `<path>/.ubx/`
3. **Stack** — upserts the Pulumi stack (creating it if it doesn't exist)
4. **Packages** — installs Python dependencies via pip into a virtualenv
5. **Deploy** — calls `pulumi up` via the Pulumi Automation API

## State storage

State is stored locally in `<path>/.ubx/state/` by default. This is a `file://` backend — no remote state configuration is needed. The state directory is created automatically on the first `ubx ship`.

## Stack name

The Pulumi stack name is the **directory name** of the target path. For example, `ubx ship ./networking` creates a stack named `networking`.

## Output

```
● Compile    ./networking → networking/.ubx/__main__.py
● Typecheck  2 file(s)
● IR         building…
● Stack      networking
● Packages   installing…
● Packages   ready
● Deploy     running pulumi up…

+ aws:ec2:Vpc        vpc
+ aws:ec2:Subnet     subnets-0
+ aws:ec2:Subnet     subnets-1
+ aws:ec2:Subnet     subnets-2

✓  done in 34s  ·  4 created  ·  0 changed  ·  0 destroyed
```

Resources are displayed as they are created. The `+`, `~`, and `-` symbols indicate create, update, and destroy respectively.

## Compile errors abort ship

If the XCL pipeline produces parse or typecheck errors, `ubx ship` aborts before any cloud calls are made:

```
● Compile    ./networking → networking/.ubx/__main__.py
✗  stack.xcl:8  undefined reference "subnett"
ship aborted: typecheck errors
```

## Prerequisites

* AWS/GCP/Azure credentials in the environment (or configured via provider block)
* Python 3.9+ and `pip` on your `PATH`
* Pulumi Automation API (bundled — no separate `pulumi` CLI install required)
