Hi,
The easiest way is to create a "External Tool Configuration" in Eclipse, to run the "pelix.shell" module with Python, and giving it an initialization script as parameter:
Location: ${system_path:python}
Arguments: --init ${project_path:/myproject/run.pelix}
The run.pelix file contains Pelix shell commands, for example:
install pelix.http.basic
# $? contains the result of the last command. "install" returns the bundle ID
For debugging, you have to activate the "Debug" perspective, and attach a debugger to the shell process (Menu PyDev > Attach to Process).
Note that this feature doesn't work on Windows.
1. Start a debug server in Eclipse (PyDev > Start Debug Server)
2. In the run configuration, add the path to Pydev sources (environment variables PYTHONPATH, add "...eclipse-mars\plugins\org.python.pydev_4.5.5.201603221110\pysrc")
3. In the modules to debug, import pydevd and call pydevd.settrace()
Cheers,