integration cli: add some utility functions and use them Upstream-commit: 99caa68a46817f13a893542321ffc020bfa4cbf9 Component: engine