@@ -769,6 +769,34 @@ def command_info(self, **kwargs) -> None:
769769 def command_count (self , ** kwargs ) -> ResponseT :
770770 return self .execute_command ("COMMAND COUNT" , ** kwargs )
771771
772+ def command_list (
773+ self ,
774+ module : Optional [str ] = None ,
775+ category : Optional [str ] = None ,
776+ pattern : Optional [str ] = None ,
777+ ) -> ResponseT :
778+ """
779+ Return an array of the server's command names.
780+ You can use one of the following filters:
781+ ``module``: get the commands that belong to the module
782+ ``category``: get the commands in the ACL category
783+ ``pattern``: get the commands that match the given pattern
784+
785+ For more information see https://redis.io/commands/command-list/
786+ """
787+ pieces = []
788+ if module is not None :
789+ pieces .extend (["MODULE" , module ])
790+ if category is not None :
791+ pieces .extend (["ACLCAT" , category ])
792+ if pattern is not None :
793+ pieces .extend (["PATTERN" , pattern ])
794+
795+ if pieces :
796+ pieces .insert (0 , "FILTERBY" )
797+
798+ return self .execute_command ("COMMAND LIST" , * pieces )
799+
772800 def command_getkeysandflags (self , * args : List [str ]) -> List [Union [str , List [str ]]]:
773801 """
774802 Returns array of keys from a full Redis command and their usage flags.
0 commit comments