Great!
But I think it will be better to read all commands directly from the commands directory.
Try this:
code: cmds=[];
var files = moi.filesystem.getFiles(moi.filesystem.getCommandsDir(), '*.js' );
for ( var i = 0; i < files.length; i++ ) { cmds.push( files.item(i).substring(files.item(i).lastIndexOf(moi.filesystem.getPathDelimiter())+1, files.item(i).lastIndexOf("."))); }
|