xnatcli login¶
Interactively collects credentials, verifies them against the server, and writes them to disk.
- Prompts for the XNAT server URL in plain text (e.g.,
https://xnat-server.domain.edu). - Prompts for the username in plain text.
- Prompts for the password via
getpass.getpassso the characters are not echoed. - Connects to the server with PyXNAT and performs an authenticated request (
select.projects().get()) to verify the credentials. Auth failures, connection failures, and other errors exit with distinct messages. - On success, writes
~/.xnatcli/credentials.cfgwith mode0o600.
Re-running xnatcli login overwrites the stored credentials.