Skip to content

Repository files navigation

herdr-slurm

Make ordinary new Herdr tabs inherit the Slurm allocation already used in their Space and expose the selected in-job agent's activity to Herdr.

The plugin does not watch squeue, create Spaces automatically, or persist job-to-Space state. Instead, it reacts to Herdr's native new-tab event and reads srun --jobid=<job-id> from an existing sibling pane in the same Space.

A new tab inheriting Slurm job 2875600

Requirements

  • Linux login node with squeue and srun
  • Herdr 0.7.0 or newer
  • Python 3.8 or newer

No Python packages are required.

Install

herdr plugin install quan-meng/herdr-slurm

For development, link a checkout instead:

git clone https://github.com/quan-meng/herdr-slurm.git
cd herdr-slurm
herdr plugin link "$PWD"

Use

Start from a Herdr tab whose process tree contains an attachment such as:

srun --jobid=2875600 --pty --overlap zsh -l

Create a tab with Herdr's ordinary new-tab command. If exactly one Slurm job ID is present in the Space's existing panes, the plugin replaces the new tab's login shell with one prompt:

Slurm allocation shell · job 2875600
Agent [none]:

Press Enter or enter none for a native shell without an agent hint. Enter claude, codex, or any other name to set HERDR_AGENT=<name> on the host-side srun process. The interface uses terminal colors when supported and respects NO_COLOR. It clears the new tab's initial prompt, command echo, and scrollback before rendering the interface.

Split panes are left unchanged. Spaces without a detectable job ID are also left unchanged. If different sibling panes contain different job IDs, the plugin does nothing rather than choose an ambiguous allocation.

Configure

Find the per-user configuration directory:

herdr plugin config-dir io.github.quan-meng.herdr-slurm

See config.example.json for the available settings.

About

Create Herdr workspaces and monitored agent tabs for Slurm allocations

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages