How can I read the current label of a Task or SequenceFlow?

So I’m using bpmn-js-cli a lot for creating and modifying workflows programatically. I can add elements, connect them, read their properties, move them, set their labels, read their x/y coordinates. What I can’t seem to be able to do is read the labels on elements I’ve already added a label to. Is there any way to do that, either with the bpmn-js-cli or with the modeler ? I searched for this topic but can’t seem to find it.

My use case involves programatically checking each label to see if it contains certain elements and then modifying them if they do not.

Many thanks!

Through the ElementRegistry you can get all elements of the diagram and inspect their properties.