How to Compile LocalDerivedDataCache from Terminal

Hi guys!

I am having some trouble getting a command right. Specifically what I need to do is run a terminal command that compiles my LocalDerivedDataCache for my project using Unreal Engine 5.

Here is what I have:

Syntax:

sudo UnrealEditor-cmd MyGame.uproject -run=LocalDerivedDataCache -fill -DDC=CreatePak

However this does not work. It looks like it might be compiling regular DDC for the engine.

I have searched and searched on this with no luck.

Any ideas what I might be doing wrong?