Skip to main content

Usage

cassian exec <command> [options]
cassian exec "python train.py --epochs 50"
cassian exec -d "python long_training.py"
cassian exec -i my-instance "nvidia-smi"
Pushes your local files to /workspace, runs the command, and prints stdout/stderr. Exits with the command’s exit code.

Options

FlagDescriptionDefault
--timeout <seconds>Max execution time3600
--no-syncSkip file push before runningfalse
-d, --detachRun in background, return immediatelyfalse
-w, --workdir <path>Working directory inside the container/workspace
-i, --instance <name>Target instance by name (no cassian.yaml needed)

Background execution

Use --detach for long-running jobs. You get your terminal back immediately.
cassian exec -d "python train.py --epochs 500"
# ✓ Running in background (task: a1b2c3d4)
#   View output: cassian logs

Running without a project directory

-i / --instance lets you target any instance from anywhere:
cassian exec -i my-training-run "nvidia-smi"
cassian exec -i my-training-run --no-sync "tail -f /workspace/train.log"
Useful for monitoring, CI scripts, and AI agents that manage instances on your behalf.

Working directory

# Run tests from a specific subdirectory
cassian exec -w /workspace/src "pytest tests/"

# Default is /workspace
cassian exec "ls"

What gets pushed

Only default (hot) files. Folders under no_sync, storage, and exclude in your cassian.yaml are skipped. Sync output is shown before the command runs:
  Syncing 3 files...
  Synced 3 files (12KB)
You’ll get a warning above 500MB. The hard limit is 2GB — above that, add excludes or move files to /workspace/storage.

Examples

# Training
cassian exec "python train.py --epochs 50"

# Background job
cassian exec -d "python sweep.py"

# Check GPU without pushing
cassian exec --no-sync "nvidia-smi"

# Run from a specific directory
cassian exec -w /workspace/experiments "python run.py"

# Monitor another instance from anywhere
cassian exec -i training-run --no-sync "tail -f /workspace/loss.log"