Modal CLI
$ modal Official High RiskModal CLI (modal) runs, deploys, and inspects serverless Python and GPU workloads on Modal, offering --json on app list, volume ls, secret list, and profile list, --env workspace isolation, and MODAL_TOKEN_ID / MODAL_TOKEN_SECRET auth.
pip install modal modal executes and mounts local Python modules directly onto remote GPU containers, which cannot be done cleanly via MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Inspection commands (app, volume, secret, profile) support --json, while modal run and modal deploy stream container logs.
- Supports
--jsonon inspection commands and--envisolation
--env isolation and ephemeral modal run lifecycle reduce lingering infra, though GPU runs can incur rapid billing.
- Ephemeral
modal runvs persistentmodal deploy;--envisolation
Simple pip install modal or uvx --from modal modal across platforms.
- PyPI
modalpackage anduvxcompatibility
Zero-YAML serverless Python/GPU execution directly from local files.
- Mounts local Python code into cloud containers seamlessly
Official modal-labs/modal-client updated frequently by Modal Labs.
- Official
modal-labs/modal-clientunder Apache-2.0
Well-documented CLI reference at modal.com/docs/reference/cli.
- Official Modal CLI reference
Security, Auth & Guardrails
Stores profiles in ~/.modal.toml, or reads MODAL_TOKEN_ID and MODAL_TOKEN_SECRET from the environment.
CLI is free (Apache-2.0); Modal GPU/CPU compute bills per second of execution.
# Modal CLI Agent Rules - Check `modal profile current` and pin `--env` explicitly before running or deploying. - Pass `--json` on `app list`, `volume list`, `secret list`, and `dict list`. - Prefer `modal run` (ephemeral) during testing; avoid GPU-heavy deploys without budget approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
modal app list --json
Lists running, stopped, and deployed Modal apps in structured JSON.
modal volume list --json
Lists persistent volumes and creation timestamps as JSON.
Controlled Writes & Previews
--env modal run --env dev train.py
Executes an ephemeral job that tears down automatically after completion inside dev.
Strengths for Agents
- +
--jsonavailable acrossapp,volume,secret, andprofilelisting commands. - +
--envisolates dev/staging/prod apps, secrets, and volumes cleanly. - + Fast
uvxorpipsetup withMODAL_TOKEN_ID/MODAL_TOKEN_SECRETenv auth.
Caveats & Pitfalls
- ! GPU workloads can rack up significant charges quickly if left running or looped.
- ! Lacks a dry-run preview mode for
modal deploy.