Archive for September, 2010

Morrigan’s CLI

Tuesday, September 7th, 2010

One really handy feature of OSGi is the ability to supplement the OSGi console with extra commands. This is particularly useful for creating very quick test/debug interfaces for each of you OSGi bundles. The console is only shown to the user when the OSGi environment is started from the CLI and and “-console” parameter is specified, so for general usage this can be left neatly hidden. So when things start to go a astray, you can just dive in and start poking around to see what is going on. In more advanced setups, the console can be tunnelled to a port and accessed via telnet or ssh.

As part of the headless version Morrigan, I have now added a handy CLI interface for testing / configuring it – essential until all this functionality makes it in to the WUI. Below is a summary of all the currently supported commands (copied form the help text).

For now I have grouped all the commands under a top-level command of ‘mn’ (short commands are easier to type). I am still working on this and trying to decide the best command structure, so suggestions are very welcome!

As an initially usability test, try and guess what all of these do. :D


mn media
mn media create <dbname>
mn media add <dir> <q1>
mn media scan <q1>
mn media <q1>
mn media <q1> <q2>
mn players
mn player 0
mn player 0 play
mn player 0 play <q1>
mn player 0 play <q1> <q2>
mn player 0 queue
mn player 0 queue <q1>
mn player 0 queue <q1> <q2>
mn player 0 queue clear
mn player 0 pause
mn player 0 stop
mn player 0 next
mn player 0 order <order>
mn play
mn play <q1>
mn play <q1> <q2>
mn queue
mn queue <q1>
mn queue <q1> <q2>
mn pause
mn stop
mn next
NOTE 1: <q1> = list, <q2> = item in <q1>.
NOTE 2: Only omit player ID when there is only one player.

I will be posting a build of the headless version in the next couple of days for general testing.