MODX Shell

Base commands

Common commands parameters

Most of the time, you can display the command help/parameters using modx help {$cmdName} which will display something like :

Usage:
 template:list [-p|--properties="..."] [-o|--options="..."] [-u|--unset="..."] [-a|--add="..."]

Options:
 --properties (-p)     An array of properties to be sent to the processor, ie. --properties='key=value' --properties='another_key=value' (multiple values allowed)
 --options (-o)        An array of options to be sent to the processor, ie. --options='processors_path=value' --options='location=value' (multiple values allowed)
 --unset (-u)          An array of columns to hidden from results table, ie. --unset=id --unset=name (multiple values allowed)
 --add (-a)            An array of columns to add to results table, ie. --add=column -a'other_column' (multiple values allowed)
 --help (-h)           Display this help message.
 --quiet (-q)          Do not output any message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version.
 --ansi                Force ANSI output.
 --no-ansi             Disable ANSI output.
 --no-interaction (-n) Do not ask any interactive question.

Parameters shorthands does not need the = sign, ie. modx template:list -p"key=value" vs modx template:list --properties="key=value"

List of the default commands

Without valid modX instance

Available commands:
  help                     Displays help for a command
  install                  Install MODX here
  list                     Lists commands
config
  config:add               Add a new modx installation to configuration
  config:edit              Edit a modx installation configuration
  config:go                Go to the given modx installation path
  config:list              List registered modx instances
  config:rm                Remove an entry from configuration

Extra commands when a valid modX instance is found

category
  category:list            List categories
chunk
  chunk:list               List chunks
context
  context:list             List contexts
  context:setting:list     List context settings
info
  info:objectcolumns       List available fields/columns for the given object
menu
  menu:list                List menus
namespace
  namespace:create         Create a new namespace
  namespace:list           List namespaces
  namespace:remove         Remove a namespace
  namespace:update         Update a namespace
package
  package:list             List package
  package:provider:list    List providers
plugin
  plugin:list              List Plugins
registry
  registry:message:list    List existing modRegistry messages
  registry:queue:list      List existing modRegistry queues
  registry:topic:list      List existing modRegistry topics
resource
  resource:create          Create a modResource
  resource:delete          Delete modResource
  resource:get             Get a modResource
  resource:list            List existing resources
  resource:purge           Purge deleted modResource
  resource:update          Update a modResource
session
  session:flush            Flush sessions
  session:list             List existing modSession
  session:remove           Remove given modSession
source
  source:list              List Media Sources
system
  system:clearcache        Clears MODX cache
  system:log:clear         Clears MODX error log
  system:log:listen        Watch MODX error log live
  system:log:view          Read MODX error log
  system:setting:list      List system settings
template
  template:list            List Templates
tv
  tv:list                  List TVs
user
  user:list                List users