cryosparcm cli reference (v5.0+)
How to use CryoSPARC's low-level command line interface to perform actions that can be performed in the UI.
Accessing the command line interface
CryoSPARC exposes nearly all actions that can be taken in the user interface through a command-line interface (CLI) for programatic operation. The CLI can be used to query information about jobs, projects, users, etc. from a CryoSPARC instance, or to take actions such as creating projects, queueing jobs, etc. Each CLI command is a Python expression, in the format api.FUNCTION(...) or api.NAMESPACE.FUNCTION(...) , where ... is a list of function arguments.
The CLI can be called in three ways:
From
bashor other shells,cryosparcm cli "EXPRESSION"can be used to easily execute a single command. For example:cryosparcm cli "api.jobs.enqueue('P3', 'J42', lane='default')"Using CryoSPARC’s built-in interactive shell that is started by calling
cryosparc icli. Once the interactive shell is started, Python code can be executed directly:$ cryosparcm icli Connected to cryoem0.sbi:61002 api, db, gfs ready to use In [1]: api.jobs.enqueue('P3', 'J42', lane='default') In [2]:Using the standalone
cryosparc-toolspython package in a Python script, for example:from cryosparc.tools import CryoSPARC cs = CryoSPARC(...) cs.api.jobs.enqueue('P3', 'J42', lane='default')
Available CLI commands
The CryoSPARC CLI exposes Python functions of the form api.FUNCTION(...) or api.NAMESPACE.FUNCTION(...) , where ... is a list of function arguments.
All available NAMESPACE options (e.g., projects, jobs) and namespace-specific FUNCTION options (e.g., find_one, create) and their arguments are listed and documented in the cryosparc-tools documentation for the CryoSPARC API:
The format and arguments of cryosparcm cli commands may change from one CryoSPARC version to the next. The documentation for the API linked above will be updated with each CryoSPARC release.
In addition to the CLI described here, the cryosparc-tools Python package provides an additional method for writing custom cryo-EM data processing scripts and workflow automation scripts. cryosparc-tools implements a subset of the commands that are available via the CLI.
Last updated