> For the complete documentation index, see [llms.txt](https://guide.cryosparc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cryosparc.com/setup-configuration-and-management/management-and-monitoring-v5.0/cryosparcm-cli-reference-v5.0.md).

# 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](https://www.python.org) 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:

1. From `bash` or other shells, `cryosparcm cli "EXPRESSION"` can be used to easily execute a single command. For example:

   ```bash
   cryosparcm cli "api.jobs.enqueue('P3', 'J42', lane='default')"
   ```
2. Using CryoSPARC’s built-in interactive shell that is started by calling `cryosparcm icli`. Once the interactive shell is started, Python code can be executed directly:

   ```python
   $ cryosparcm icli

   Connected to cryoem0.sbi:61002
   api, db, gfs ready to use

   In [1]: api.jobs.enqueue('P3', 'J42', lane='default')

   In [2]:
   ```
3. Using the standalone [`cryosparc-tools`](http://tools.cryosparc.com) python package in a Python script, for example:

   ```python
   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:

{% embed url="<https://tools.cryosparc.com/api/cryosparc.api.html>" %}

{% hint style="warning" %}
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](https://tools.cryosparc.com) 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.
{% endhint %}
