# 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](/docs/bricks-cli/bricks-cli.md).

{% 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](/docs/bricks-cli/cli-reference/bricks_blueprint.md) | Create, publish, version, and manage blueprints and packages |
| [bricks install](/docs/bricks-cli/cli-reference/bricks_install.md)     | Deploy a blueprint to a collection                           |
| [bricks uninstall](/docs/bricks-cli/cli-reference/bricks_uninstall.md) | Destroy a blueprint from a collection                        |
| [bricks run](/docs/bricks-cli/cli-reference/bricks_run.md)             | Plan and apply resources locally or remotely                 |
| [bricks deploy](/docs/bricks-cli/cli-reference/bricks_deploy.md)       | View and manage deployments                                  |
| [bricks updateci](/docs/bricks-cli/cli-reference/bricks_updateci.md)   | Automate artifact and blueprint updates based on Git changes |

## Infrastructure Management

| Command                                                                  | Description                                                   |
| ------------------------------------------------------------------------ | ------------------------------------------------------------- |
| [bricks collection](/docs/bricks-cli/cli-reference/bricks_collection.md) | Create, list, enable, disable, and delete collections         |
| [bricks clouds](/docs/bricks-cli/cli-reference/bricks_clouds.md)         | Manage cloud provider accounts (AWS, GCP, Azure, Self-Hosted) |
| [bricks setup](/docs/bricks-cli/cli-reference/bricks_setup.md)           | 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](/docs/bricks-cli/authentication.md).

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

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

## 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](/docs/bricks-cli/cli-reference/bricks_version.md)                                                           | 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bluebricks.co/docs/bricks-cli/cli-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
