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

# CLI Overview

> All ubx commands at a glance.

## Commands

### Core

| Command                            | Description                               |
| ---------------------------------- | ----------------------------------------- |
| [`ubx init`](/v1/cli/init)         | Scaffold a new ubx project                |
| [`ubx validate`](/v1/cli/validate) | Type-check `.iac` files without deploying |
| [`ubx plan`](/v1/cli/plan)         | Preview changes                           |
| [`ubx apply`](/v1/cli/apply)       | Compile and deploy                        |
| [`ubx destroy`](/v1/cli/destroy)   | Tear down resources                       |
| [`ubx refresh`](/v1/cli/refresh)   | Sync state with actual cloud              |
| [`ubx output`](/v1/cli/output)     | Show stack outputs                        |
| [`ubx fmt`](/v1/cli/fmt)           | Format `.iac` files canonically           |

### AI Commands

| Command                          | Description                                      |
| -------------------------------- | ------------------------------------------------ |
| [`ubx explain`](/v1/cli/explain) | Plain-English explanation of your infrastructure |
| [`ubx fix`](/v1/cli/fix)         | Auto-fix validation errors using AI              |
| [`ubx suggest`](/v1/cli/suggest) | Generate `.iac` blocks from natural language     |
| [`ubx review`](/v1/cli/review)   | Security, cost, and best practices review        |
| [`ubx upgrade`](/v1/cli/upgrade) | Detect and apply deprecated resource upgrades    |

### State & Schema

| Command                          | Description                                   |
| -------------------------------- | --------------------------------------------- |
| [`ubx state`](/v1/cli/state)     | State management (`list`, `show`, `rm`, `mv`) |
| [`ubx schema`](/v1/cli/schema)   | Provider schemas (`sync`, `list`)             |
| [`ubx convert`](/v1/cli/convert) | Convert Terraform or Pulumi code to ubx       |

### Developer Tools

| Command                          | Description                         |
| -------------------------------- | ----------------------------------- |
| [`ubx test`](/v1/cli/test)       | Run `.test.iac` test files          |
| [`ubx console`](/v1/cli/console) | Interactive expression REPL         |
| [`ubx docs`](/v1/cli/docs)       | Open or list resource documentation |
| [`ubx graph`](/v1/cli/graph)     | Visualize resource dependency graph |

### Auth & Registry

| Command                                | Description                                |
| -------------------------------------- | ------------------------------------------ |
| [`ubx auth`](/v1/cli/auth)             | Configure cloud provider credentials       |
| [`ubx ai`](/v1/cli/ai)                 | Manage AI feature configuration            |
| [`ubx publish`](/v1/cli/publish)       | Publish a component to the Strata registry |
| [`ubx completion`](/v1/cli/completion) | Generate shell completion scripts          |
| [`ubx version`](/v1/cli/version)       | Show ubx version                           |

## Global Flags

| Flag              | Description                                               |
| ----------------- | --------------------------------------------------------- |
| `--config string` | Config file (default: `ubx.yaml` in project root)         |
| `--env string`    | Target environment (overrides `defaultEnv` in `ubx.yaml`) |
| `--stack string`  | Target stack name                                         |
| `--no-color`      | Disable color output                                      |

## Common Patterns

```bash theme={null}
ubx validate
ubx validate --compile
ubx plan --env prod
ubx apply --env staging
ubx apply --target unit.aws_s3_bucket_v2.assets
ubx apply --target unit.aws_rds_instance.db --target deploy.helm.backend
ubx output
ubx output --format json
ubx fmt
ubx test
ubx test --verbose
ubx explain
ubx explain --audience exec
ubx fix --dry-run
ubx fix --yes
ubx review --focus security --min-severity high
ubx upgrade --check
ubx state list
ubx state show aws_s3_bucket_v2.assets
```
