Skill: andrewharp/runpod (version 1.0.1)

--- name: runpod description: Manage RunPod GPU cloud instances - create, start, stop, connect to pods via SSH and API. Use when working with RunPod infrastructure, GPU instances, or need SSH access to remote GPU machines. Handles pod lifecycle, SSH proxy connections, filesystem mounting, and API queries. Requires runpodctl (brew install runpod/runpodctl/runpodctl). --- # RunPod Skill Manage RunPod GPU cloud instances, SSH connections, and filesystem access. ## Prerequisites ```bash brew install runpod/runpodctl/runpodctl runpodctl config --apiKey "your-api-key" ``` **SSH Key:** runpodctl manages SSH keys in `~/.runpod/ssh/`: ```bash runpodctl ssh add-key ``` View and manage keys at: https://console.runpod.io/user/settings **Mount script configuration:** The mount script checks `~/.ssh/runpod_key` first, then falls back to runpodctl's default key. Override with: ```bash export RUNPOD_SSH_KEY="$HOME/.runpod/ssh/RunPod-Key" ``` Host keys are stored separately in `~/.runpod/ssh/known_hosts` (isolated from your main SSH config). Uses [REDACTED_SECRET] to verify hosts on reconnect while allowing new RunPod instances. ## Quick Reference ```bash runpodctl get pod # List pods runpodctl get pod <id> # Get pod details runpodctl start pod <id> # Start pod runpodctl stop pod <id> # Stop pod runpodctl ssh connect <id> # Get SSH command runpodctl send <file> # Send file to pod runpodctl receive <code> # Receive file from pod ``` ## Common Operations ### Create Pod ```bash # Without volume runpodctl create pod --name "my-pod" --gpuType "NVIDIA GeForce RTX 4090" --imageName "runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404" # With volume (100GB at /workspace) runpodctl create pod --name "my-pod" --gpuType "NVIDIA GeForce RTX 4090" --imageName "runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404" --volumeSize 100 --volumePath "/workspace" ``` **Important:** When using a volume (`--volumeSize`), always specify `--volumePath` too. Without it: ``` error creating container: ... invalid mount config for type "volume": field Target must not be empty ``` ### SSH to Pod ```bash # Get SSH command runpodctl ssh connect <pod_id> # Connect directly (copy command from above) ssh -p <port> root@<ip> -i ~/.ssh/runpod_key ``` ### Mount Pod Filesystem (SSHFS) ```bash ./scripts/mount_pod.sh <pod_id> [base_dir] ``` Mounts pod to `~/pods/<pod_id>` by default. **Access files:** ```bash ls ~/pods/<pod_id>/ cat ~/pods/<pod_id>/workspace/my-project/train.py ``` **Unmount:** ```bash fusermount -u ~/pods/<pod_id> ``` ## Helper Script | Script | Purpose | |--------|---------| | `mount_pod.sh` | Mount pod filesystem via SSHFS (no runpodctl equivalent) | ## Web Service Access Proxy URLs: ``` https://<pod_id>-<port>.proxy.runpod.net ``` Common ports: - **8188**: ComfyUI - **7860**: Gradio - **8888**: Jupyter - **8080**: Dev tools

path: scripts/mount_pod.sh
content: #!/bin/bash
# Mount a RunPod pod's filesystem via SSHFS
# Usage: mount_pod.sh <pod_id> [base_dir]
# Default base_dir: $HOME/pods

POD_ID="$1"
BASE_DIR="${2:-$HOME/pods}"
MOUNT_PATH="$BASE_DIR/$POD_ID"
SSH_KEY="${RUNPOD_SSH_KEY:-$HOME/.ssh/runpod_key}"
RUNPOD_KNOWN_HOSTS="${RUNPOD_KNOWN_HOSTS:-$HOME/.runpod/ssh/known_hosts}"

# Fallback to runpodctl-generated key if default doesn't exist
if [ ! -f "$SSH_KEY" ] && [ -f "$HOME/.runpod/ssh/RunPod-Key" ]; then
    SSH_KEY="$HOME/.runpod/ssh/RunPod-Key"
fi

if [ -z "$POD_ID" ]; then
    echo "Usage: $0 <pod_id> [base_dir]"
    exit 1
fi

if [ ! -f "$SSH_KEY" ]; then
    echo "Error: SSH key not found"
    echo "Generate with runpodctl: runpodctl ssh add-key"
    echo "Or set custom path: export RUNPOD_SSH_KEY=\"\$HOME/.runpod/ssh/Your-Key\""
    exit 1
fi

mkdir -p "$BASE_DIR"
mkdir -p "$MOUNT_PATH"

if mount | grep -q "$MOUNT_PATH"; then
    echo "Already mounted at $MOUNT_PATH"
    exit 0
fi

echo "Getting SSH info for pod $POD_ID..."
SSH_CMD=$(runpodctl ssh connect "$POD_ID" 2>/dev/null | grep "ssh -p")

if [ -z "$SSH_CMD" ]; then
    echo "Error: Could not get SSH info. Is the pod running?"
    exit 1
fi

PORT=$(echo "$SSH_CMD" | grep -oP '(?<=-p )[0-9]+')
IP=$(echo "$SSH_CMD" | grep -oP '(?<=root@)[^ ]+')

echo "Mounting $POD_ID ($IP:$PORT) to $MOUNT_PATH..."

# Ensure known_hosts directory exists
mkdir -p "$(dirname "$RUNPOD_KNOWN_HOSTS")"

sshfs -p "$PORT" "root@$IP:/" "$MOUNT_PATH" \
  -o IdentityFile="$SSH_KEY" \
  -o UserKnownHostsFile="$RUNPOD_KNOWN_HOSTS" \
  -o StrictHostKeyChecking=accept-new \
  -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3

if [ $? -eq 0 ]; then
    echo "✅ Mounted at $MOUNT_PATH"
else
    echo "❌ Failed to mount"
    exit 1
fi


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: suspicious | SkillSpector: clean (LOW)