From version < 11.1 >
edited by Caleb James DeLisle
on 2015/12/02 15:34
To version < 12.2 >
edited by Mohamed Boussaa
on 2015/12/09 09:36
< >
Change comment: There is no comment for this version



Page properties
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.CalebJamesDeLisle
1 +xwiki:XWiki.mouhb
... ... @@ -4,6 +4,8 @@
4 4  Requires Programming Rights to use.
5 5  {{/warning}}
6 6  
7 +This extension allows you to run native commands on the server which is running the wiki.
8 +
7 7  API:
8 8  
9 9  {{code language=java}}
... ... @@ -1,1 +1,1 @@
1 -calebjamesdelisle:commandrunner
1 +org.xwiki.contrib:api-commandrunner
cogRun a native/shell command in XWiki and get the result
Developed by

Caleb James DeLisle

0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager


Requires Programming Rights to use.

This extension allows you to run native commands on the server which is running the wiki.


public Map<String, String> executable, standardInput, int timeoutMilliseconds);
public Map<String, String>[] executable, String standardInput, int timeoutMilliseconds);

To use:

$'ls', '', 1000)

Or if you need to support arguments with spaces and/or special characters, use the array based function signature:

$[ 'ls', '-la' ], '', 1000)

The bash command line application will remove quotes around process arguments automatically, so:

dostuff -axd argument "argument with spaces"

Is equivalent to:

$[ 'dostuff', '-axd', 'argument', 'argument with spaces' ], '', 1000)

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.

Get Connected