invoking python CLI module from command line

Operating system: macOS 10.13.2 (High Sierra)
Slicer version: 4.8.1
Expected behavior: able to invoke python CLI module from command line
Actual behavior: not able to invoke python CLI module from command line

Greetings - I am trying to create a python CLI module, following the specification given in
https://www.slicer.org/wiki/Documentation/Nightly/Developers/SlicerExecutionModel/Python

I have created the file myPythonCLImodule.py, which includes the XML and Execute() method as specified at the URL above. I have also created the directory and added the path to the settings as specified in the instruction (also in the URL above):
“To create a working Python CLI module, just create a directory, put your .py file there and add the directory path to the path list in Application settings - Module settings.”

I then try to invoke this python CLI module from the command line, as follows
./Slicer myPythonCLImodule
but nothing happens.

My question is: How do I invoke a python CLI module from the command line?

I assume that one does not need to rebuild Slicer, or run Slicer from the slicer/superbuild directory, in order to run a python CLI module - is this correct?

I should also point out, just for reference, that the following command line is working just fine for me:
./Slicer --no-main-window --python-script /tmp/test.py
This is not my problem. My problem is how to invoke my own python CLI module from the command line.

Thanks in advance for any assistance you can provide.

Hi -

Thanks for pointing that out - the documentation on that wiki page was vague. It says Slicer3 but didn’t indicate that things are different in Slicer 4. I added a big warning at the top with a pointer to this example with a python CLI that works with the current Slicer 4.9 (Nightly Preview) version: