The Modal CLI provides commands for deploying, managing, and monitoring your applications. Access it viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/modal-labs/modal-client/llms.txt
Use this file to discover all available pages before exploring further.
modal or python -m modal.
Global options
Core commands
modal run
Run a Modal app or function from a Python file:Path to Python file or module to run. Can include
::function_name to run a specific function.Environment name to run in (e.g., “staging”, “production”)
Run the app in detached mode (don’t stream logs)
modal deploy
Deploy a Modal app:Path to Python file or module to deploy
Name for the deployment
Environment to deploy to
modal serve
Run a Modal app in development mode with auto-reload:Path to Python file or module to serve
Timeout in seconds for idle containers
modal shell
Open an interactive shell in a Modal container:Container image to use
GPU type to attach (e.g., “T4”, “A10G”, “A100”)
Number of CPU cores
Memory in MB
App management
modal app list
List deployed and running apps:Filter by environment
Output as JSON
modal app logs
Stream logs from a running app:App name or ID (format:
ap-*)Include timestamps in log output
Environment name
modal app stop
Stop a running app:Storage management
modal volume
Manage persistent volumes:modal dict
Manage distributed dictionaries:modal secret
Manage secrets:modal queue
Manage queues:Configuration
modal token
Manage authentication tokens:modal profile
Manage authentication profiles:modal config
Manage Modal configuration:modal environment
Manage deployment environments:Observability
modal dashboard
Open the Modal dashboard in your browser:modal billing
View billing information:modal changelog
View Modal changelog:Container management
modal container
Manage running containers:Setup and initialization
modal setup
Bootstrap Modal configuration (same asmodal token new):
- Opens your browser for authentication
- Creates a new authentication token
- Saves credentials to
~/.modal.toml
Advanced commands
modal launch
Launch common development tools:modal nfs
Manage network file systems (hidden command):NetworkFileSystem commands are available but not shown in help by default.
Environment variables
The Modal CLI respects these environment variables:MODAL_ENVIRONMENT- Default environment for deploymentsMODAL_PROFILE- Default authentication profileMODAL_TOKEN_ID- Token ID to use for authenticationMODAL_TOKEN_SECRET- Token secret for authentication
Exit codes
The Modal CLI uses standard exit codes:0- Success1- General error2- Command-line usage error
Getting help
Every command supports the--help flag:
Examples
Deploy an app to production
Deploy an app to production
Debug a running app
Debug a running app
Manage data in volumes
Manage data in volumes
Work with multiple environments
Work with multiple environments
Next steps
Basic usage
Learn how to write Modal functions
API reference
Explore the Python API