Skip to main content

lium exec

Execute a command on one or more pods.

lium exec TARGETS [COMMAND] [OPTIONS]

Arguments​

  • TARGETS — Pod name, index, comma-separated list, or all.
  • COMMAND — The command to execute. Optional when you pass --script.

Options​

FlagEffect
--script, -s PATHExecute a local script file on the pod(s) instead of an inline command
--env, -e KEY=VALUESet an environment variable for the command (repeatable)

Examples​

lium exec my-pod "python train.py"
lium exec 1 "nvidia-smi"
lium exec 1,2,3 "apt update" # Multiple pods
lium exec all "pip install numpy" # Every running pod
lium exec my-pod --script ./setup.sh # Run a local script
lium exec my-pod -e WANDB_MODE=offline "python train.py"

See also​

  • lium ssh — interactive shell
  • lium scp — push code first, then exec