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.
modal environment create
Create a new environment in the current workspace.
Usage:
modal environment create [OPTIONS] NAMEOptions:
--restricted: Enable RBAC restrictions on the new environment--help: Show this message and exit.
modal environment delete
Delete an environment in the current workspace.
Deletes all apps in the selected environment and deletes the environment irrevocably.
Usage:
modal environment delete [OPTIONS] NAMEOptions:
-y, --yes: Run without pausing for confirmation.--help: Show this message and exit.
modal environment list
List all environments in the current workspace.
Usage:
modal environment list [OPTIONS]Options:
--json--help: Show this message and exit.
modal environment members
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 Environmentremove: Remove a member from a restricted Environmentupdate: Add or update a member’s role in a restricted Environment
modal environment members list
List the members of a restricted Environment
Usage:
modal environment members list [OPTIONS] ENVIRONMENTOptions:
--json--help: Show this message and exit.
modal environment members remove
Remove a member from a restricted Environment
Usage:
modal environment members remove [OPTIONS] ENVIRONMENT MEMBEROptions:
--service-user: Treat MEMBER as the name of a service user--help: Show this message and exit.
modal environment members update
Add or update a member’s role in a restricted Environment
Usage:
modal environment members update [OPTIONS] ENVIRONMENT MEMBEROptions:
--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.
modal environment update
Update environment-level settings.
Usage:
modal environment update [OPTIONS] CURRENT_NAMEOptions:
--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.