Skip to content

environments Command

The environments command allows you to manage environments defined in the .bruin.yml configuration file. It supports listing all available environments in the current Git repository and creating new ones.

Usage

bash
bruin environments [subcommand]

list Subcommand

Displays the environments defined in the .bruin.yml configuration file in the current Git repository. The environments can be displayed in plain text or JSON format.

Flags

FlagTypeDefaultDescription
--config-filestr-The path to the .bruin.yml file.

Usage

bash
bruin environments list [flags]

create Subcommand

Creates a new environment entry in the .bruin.yml configuration file.

Flags

FlagTypeDefaultDescription
--namestr-Name of the environment to create.
--schema-prefixstr-Optional schema prefix to use for the environment.
--config-filestr-The path to the .bruin.yml file.

Usage

bash
bruin environments create --name dev [--schema-prefix my_prefix]

clone Subcommand

Creates a copy of an existing environment with a new name. All connections from the source environment are copied to the target environment. Optionally allows setting or overriding the schema prefix for the cloned environment.

Flags

FlagTypeDefaultDescription
--source, -sstrDefault environmentName of the environment to clone from.
--target, -tstr-Required. Name of the new environment.
--schema-prefix, -pstr-Optional schema prefix for the cloned environment. If not provided, uses the source environment's schema prefix.
--output, -ostrplainOutput format: plain or json.
--config-filestr-The path to the .bruin.yml file.

Usage

bash
# Clone the default environment to a new environment
bruin environments clone --target staging

# Clone a specific environment to a new environment
bruin environments clone --source production --target staging

# Clone with a custom schema prefix
bruin environments clone --target dev --schema-prefix dev_

# Clone with JSON output
bruin environments clone --target test --output json

Examples

Clone the default environment:

bash
bruin environments clone --target staging

Clone a specific environment with a schema prefix:

bash
bruin environments clone --source production --target dev --schema-prefix dev_