Chroma Key video software for command line
While not a direct solution, AVISynth supports creating a mask from a Chroma key using ColorKeyMask.  You can then use that mask to blend the two layers together by using Mask on the top layer and then Layering them together.

You could then just feed files in to the script and use FFMPEG or something similar to write out the frame stream from AVISynth.  

Note that you will still need to adjust the color of the background and the tolerance if they lighting isn't really consistent between shots of the green background though.