chrs
is a command-line client for
ChRIS.
It can upload files to ChRIS library, download files from ChRIS,
and can run and feeds (computational experiments) on ChRIS.
There are two ways to install chrs
.
You can download chrs
from
Github Releases.
Get the latest version here:
https://github.com/FNNDSC/chrs/releases/latest
This is the easiest installation method, however there is no mechanism for automatic updates.
Use cargo to get and build the package from crates.io:
shell
cargo install chrs
If necessary, add the bin
folder to $PATH
:
shell
echo 'export PATH=$HOME/.cargo/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
chrs
Run chrs --help
for usage information.
Note: when specifying URLs, they should be to the backend API, not the front-end.
E.g. instead of https://app.chrisproject.org/feeds/1520
, the correct URL would
be https://cube.chrisproject.org/api/v1/1520/
.
shell
chrs --address https://cube.chrisproject.org/api/v1/ --username chris --password chris1234 login
chrs upload my_data/
chrs login
chrs login
saves authentication tokens securely using your
keyring. Logging into multiple
different instances of ChRIS is supported, or as different users
on the same ChRIS instance.
```shell
chrs --address https://cube.chrisproject.org/api/v1/ login
chrs --address https://cube.chrisproject.org/api/v1/ --username test-user login --no-keyring --password-stdin <<< "$PASSWORD" ```
chrs logout
Remove previously saved authentication token(s).
```shell
chrs --address https://cube.chrisproject.org/api/v1/ logout
chrs logout ```
chrs feeds
List or search existing feeds.
shell
$ chrs feeds
COVID-NET analysis on patient ABCD chris/feed_1891
SPL visualization chris/feed_1890
LLD test 3 chris/feed_1889
Subplate surfaces surface_fit parameter schedule jennings/feed_1888
Preprocess data from henry jennings/feed_1887
chrs ls PATH
List files and directories in ChRIS.
```shell
$ chrs ls --tree -L 4 chris/feed1443 chris/Segmented volume data analysis └── pl-dircopy5827 ├── data │ ├── output.meta.json │ ├── input.meta.json │ └── aparc.a2009saseg.mgz └── generate volume report └── data ├── output.meta.json ├── mgz2LUTreport.pdf ├── mgz2LUTreport.html └── input.meta.json
$ chrs ls --tree -L 4 --full --raw chris/feed1443 chris/feed1443 └── chris/feed1443/pl-dircopy5827 ├── chris/feed1443/pl-dircopy5827/data │ ├── chris/feed1443/pl-dircopy5827/data/output.meta.json │ ├── chris/feed1443/pl-dircopy5827/data/input.meta.json │ └── chris/feed1443/pl-dircopy5827/data/aparc.a2009saseg.mgz └── chris/feed1443/pl-dircopy5827/pl-mgz2LUTreport5836 └── chris/feed1443/pl-dircopy5827/pl-mgz2LUTreport5836/data ├── chris/feed1443/pl-dircopy5827/pl-mgz2LUTreport5836/data/output.meta.json ├── chris/feed1443/pl-dircopy5827/pl-mgz2LUTreport5836/data/mgz2LUTreport.pdf ├── chris/feed1443/pl-dircopy5827/pl-mgz2LUTreport5836/data/mgz2LUTreport.html └── chris/feed1443/pl-dircopy5827/pl-mgz2LUTreport5836/data/input.meta.json ```
chrs upload FILE...
Upload files and run workflows.
```shell
chrs upload onefile.txt anotherfile.txt
chrs upload my_data/
chrs upload --feed "Tractography Study" my_data/
chrs upload --feed "Surface Extraction" \ --pipeline "Fetal Brain Surface Extraction v1.0.0" \ my_data/ ```
chrs download SRC [DST]
Download files from ChRIS.
```shell
chrs download https://cube.chrisproject.org/api/v1/15/files/
chrs download --shorten https://cube.chrisproject.org/api/v1/plugins/instances/5551/files/ my_outputs
chrs download chris/uploads/fetaldataset chrs download SERVICES/PACS/orthanc/9cfafb0-DIXONSHANNON_ANON-20140701
chrs download --flatten chris/feed14 feed14outputs ```
chrs run-latest
Run a ChRIS plugin (i.e. create a plugin instance) by name.
```shell
chrs run-latest pl-mri10yr06mo01da_normal
chrs run-latest --memory-limit 2Gi --compute-resource-name moc --previous-id 56 pl-mri-preview -- --units-fallback mm ```
Note: since plugin version is not specified when using chrs run-latest
,
the parameters are subject to change. chrs run
(not yet implemented)
is preferable for the sake of reproducibility.
A plugin's parameters help can be viewed, e.g. for pl-mri-preview
,
by running chrs plugin-help pl-mri-preview
chrs get
Make an authenticated HTTP GET request.
As chrs
is still under development, many functions are still unavailable.
Advanced users can use chrs get
to query the CUBE API directly.
```shell
cargo run -- get https://cube.chrisproject.org/api/v1/12/plugininstances/ | jq -r '.results[] | .plugin_name' ```
chrs pipeline-file add
Uploads a file-representation of a ChRIS pipeline. Supported file formats are:
plugin_tree
may be either a string (canonical) or an object)shell
chrs pipeline-file add chris/tests/data/pipelines/fetal_brain_reconstruction_expanded.json
chrs pipeline-file convert
Convert between supported pipeline file formats.
shell
chrs pipeline-file convert pipeline.json pipeline.yml
Please report bugs and/or request features here: https://github.com/FNNDSC/chrs/issues