Mewsh MediaWiki Shell

From Wiki.yt
(Redirected from Mewsh)
Jump to: navigation, search
Sweden road sign A19-1.svg

mewsh is a MediaWiki shell, in the style of drush and wp-cli.org. mewsh lives at http://github.com/guaka/mewsh

mewsh currently does the following:

  • finds a mediawiki installation (also checks w/ and wiki/)
  • checks for .mewsh/mewsh.aliasesrc.php

Commands

There are subcommands like wp-cli.


db

mewsh db cli # gives you a mysql cli with the database, you can probably also pipe into this
mewsh db dump # dumps the entire database 


maintenance

mewsh maintenance update              # will run maintenance/update.php
mewsh maintenance getText Main_Page   # will get the Main_Page article through maintenance/getText.php


var

mewsh var variableName            # shows $variableName, e.g.
mewsh var wgSitename
mewsh var sitename                   # mewsh also tries wgArgument
mewsh var mewDir
mewsh cd                                  # shortcut for the above
cd $(mewsh cd)                         # go to mediawiki root directory


Aliases

~/.mewsh/aliases.mewshrc.php

$aliases = array();
$aliases['wikiyt'] = array(
                          'uri' => 'wiki.yt',
                          'root' => '/var/www/wiki.yt/htdocs/w',
                          'remote-host' => 'wiki.yt',   // This will try to run the command over ssh
                          );

With that you can do mewsh @wikiyt db cli from anywhere on the machine where this is set up. ssh support is planned, just like drush.

Bug reports / feature requests

Check https://github.com/guaka/mewsh/issues

And feel free to add bug reports, feature/pull requests, etc. https://github.com/guaka/mewsh/issues/new