How to create custom console command in blueprint?

My solution…

I did a Exec catcher in our class for GameInstance.

Our game instance blueprint has a game instance child class it inherits from so it is…

TDLGameInstanceBP==>TDLGameInstance==>GameInstance

being…
The Blue Print ==> The C++ we wrote ==> The internal Unreal Engine C++ GameInstance class.

We register our “tdl” console commands, then catch them, and relay them up to the blueprint TDLGameInstanceBP.

In the blueprint we parse out the arguments.

So in TDLGameInstance.h we have…

#pragma once

#include "Engine/GameInstance.h"
#include "tdlGameInstance.generated.h"

/**
 * 
 */
UCLASS()
class TDL_API UtdlGameInstance : public UGameInstance
{
	GENERATED_BODY()

public:
	UtdlGameInstance(const FObjectInitializer & ObjectInitializer);

	// Begin FExec Interface
	bool Exec(UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Out) override;
	// End FExec Interface

};

and in tdlGameInstance.cpp we have…

#include "tdl.h"
#include "tdlGameInstance.h"

UtdlGameInstance::UtdlGameInstance(const FObjectInitializer & ObjectInitializer) :
	UGameInstance(ObjectInitializer )
{
	if (!IConsoleManager::Get().IsNameRegistered(TEXT("TDL kill zeds")))
	{
		IConsoleManager::Get().RegisterConsoleCommand(TEXT("TDL kill zeds"), TEXT("TDL Commands"), ECVF_Cheat);
	}
}

char funcTDLGameInstanceCallBuf[1024];
bool UtdlGameInstance::Exec(UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Out)
{
	bool bHandled = false;

	// Ignore any execs that don't start with tdl
	if (FParse::Command(&Cmd, TEXT("TDL")))
	{
		FString TestStr = FString(Cmd);
		_snprintf(funcTDLGameInstanceCallBuf, sizeof(funcTDLGameInstanceCallBuf), "tdlConsoleCommand %s", TCHAR_TO_ANSI( *TestStr ));

		FOutputDeviceNull ar;
		CallFunctionByNameWithArguments(ANSI_TO_TCHAR(funcTDLGameInstanceCallBuf), ar, NULL, true);

		return true;
	}
	return Super::Exec(InWorld, Cmd, Out);
}

And the TDLGameInstanceBP looks like…

Now after that final Print Text node we can put a Split on the command arg and do something with it.