You can try the Moodle site generator tool to create users, enrolments and courses from the command line.
php admin/tool/generator/cli/maketestsite.php --size=S
This is for developers only. Never use on a live site. In fact, it will only work if you set debugging to DEVELOPER.
Also have a look at Moosh for creating activities etc from the command line. Works best from Linux. It is kind of along the same idea as wp-cli and drush.
As always, be sure to have a complete backup of your database and moodledata folder before you use either of these tools just in case you are not happy with the results.Hope you find this useful.