Eagle cad replace command using command line
Given that the brd and sch files are in XML I'd like to suggest editing it and changing the  directly but maybe that's not always a good idea! You could try it with a copy if you were brave enough!

It looks like Replace has two options:

REPLACE device_name[@library_name] •..
REPLACE part_name device_name[@library_name] ..


The first you just type REPLACE "mycomponent@mylibrary" and go around clicking the appropriate components.

The second is the same but you given the part name first.

Neither are particularly great options. I thought it would be easy to, say, group all components of a particular package and replace them but I can't see how. You likely have to use a script to do it. This isn't really an answer I guess.