Command Runner API

Last modified by Admin on 2016/10/25 00:25

cogRun a native/shell command in XWiki and get the result.
Developed by

Caleb James DeLisle, Mohamed Boussaa

Active Installs18
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.

Created by Caleb James DeLisle on 2014/09/25 18:02

Get Connected