# state-config

Retrieve remote Terraform/OpenTofu state backend config

## Synopsis

Retrieves remote state and generates backend.tf and optional vars file for local Terraform/OpenTofu development based on the last deployment. Use this command to set up your local environment for working with the remote state. Optionally, you can specify an artifact ID to filter the artifacts in the deployment. (example - --artifact-id "aws\_\*") By default, it will try to find bricks.json in the current directory and use its name as a prefix for the artifact search.

```
bricks blueprint state-config [environment-slug] [flags]
```

## Examples

```
bricks bp state-config <environment-slug>
```

## Options

```
  -a, --artifact-id string   Glob search pattern for artifacts in the deployment.
```

## Options inherited from parent commands

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

## SEE ALSO

* [bricks blueprint](/docs/bricks-cli/cli-reference/bricks_blueprint.md) - Manage blueprints - create, publish, add dependencies, and configure packages


---

# 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/bricks_blueprint/bricks_blueprint_state-config.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.
