Slurm CLI
A CLI tool for Slurm cluster management with autocomplete functionality.
Features
- Interactive command-line interface for Slurm cluster management via slurm commands wrapping
- Autocomplete support for commands and parameters
- Support for managing partitions, nodes, jobs, users, QoS, accounts, and reservations
- Rich console output with colored and formatted text
- Fast fuzzy matching for autocomplete suggestions
Installation
From PyPI
The easiest way to install slurm-cli is using pip:
pip install slurm-cli
From Source
To install from source:
# Clone the repository
git clone https://github.com/zhum/slurm-cli.git
cd slurm-cli
# Install dependencies using Poetry
poetry install
# Activate the virtual environment
poetry shell
Development Setup
For development, you'll also want to install the development dependencies:
poetry install --with dev
poetry run pre-commit install
Usage
Run the CLI tool:
slurm-cli
Or with Poetry:
poetry run slurm-cli
Autocomplete Setup
To enable bash autocompletion for this command:
- Install the completion script:
eval "$(_CLICK_COMPLETE=bash_source slurm-cli)"
-
Add the above line to your
~/.bashrcor~/.bash_profileto make it permanent. -
Restart your shell or run:
source ~/.bashrc
Alternatively, you can generate a completion script file:
_CLICK_COMPLETE=bash_source slurm-cli > \
~/.local/share/bash-completion/completions/slurm-cli
Development
Autocomplete
See AUTOCOMPLETE.md for implementation and development details.
Running Tests
poetry run pytest
# or with coverage
poetry run pytest --cov=slurm_cli
Code Formatting
poetry run black src tests
poetry run isort src tests
Type Checking
poetry run mypy src/
All Checks
make check
# or
poetry run tox
Building Documentation
make docs
# or
poetry run mkdocs build
# Serve locally
make docs-serve
# or
poetry run mkdocs serve
# Then open http://localhost:8000
Project Structure
slurm-cli/
├── src/
│ └── slurm_cli/ # Main package
│ ├── __init__.py
│ ├── cli.py # CLI entry point
│ └── utils/ # Utility functions
├── tests/ # Test files
├── docs/ # Documentation
├── pyproject.toml # Poetry configuration
├── Makefile # Development commands
├── tox.ini # Multi-environment testing
├── .pre-commit-config.yaml # Pre-commit hooks
└── README.md # This file
Requirements
- Python 3.9 or higher
- Slurm cluster environment
- Required Python packages (automatically installed):
- click>=8.1.0
- rich>=13.0.0
- fast-autocomplete[levenshtein]>=0.9.0
- rapidfuzz>=3.13.0
License
MIT License - see the LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
Changelog
See CHANGELOG.md for a list of changes.
Metadata
Release files for slurm-cli 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| slurm_cli-1.0.2.tar.gz | 107.8 kB | Without provenance | Details for slurm_cli-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| slurm_cli-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for slurm_cli-1.0.2-py3-none-any.whl |
Total release size: 231.9 kB
Release files / slurm_cli-1.0.2.tar.gz
| Download URL | slurm_cli-1.0.2.tar.gz |
|---|---|
| Size | 107.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89c427edcccfdcf900029feed0f10f3f34a7ff984902597e52e53573e03944a3
|
|
BLAKE2b-256 checksum How to use checksums |
382950f177c0b1c02e1dd56703d36c5e956b5e2064601945ac9fd24bdec734b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.12.3 Linux/6.17.0-23-generic
|
Release files / slurm_cli-1.0.2-py3-none-any.whl
| Download URL | slurm_cli-1.0.2-py3-none-any.whl |
|---|---|
| Size | 124.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a6e3a5b0bf7fe60d3c237ee15f7a1b5138f54d3975fdae36f561b66ce2bc337
|
|
BLAKE2b-256 checksum How to use checksums |
d66a6306f14ffacd723f18cb274ae79a380fe5714418378ddad5d25b0b7f8966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.12.3 Linux/6.17.0-23-generic
|
Security for slurm-cli 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.