# NEXUS AI Environments

Deployments and secrets carry an environment label so development, staging, and production stay separate.

## Deployment environments

Every deployment has one of `DEVELOPMENT`, `STAGING`, or `PRODUCTION`. The CLI defaults to `DEVELOPMENT`:

```bash
nexus deploy source --repo https://github.com/you/app --name my-app --environment PRODUCTION
```

The API field is `environment` on `POST /deploy`, `POST /deploy/source`, and the platform deployment routes.

## Keep environments isolated

Deploy each environment of the same repository into its own project (`--project <id>`, or `projectId` in the API). Deployments of the same source in the same project can overwrite each other.

## Secrets per environment

Secrets are stored per environment name, for example `PRODUCTION`. A project's `vaultEnvironment` decides which environment's secrets its deployments receive.

```bash
nexus secret create --name DATABASE_URL --environment PRODUCTION
nexus secret list --environment PRODUCTION
```

Secret values are injected when a container starts, so redeploy after changing one.

## Related resources

- [Deployment](/docs/deployment.md)
- [Projects](/docs/projects.md)
- [Security](/docs/security.md)
