Save SLURM
srundefaults per project and launch interactive shells without retyping long commands.
sdeb is a small CLI for interactive SLURM sessions. It stores the account, partition, node, time, memory, CPU count, GPU request, and PTY command you normally pass to srun, then reuses them with one command.
Interactive SLURM commands get long quickly:
srun --partition=debug -w compute-01 --account=my_account --time=00:20:00 --mem=8G --cpus-per-task=8 --gres=gpu:1 --pty bashWith sdeb, save that once as a project:
sdeb init myproj
sdebThen override only what changes:
sdeb --time 01:00:00
sdeb --gpu 2
sdeb --cpuNo root. No sudo. Works anywhere Python can install command-line tools into your user environment.
curl -LsSf https://astral.sh/uv/install.sh | sh # install uv itself once
uv tool install git+https://github.com/e-candeloro/sdebIf uv warns that the tool directory is not on PATH, either run:
uv tool update-shellor install into a known user bin directory that is already on PATH:
UV_TOOL_BIN_DIR="$HOME/.local/bin" uv tool install git+https://github.com/e-candeloro/sdebWhen installing from a Snap-packaged editor terminal, $HOME can point inside the Snap sandbox. In that case, install from a normal terminal or set UV_TOOL_BIN_DIR to your real user bin directory, for example /home/$USER/.local/bin.
Upgrade later:
uv tool upgrade sdebpython3 -m pip install --user pipx
pipx install git+https://github.com/e-candeloro/sdebUpgrade later:
pipx upgrade sdebCreate a project. The SLURM account is required.
sdeb init myprojRun the active project:
sdebPreview the exact srun command without launching it:
sdeb --dry-runGet task-oriented help:
sdeb help
sdeb project helpSaved projects live in ~/.config/sdeb/config.json or $XDG_CONFIG_HOME/sdeb/config.json.
sdeb project list # list projects; active project is marked with '*'
sdeb project new gpu-test # create from built-in defaults
sdeb project edit myproj # edit an existing project
sdeb project copy myproj # creates myproj-copy, or myproj-copy-2 if needed
sdeb project copy myproj long-job # copy to an explicit name
sdeb project use myproj # switch active project
sdeb project remove myproj # remove one project, with confirmation
sdeb project remove --all # remove all settings, with confirmationConvenience aliases:
sdeb projects # same as: sdeb project list
sdeb use myproj # same as: sdeb project use myproj
sdeb purge # same as: sdeb project remove --all
sdeb clean # same as: sdeb project remove --allUse a project without switching the active project:
sdeb --project myprojOverride SLURM resources for a single run:
sdeb --partition debug
sdeb --node compute-01
sdeb --account my_account
sdeb --time 01:00:00
sdeb --mem 16G
sdeb --cpus-per-task 16Choose CPU or GPU mode for a single run:
sdeb --cpu # force CPU-only; no --gres is emitted
sdeb --gpu # force one GPU; emits --gres=gpu:1
sdeb --gpu 2 # force two GPUs; emits --gres=gpu:2Invalid combinations are rejected:
sdeb --cpu --gpu 2
sdeb --gpu 0Show the installed version:
sdeb --versionA project configured with account my_account, partition debug, node compute-01, 20 minutes, 8 GB RAM, 8 CPUs, and one GPU generates:
srun --partition=debug -w compute-01 --account=my_account --time=00:20:00 --mem=8G --cpus-per-task=8 --gres=gpu:1 --pty bashCPU override removes the GPU request:
sdeb --cpu --dry-run
# srun --partition=debug -w compute-01 --account=my_account --time=00:20:00 --mem=8G --cpus-per-task=8 --pty bashsdeb project remove <name>asks before deleting a project.- If the active project is removed,
sdebautomatically activates another remaining project and lists what is left. sdeb project remove --all,sdeb purge, andsdeb cleanask before deleting the config file.sdeb --dry-runprints the command and never launches SLURM.
git clone https://github.com/e-candeloro/sdeb
cd sdeb
uv tool install -e .
sdeb helpRun from a checkout without installing:
PYTHONPATH=src python3 -m sdeb.cli helpUse a temporary config while testing:
XDG_CONFIG_HOME=/tmp/sdeb-test PYTHONPATH=src python3 -m sdeb.cli init test
XDG_CONFIG_HOME=/tmp/sdeb-test PYTHONPATH=src python3 -m sdeb.cli --dry-runsrc/sdeb/
├── __init__.py # package version
└── cli.py # argument parsing, config, prompts, and srun command building
README.md # user documentation
pyproject.toml # package metadata and console script
