Maintained by Tomasz Muras
Moosh stands for MOOdle SHell. It is a commandline tool that will allow you to perform most common Moodle tasks. It's inspired by Drush - a similar tool for Drupal.
Latest release:
65 fans
Current versions available: 2

Moosh is a tool that exposes some common Moodle functionality to the commandline.

You install moosh outside of the Moodle directory, it can be anywhere really. Then simply make moosh.php (or symlink named like moosh) available somewhere in $PATH.

To run moosh, change the directory into your installed Moodle's instance and run one of the commands. To get the list of all available commands only run moosh.php (or just moosh if you've symlinked it like this) or read the documentation and examples.

Moosh is meant to work nicely with Linux features like bash/zsh expansion. For example, to create 10 users, you just type:

% moosh user-create username{1..10}



Screenshot #0


Tomasz Muras (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS


  • Mon, Jun 3, 2013, 8:54 PM
    Hi Tomasz

    There does not appear to be a course-reset function available. Is this something that could potentially be added? We are attempting to rollover all our modules from this academic year into next year and the approach that would best suit us would be to backup - restore - reset

  • Thu, Jun 20, 2013, 4:35 AM
    course-reset added in moosh 0.9
  • My picture
    Wed, Jul 10, 2013, 11:17 PM
    Thanks for this lovely plug-in, Tomasz. I have a production site running in Windows Sever 2008-IIS7, is there a way of making it work with Windows Server?
  • Wed, Jul 10, 2013, 11:23 PM
    Hi Aaricia,

    I've actually heard of people running it under Windows. I'm simply not testing it under Windows at all and building it with Linux in mind, however there is nothing major that should stop it working under Windows - did you actually try it?

    You should simply test it under your windows environment and send me any fixes/patches required to make it work there (if necessary).
  • Tue, Sep 24, 2013, 4:00 AM
  • David
    Tue, Sep 24, 2013, 5:43 AM
    this is a great extension Thomasz, do you think it would be possible to extend the course section with the import from course functionality? That way its super easy to clone a course, without having to make a backup and restore. (alternatively course_clone would be even more awesome!)
  • Fri, Feb 28, 2014, 8:02 PM
    It only seems to work when logged in as root. I assume I am missing some permissions. The command runs but doesn't find any commands. What are the permissions for 'moosh'?
  • Sun, Jun 8, 2014, 11:36 PM
    I'm a big fan of Drush great to have something similar for Moodle.

    One question though - how to run the unit tests? Grepped the commands list for 'test' and 'unit' but can't spot anything. I've tried running tests/run-tests.php directly but I get an error about a missing file when run in the tests directory and a failed include when run from the Moosh root.

    I'm probably missing something obvious but a pointer would be greatly appreciated as I'd like to add a couple of tests for some additions I've made.

Please login to post comments