The Craft shell is only available if the yii2-shell package is installed:
yii2-shell
composer require --dev yiisoft/yii2-shell
Start the shell:
./craft shell
Execute the command:
Craft::$app->elements->saveElement(new \craft\elements\User([ 'username' => '<username>', 'email' => '<email>', 'newPassword' => '<password>', 'admin' => true, 'passwordResetRequired' => false, ]));