Skip to content

mw dev mediawiki exec

Releasev0.35.0 · cfeceb67

mw dev mediawiki exec [flags] [command...]

Runs a command in the MediaWiki container with the MediaWiki source directory as its working directory. Pass the command and its arguments after --; use --user to select the container user.

-u, --user <string>
User to run as, defaults to current OS user uid:gid Default: 1000:1000.
-c, --context <string>
Development context to use (overrides CONTEXT) Default: default.
--help
Help for this command
--no-interaction
Do not ask any interactive questions
-v, --verbose <count>
Increase output verbosity. Example: --verbose=2 or -vv
Terminal window
mw dev mediawiki exec bash # Run bash as your system user
mw dev mediawiki exec --user root -- bash # Run bash as root
mw dev mediawiki exec -- composer phpunit:unit # Run a composer command (php unit tests)
mw dev mediawiki exec -- composer phpunit tests/phpunit/unit/includes/xml/XmlTest.php # Run a single test
mw dev mediawiki exec -- MW_DB=other composer phpunit tests/phpunit/unit/includes/xml/XmlTest.php # Run a single test for another database
mw dev mediawiki exec -- php maintenance/run.php update --quick # Run a MediaWiki maintenance script
mw dev mediawiki exec -- tail -f /var/log/mediawiki/debug.log # Follow the MediaWiki debug log file
Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.