modal shell

Run an interactive shell inside a Modal image.


Start a bash shell using the spec for my_function in your stub:

modal shell

Note that you can select the function interactively if you omit the function name.

Start a python shell:

modal shell --cmd=python


modal shell [OPTIONS] FUNC_REF


  • FUNC_REF: Path to a Python file with a Stub or Modal function whose container to run. [required]


  • --cmd TEXT: Command to run inside the Modal image. [default: /bin/bash]
  • --help: Show this message and exit.