Hi all,
I wanted to share an open-source tool I’ve been building:
xnatctl, a command-line interface for XNAT administration and day-to-day ops from your terminal.
If you've ever found yourself writing one-off curl commands against the XNAT REST API, chaining together shell scripts for batch downloads, or wishing you had something like the AWS CLI but for XNAT -- this is for that.
xnatctl is CLI-first and organized around resource-centric commands with consistent output formats and safe batch operations, so you can script common workflows without hand-rolling REST calls each time.
What it does
- Resource-centric commands that match how you think about XNAT: xnatctl project list, xnatctl session download, xnatctl scan show, etc.
- Profile-based configuration to switch between dev/prod/collaboration servers
- Parallel batch uploads and downloads with progress tracking
- Script-friendly output: --output json|table, plus --quiet for IDs only
- Session token caching -- log in once with xnatctl auth login and reuse the session automatically
- Prearchive management, pipeline execution, raw API access as an escape hatch, and optional DICOM utilities
How it differs from pyxnat/xnatpy:
pyxnat and xnatpy are Python libraries designed to be imported into your own scripts and applications. They're the right choice when you're building a processing pipeline or need programmatic access to XNAT from Python. xnatctl is CLI-first -- it's for
interactive exploration, shell scripting, and day-to-day admin tasks without writing a Python program.
How it differs from xnatpy's CLI and xnatutils:
Both xnatutils and xnatpy ship their own command-line tools, and they work well for common tasks like downloading scans or listing projects. xnatctl aims to go further (thanks to the comprehensive API endpoints avilable) in two ways: broader scope (prearchive management, pipeline execution, admin operations, DICOM utilities) and UX consistency -- every command follows a uniform <resource> <action> pattern with the same --output json|table, --quiet, and --dry-run flags. It also supports named server profiles for switching between environments, parallel batch operations with progress tracking, and ships as a standalone binary (no Python required) and Docker image for CI.
It's early and under active development, so I'd really appreciate feedback, bug reports, and feature requests -- especially from folks doing a lot of command-line work with their XNAT instances.
Thanks,
Ricky W.