Render with openGL from the command line?
It is possible, in a round-about way. Operator render.opengl() needs OpenGL display context, i.e. Blender's window, to be opened. Hence, we can't do UI-less rendering using -b command switch. We'll need to do it through a script:

import bpy
import sys                      # read argument from sys.argv
from bpy.app.handlers import persistent

@persistent
def do_render_opengl(dummy):
    bpy.ops.render.opengl(animation=True, view_context=False)
    bpy.ops.wm.quit_blender()

bpy.app.handlers.load_post.append(do_render_opengl)


It is to be executed like this:

blender -P render_opengl.py &lt;file&gt;.blend


Executing wm.quit_blender() is necessary, because otherwise Blender doesn't automatically close when render finishes. We also wrap the rendering code in load_post handler, to make sure the right context is loaded up before rendering. This is especially important if the scene's name is non-default. Otherwise Blender creates new scene Scene and renders it, instead of the scene we want.

The script above is to render preview animation. To render preview image and specify frame range, modify it to read argument from sys.argv (I've written code that does it before) and assigning appropriate values to bpy.context.scene.frame_*.