Run commandlet from module?

I have a commandlet I’ve written for generating uassets needed for my plugin. I’ve found plenty of good examples of how to run the commandlet when the editor starts up from the command line. The only thing is I’d prefer for the end user to not have to manually input that each time they start a new project. Is there anyway to run a Commandlet when a module starts up?

I tried calling the Commandlets main, from StratupModule but that just led to a crash with:

Fatal error:
[File:/opt/unreal-engine/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp]
[Line: 3307] FObjectInitializer::Get()
can only be used inside of
UObject-derived class constructor.
[2017.05.23-00.04.33:226][
0]LogLinux:Error: appError called:
Assertion failed: Assertion failed:
[File:/opt/unreal-engine/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp]
[Line: 3307] FObjectInitializer::Get()
can only be used inside of
UObject-derived class constructor.

Signal 11 caught. Malloc Size=131076
LargeMemoryPoolOffset=131092

Would fork / exe, or CreateProcess be fine to use with Unreal during startup for this?

You got clearly written what is cause of crash

FObjectInitializer::Get() can only be used inside of UObject-derived class

Module class is not UObject class

Yeah, I understand that. Still trying to avoid having to write platform specific code in case there’s an undocumented exec function anywhere that I can call.

Can you post the code you used to call the commandlets main function? I am trying to do the same. Thanks!