Generate XCF file for Lattice Diamond from command line
The xcf file is a configuration file that does not change with the image.  Rather, it has a pointer to the image file (.jed, for example).  So, you can generate it once using the Lattice programmer, then commit it in your version control system and just leave it there, and it should work fine with your scripted environment.