Extending
Apache Karaf is a very flexible container that you can extend very easily.
Shell commands
See https://github.com/apache/karaf/blob/master/examples/karaf-command-example/README.md to add your own shell commands.
WebConsole
You can also extend the Apache Karaf WebConsole by providing and installing a webconsole plugin.
A plugin is an OSGi bundle that registers a Servlet as an OSGi service with webconsole properties.