And what are you going to do with the file, if I may ask?
At one point you have to load it into the designer to do things... Or do you use the command line code generator? The problem is that if something is not valid, or the automapper can't create a field for example because a type needs a type converter or other, it is a problem you can't solve in code, you need the designer for that.
Btw, v3.1 has an import system. You could create a simple importer (see the sourcecode in the sdk) to import the entities from the assembly and go from there.