Making a plugin commandlet

I’m trying to create a commandlet in a plugin, which seems to be possible according to this answer. \

I’ve got a plugin which contains a UCommandlet derived class with a static main() However I can’t fire it off from the command line – I always get UAssetTestCommandlet looked like a commandlet, but we could not find the class when I try to invoke it. I looked a a few of the commandlets in the source (for example AudioTestCommandlet.h) and that’s all that appears to be needed – but no dice. Is there some kind of registration or instantiaion I need to do beyond deriving from UCommandlet?

Just spent yesterday moving a commandlet into a plugin, so it seems to be working on 4.12.

.uplugin file:

{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "ContentAuditTools",
	"Description": "",
	"Category": "Other",
	"CreatedBy": "",
	"CreatedByURL": "",
	"DocsURL": "",
	"MarketplaceURL": "",
	"SupportURL": "",
	"EnabledByDefault": false,
	"CanContainContent": false,
	"IsBetaVersion": false,
	"Installed": false,
	"Modules": [
		{
			"Name": "ContentAuditTools",
			"Type": "Editor",
			"LoadingPhase": "Default"
		}
	]
}

You do need to make sure the plugin is enabled, otherwise it won’t be available when you try to actually run the commandlet.

So make sure something like this is in your .uproject file.

"Plugins": [
		{
			"Name": "ContentAuditTools",
			"Enabled": true
		}
	]
1 Like

you code help me.
my Modulus “LoadingPhase” is not “Default”; Thanks