# openrail environment

> Switch, create, sync and inspect environments.

Switch, create, sync and inspect environments.

## Usage

```sh
openrail environment [NAME]
openrail environment new NAME [--duplicate ENV]
openrail environment delete NAME
openrail environment rename NAME
openrail environment sync --from ENV
openrail environment config
openrail environment edit --service-config SVC DOT.PATH VALUE [--stage]
```

## Flags

| Flag | Meaning |
|---|---|
| `--duplicate ENV` | Copy services, settings and non-sealed variables from ENV (staged) |
| `--from ENV` | Source environment for sync |
| `--stage` | Stage the edit instead of committing it |

## Details

- `config` prints the environment's effective configuration as JSON.
- `edit` changes one setting, for example `deploy.replicas`, using the names in [Service settings](https://openrail.app/docs/reference/service-settings).

## Examples

```sh
openrail environment new staging --duplicate production
openrail environment edit --service-config api deploy.replicas 2
```

## Railway equivalent

`railway environment` works the same way through the [railway alias](https://openrail.app/docs/cli/railway-alias).

Every command also accepts the [global options](https://openrail.app/docs/cli/global-options).
