Issues generating custom Beat

Hello!

I'm attempting to create a custom beat using the instructions here:
https://www.elastic.co/guide/en/beats/devguide/7.15/newbeat-generate.html

and I'm having issues when running

mage GenerateCustomBeat

I'm running it inside the /beats directory after creating a user directory following the steps above.
Running the command with -debug gives me:

DEBUG: 14:07:56.730285 getting all non-mage files in .
DEBUG: 14:07:56.746765 found non-mage files
DEBUG: 14:07:56.746866 getting all files plus mage files
DEBUG: 14:07:57.241040 time to scan for Magefiles: 510.7821ms
DEBUG: 14:07:57.241358 found magefiles: magefile.go
DEBUG: 14:07:57.249455 output exe is  /root/.magefile/cf01ab46648402f71bd2808a2182c365f10729f5
DEBUG: 14:07:57.256224 go build cache exists, will ignore any compiled binary
DEBUG: 14:07:57.256315 parsing files
DEBUG: 14:07:57.257231 found target AddLicenseHeaders
DEBUG: 14:07:57.257317 found target CheckLicenseHeaders
DEBUG: 14:07:57.257614 found target DumpVariables
DEBUG: 14:07:57.257987 found target Fmt
DEBUG: 14:07:57.258322 found target PackageBeatDashboards
DEBUG: 14:07:57.258626 time parse Magefiles: 1.9685ms
DEBUG: 14:07:57.258986 Creating mainfile at mage_output_file.go
DEBUG: 14:07:57.259682 writing new file at mage_output_file.go
DEBUG: 14:07:57.261213 compiling to /root/.magefile/cf01ab46648402f71bd2808a2182c365f10729f5
DEBUG: 14:07:57.261287 compiling using gocmd: go
DEBUG: 14:07:57.351629 running go build -o /root/.magefile/cf01ab46648402f71bd2808a2182c365f10729f5 magefile.go mage_output_file.go
DEBUG: 14:07:59.279420 time to compile Magefile: 1.9270298s
DEBUG: 14:07:59.279988 running binary /root/.magefile/cf01ab46648402f71bd2808a2182c365f10729f5
DEBUG: 14:07:59.280109 running magefile with mage vars:
MAGEFILE_DEBUG=1
MAGEFILE_GOCMD=go
Unknown target specified: "GenerateCustomBeat"

And it looks like GenerateCustomBeat does not exist or can't be found. Is there something else I need to do?