# CLI Reference

The `bricks` command-line interface lets DevOps and Platform teams manage Infrastructure-as-Code at scale -- from creating and publishing blueprints to deploying them across collections.

For installation and setup, see the [CLI Overview](https://bluebricks.co/docs/bricks-cli/bricks-cli).

{% hint style="info" %}
Run `bricks <command> --help` from your terminal to see usage details and available flags for any command.
{% endhint %}

## Core Workflow

The commands you will use most often when working with blueprints and deployments.

| Command                                                                                  | Description                                                  |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [bricks blueprint](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_blueprint) | Create, publish, version, and manage blueprints and packages |
| [bricks install](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_install)     | Deploy a blueprint to a collection                           |
| [bricks uninstall](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_uninstall) | Destroy a blueprint from a collection                        |
| [bricks run](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_run)             | Plan and apply resources locally or remotely                 |
| [bricks deploy](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_deploy)       | View and manage deployments                                  |
| [bricks updateci](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_updateci)   | Automate artifact and blueprint updates based on Git changes |

## Infrastructure Management

| Command                                                                                    | Description                                                   |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
| [bricks collection](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_collection) | Create, list, enable, disable, and delete collections         |
| [bricks clouds](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_clouds)         | Manage cloud provider accounts (AWS, GCP, Azure, Self-Hosted) |
| [bricks setup](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_setup)           | Register a customer cloud on Bluebricks                       |

## Authentication

Authenticate interactively or with long-lived API tokens for CI/CD. For a step-by-step guide, see [Authentication](https://bluebricks.co/docs/bricks-cli/authentication).

| Command                                                                            | Description                                    |
| ---------------------------------------------------------------------------------- | ---------------------------------------------- |
| [bricks login](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_login)   | Connect the CLI to a Bluebricks account        |
| [bricks logout](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_logout) | Disconnect from the current Bluebricks account |
| [bricks whoami](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_whoami) | Display the signed-in user                     |

For non-interactive environments (CI/CD pipelines, scripts), pass the `--api-key` flag or configure a [long-lived token](https://bluebricks.co/docs/bricks-cli/authentication/authenticate-using-long-lived-tokens).

## Utility

| Command                                                                                                                      | Description                                                         |
| ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [bricks logger](https://github.com/bluebricks-dev/Bluebricks-Documentation/blob/main/cli-reference/bricks_logger.md)         | Enable, disable, and manage CLI logging                             |
| [bricks telemetry](https://github.com/bluebricks-dev/Bluebricks-Documentation/blob/main/cli-reference/bricks_telemetry.md)   | Enable, disable, and check telemetry settings                       |
| [bricks completion](https://github.com/bluebricks-dev/Bluebricks-Documentation/blob/main/cli-reference/bricks_completion.md) | Generate shell autocompletion scripts (Bash, Zsh, Fish, PowerShell) |
| [bricks version](https://bluebricks.co/docs/bricks-cli/cli-reference/bricks_version)                                         | Print the CLI version                                               |

## Global Flags

Every command accepts the following flags:

```
      --api-key string    API key for authentication (overrides JWT)
      --config string     Config file (default: $HOME/.bricks/config.yaml)
  -h, --help              Print help message
      --non-interactive   Suppress interactive UI elements
  -v, --version           Print CLI version
```
