It's better when it's simple

User Tools

Site Tools


Command Line Tools

DokuWiki comes with a few PHP scripts meant to be executed from the (UNIX) commandline of the DokuWiki server. All the scripts are located in the <yourWiki>/bin/ directory.

Note: In order to be able to use these scripts you need the PHP CLI interpreter installed on the system.

There are two ways to run the scripts. You can either make them executable:

$> chmod +x ./bin/<script>.php
$> ./bin/<script>.php

or run them as follows (recommended):

$> /path/to/php bin/<script>.php


Note: There have been problems reported with some plugins that rely on ACLs and authentication or the DokuWiki event system.

Usage: dwpage.php [opts] <action>
  Utility to help command line DokuWiki page editing, allow
  pages to be checked out for editing then committed after changes
  Normal operation would be;
      checkout: see $ dwpage.php --help=checkout
      commit: see $ dwpage.php --help=commit
      lock: see $ dwpage.php --help=lock
      gmeta: see $ dwpage.php --help=gmeta
          Displays metadata about a page. There is no ability to write 
          metadata, only read them. 
          e.g. $ dwpage.php -u <user> gmeta [page] <meta tag>. Where <meta tag>
          can be "date modified" (in quotes) or "last_change date" an empty 
          <meta tag> returns all metadata.
      -h, --help=<action>: get help
          e.g. $ ./dwpage.php -hcommit
          e.g. $ ./dwpage.php --help=commit


Allows you to update the search index.

Usage: indexer.php <options>
  Updates the searchindex by indexing all new or changed pages
  when the -c option is given the index is cleared first.
      -h, --help     show this help and exit
      -c, --clear    clear the index before updating
      -q, --quiet    don't produce any output

This needs to be run as the appropriate user and possibly the right directory to work. e.g. www-data in ~www-data under debian lenny. So for example, if your wiki is in /var/www/wiki :

sudo -u www-data /var/www/wiki/bin/indexer.php

If you experience errors, please firstly check that you are calling the script in the bin path and not in the /lib/exe.

When working with farms, you can define the animal variable while calling the script. Please note that this is on single command line.

animal=example ./bin/indexer.php


Usage: wantedpages.php [wiki:namespace]
  Outputs a list of wanted pages (pages which have
  internal links but do not yet exist).
  If the optional [wiki:namespace] is not provided,
  defaults to the root wiki namespace
      -h, --help get help


Allows you to remove unwanted language files from an installation.

Usage: striplangs.php [-h [-x]] [-e] [-k lang1[,lang2]..[,langN]]
  Removes all languages from the installation, except the ones
  after the -k option. English language is never removed!
      -h, --help     get this help
      -x, --examples get also usage examples
      -k, --keep     comma separated list of languages, -e is always implied
      -e, --english  keeps english, dummy to use without -k


Helps with maintaining DokuWiki and plugins installed via git.

Usage: gittool.php <command> [parameters]

Manage git repositories for DokuWiki and its plugins and templates.


$> ./bin/gittool.php clone gallery template:ach
$> ./bin/gittool.php repos
$> ./bin/gittool.php origin -v


    This help screen

clone <extensions>
    Tries to install a known plugin or template (prefix with template:) via
    git. Uses the plugin repository to find the proper git
    repository. Multiple extensions can be given as parameters

install <extensions>
    The same as clone, but when no git source repository can be found, the
    extension is installed via download

    Lists all git repositories found in this DokuWiki installation

    Any unknown commands are assumed to be arguments to git and will be
    executed in all repositories found within this DokuWiki installation


This tool gives access to all installed CLI Plugins. Call it without any arguments to get a list of installed plugins:


Call the plugin's help screen to learn more

./bin/plugin.php <pluginname> -h

Finding more CLI plugins

Use CLI Plugins to add other functionality to command line.

A summary of plugins which indicate CLI support:

NameDescriptionPlugins WHERE (type > 255 AND type < 512)
AIchat PluginChat with a LLM about your DokuWiki contents1aichat
Combo PluginPublication framework (Bootstrap and Material Design UI components, URL Management, Web Metadata, SEO and more)1combo
dev PluginThe DokuWiki Developer's Tool1dev
DX PluginAn opinionated plugin to improve the Developer Experience of DokuWiki plugin developers1dx
elasticsearch PluginIntegrate an external Elasticsearch engine into DokuWiki1elasticsearch
Extension Manager PluginManage and install plugins and templates (bundled with DokuWiki)1extension
GDPR PluginImprove GDPR compliance by removing usernames of deleted users from changelogs1gdpr
gemini PluginExpose your wiki as a read-only gemini server1gemini
letsencrypt PluginRequest letsencrypt SSL certificates for your wiki1letsencrypt
newpagetemplate PluginLoads predefined page content from a given template1newpagetemplate
Statdisplay PluginDisplays various statistics and bar graphs computed using a log file of all access to DokuWiki pages1statdisplay
structtasks PluginSend notification and reminder emails for tasks stored as struct data1structtasks
upgrade PluginUpdate your DokuWiki with a few clicks from the admin interface1upgrade
User Manager PluginManage registered users (bundled with DokuWiki)1usermanager

∑ 14 plugins matching query

To implement such a plugin please have a look at the CLI plugins development documentation.

cli.txt · Last modified: 2023-05-17 13:45 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki