modal volume

Read and edit shared volumes.

Usage:

modal volume [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • create: Create a named shared volume.
  • get: Download a file from a shared volume.
  • list: List the names of all shared volumes.
  • ls: List files and directories in a shared…
  • put: Upload a file or directory to a shared…
  • rm: Delete a file or directory from a shared…

Create a named shared volume.

Usage:

modal volume create [OPTIONS] NAME

Arguments:

  • NAME: [required]

Options:

  • --cloud TEXT: Cloud provider to create the volume in. One of aws|gcp. [default: aws]
  • --help: Show this message and exit.

Download a file from a shared volume.

Specifying a glob pattern (using any * or ** patterns) as the remote_path will download all matching files, preserving the source directory structure for the matched files.

For example, to download an entire shared volume into dump_volume:

modal volume get <volume-name> "**" dump_volume

Use ”-” (a hyphen) as LOCAL_DESTINATION to write contents of file to stdout (only for non-glob paths).

Usage:

modal volume get [OPTIONS] VOLUME_NAME REMOTE_PATH [LOCAL_DESTINATION]

Arguments:

  • VOLUME_NAME: [required]
  • REMOTE_PATH: [required]
  • [LOCAL_DESTINATION]: [default: .]

Options:

  • --force / --no-force: [default: no-force]
  • --help: Show this message and exit.

List the names of all shared volumes.

Usage:

modal volume list [OPTIONS]

Options:

  • --help: Show this message and exit.

List files and directories in a shared volume.

Usage:

modal volume ls [OPTIONS] VOLUME_NAME [PATH]

Arguments:

  • VOLUME_NAME: [required]
  • [PATH]: [default: /]

Options:

  • --help: Show this message and exit.

Upload a file or directory to a shared volume.

Remote parent directories will be created as needed.

Ending the REMOTE_PATH with a forward slash (/), it’s assumed to be a directory and the file will be uploaded with its current name under that directory.

Usage:

modal volume put [OPTIONS] VOLUME_NAME LOCAL_PATH [REMOTE_PATH]

Arguments:

  • VOLUME_NAME: [required]
  • LOCAL_PATH: [required]
  • [REMOTE_PATH]: [default: /]

Options:

  • --help: Show this message and exit.

Delete a file or directory from a shared volume.

Usage:

modal volume rm [OPTIONS] VOLUME_NAME REMOTE_PATH

Arguments:

  • VOLUME_NAME: [required]
  • REMOTE_PATH: [required]

Options:

  • -r, --recursive: Delete directory recursively
  • --help: Show this message and exit.