COMMAND

Since 1.1.0ServerChanged in 1.2.1

Syntax

COMMAND
  • ACL categories: @connection, @slow
  • Arity: -1

History

  • 1.2.1: acl categories: added connection; removed server

Returns every command, each as an array: its name, its arity (a negative number is a minimum), its flags, the positions of its first and last key and the step between them, and its ACL categories. A command whose keys depend on its arguments has the movablekeys flag. Cluster clients route by this.

Examples

> COMMAND INFO GET
1) 1) "get"
   2) (integer) 2
   3) 1) readonly
      2) fast
   4) (integer) 1
   5) (integer) 1
   6) (integer) 1
   7) 1) "@fast"
      2) "@read"
      3) "@string"
   ...

Subcommands

  • COMMAND COUNT: Returns the number of top-level commands the server has: those COMMAND describes, without counting subcommands such as CLIENT LIST separately.
  • COMMAND DOCS: Returns the documentation of the commands named, or of every command when none is named: for each, its name and then a map of summary, since, group, complexity, arguments, and history and doc_flags w…
  • COMMAND GETKEYS: Returns the keys a command would use, given its full arguments, without running it.
  • COMMAND GETKEYSANDFLAGS: Returns the keys a command would use, as COMMAND GETKEYS does, each with flags saying how the command uses it.
  • COMMAND HELP: Lists the COMMAND subcommands, one line each with its arguments, followed by an indented line saying what it does: COUNT, LIST, INFO, DOCS, GETKEYS, GETKEYSANDFLAGS and HELP.
  • COMMAND INFO: Returns COMMAND's entry for each command named, or for every command when none is named: nil for a name that is not a command.
  • COMMAND LIST: Returns the names of every command, or of those matching a FILTERBY: