The yEd Software License Agreement explicitly forbids the usage of yEd in any kind of automated process (see section 1, "License Conditions"), which covers most forms of commandline usage aside from simply starting yEd from commandline. So, no, you cannot and may not do so.