Note
This documentation is for the new OMERO 5.1. version. See the latest OMERO 5.0.x version or the previous versions page to find documentation for the OMERO version you are using if you have not upgraded yet.
See also
Help for any specific CLI command can be displayed using the -h argument. See Command line help for more information.
The omero obj command allows to create and update OMERO objects. More information can be displayed using bin/omero obj -h.
The omero obj new subcommand allows to create new objects:
$ bin/omero obj new Object field=value
where Object is the type of object to create, e.g. Dataset or ProjectDatasetLink and field/value is a valid key/value pair for the type of object. For example, the following command creates a new screen with a name and a description:
$ bin/omero obj new Screen name=Screen001 description="screen description"
The omero obj update subcommand allows to update existing objects:
$ bin/omero obj update Object:ID field=value
where Object:ID is the type and the ID of object to update, e.g. Image:1 or PlateDatasetLink:10 and field/value is a valid key/value pair to update for the specified object.
For example, the following command updates the existing screen of ID 2 with a name and a description:
$ bin/omero obj update Screen:2 name=Screen001 description="screen description"
The output of each omero obj command is formatted as Object:ID so that the CLI commands can be redirected and piped together. For example, the following set of commands creates a dataset and a project and links them together:
$ dataset=$(bin/omero obj new Dataset name=dataset-1)
$ project=$(bin/omero obj new Project name=plate-1)
$ bin/omero obj new ProjectDatasetLink parent=$project child=$dataset
Plugins can be written and put in the lib/python/omero/plugins directory. On execution, all plugins in that directory are registered with the CLI. Alternatively, the “–path” argument can be used to point to other plugin files or directories.
The omero.cli.CLI should be considered thread-unsafe. A single connection object is accessible from all plugins via self.ctx.conn(args), and it is assumed that changes to this object will only take place in the current thread. The CLI instance itself, however, can be passed between multiple threads, as long as only one accesses it sequentially, possibly via locking.
See also