Recently, I came across an odd situation where accessing Apache Felix at http://host:4502/system/console kept returning 404. I’m not sure what exactly had happened and without access to the Felix console coupled with a few problematic OSGi jars not being removed when we deleted the install folders in /apps, we were running completely blind. It was then that I started looking for a way to access Felix from a shell just so that if all else fails, we can at least have a second door to access the felix installation from a commandline. As well, a shell gives you quicker access to certain information than a the web console.
On CQ5.4, I tried installing the Gogo shell bundles from here  but Felix started going into a loop of installing, stopping, and starting a number of bundles including Sling, thus rendering the instance unstable.
Instead, I went for the Apache Felix Shell Service (1.4.3) and Apache Felix Remote Shell (1.1.2) bundles. Then it was a matter of installing the bundles using the web console and opening a commandline terminal and typing:
> telnet localhost 6666
You can run all sorts of OOTB commands like ps (lists all bundles), install, uninstall, stop, start, etc. There are also other command bundles you could look up or write yourself to give reporting, diagnostic, or the odd kick to get Felix behaving correctly if something in the JCR Installer didn’t behave correctly.
As an aside, in CQ5.5, you can supposedly install the Gogo shell and a remote shell via this package here .
– Sarwar Bhuiyan