modal environment

Create and interact with Environments

Environments are sub-divisions of workspaces, allowing you to deploy the same app in different namespaces. Each environment has their own set of Secrets and any lookups performed from an app in an environment will by default look for entities in the same environment.

Typical use cases for environments include having one for development and one for production, to prevent overwriting production apps when developing new features while still being able to deploy changes to a live environment.

Usage:

modal environment [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • create: Create a new environment in the current workspace.
  • delete: Delete an environment in the current workspace.
  • list: List all environments in the current workspace.
  • members: Manage members and their roles in a restricted Environment.
  • update: Update environment-level settings.

Create a new environment in the current workspace.

Usage:

modal environment create [OPTIONS] NAME

Options:

  • --restricted: Enable RBAC restrictions on the new environment
  • --help: Show this message and exit.

Delete an environment in the current workspace.

Deletes all apps in the selected environment and deletes the environment irrevocably.

Usage:

modal environment delete [OPTIONS] NAME

Options:

  • -y, --yes: Run without pausing for confirmation.
  • --help: Show this message and exit.

List all environments in the current workspace.

Usage:

modal environment list [OPTIONS]

Options:

  • --json
  • --help: Show this message and exit.

Manage members and their roles in a restricted Environment.

Restricted Environments use RBAC to limit the actions that can be performed by users (and service users) based on roles: https://modal.com/docs/guide/rbac.

Usage:

modal environment members [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • list: List the members of a restricted Environment
  • remove: Remove a member from a restricted Environment
  • update: Add or update a member’s role in a restricted Environment

List the members of a restricted Environment

Usage:

modal environment members list [OPTIONS] ENVIRONMENT

Options:

  • --json
  • --help: Show this message and exit.

Remove a member from a restricted Environment

Usage:

modal environment members remove [OPTIONS] ENVIRONMENT MEMBER

Options:

  • --service-user: Treat MEMBER as the name of a service user
  • --help: Show this message and exit.

Add or update a member’s role in a restricted Environment

Usage:

modal environment members update [OPTIONS] ENVIRONMENT MEMBER

Options:

  • --role [contributor|viewer]: Role to assign to the member [required]
  • --service-user: Treat MEMBER as the name of a service user
  • --help: Show this message and exit.

Update environment-level settings.

Usage:

modal environment update [OPTIONS] CURRENT_NAME

Options:

  • --set-name TEXT: New name of the environment
  • --set-web-suffix TEXT: New web suffix of environment (empty string is no suffix)
  • --help: Show this message and exit.