Central registry of all commands supported by FerricStore.
Each entry contains the command name, arity (negative = variadic), flags, first-key / last-key / step indices, and a short summary string.
This module is the single source of truth consumed by:
COMMAND COUNTCOMMAND LISTCOMMAND INFOCOMMAND DOCSCOMMAND GETKEYS
Arity convention (Redis)
- Positive N — command takes exactly N arguments (including the command name).
- Negative N — command takes at least |N| arguments.
Key position convention
first_key: 0means the command has no key arguments.- For single-key commands:
first_key: 1, last_key: 1, step: 1. - For multi-key variadic commands:
last_key: -1, step: 1.
Summary
Functions
Returns the full list of command entries.
Returns the number of supported commands.
Extracts the key arguments from a command invocation.
Same as get_keys/2 but accepts an already-uppercase command name,
avoiding the String.downcase/1 call inside lookup/1.
Returns the Redis-style info tuple for a command entry.
Looks up a command entry by name (case-insensitive).
Looks up a command entry by an already-uppercase name.
Returns all command names as lowercase strings.
Types
Functions
@spec all() :: [command_entry()]
Returns the full list of command entries.
@spec count() :: non_neg_integer()
Returns the number of supported commands.
Extracts the key arguments from a command invocation.
Given a command name and its arguments list, returns the arguments that are keys based on the catalog's first_key/last_key/step metadata.
Returns {:ok, keys} or {:error, reason}.
Same as get_keys/2 but accepts an already-uppercase command name,
avoiding the String.downcase/1 call inside lookup/1.
@spec info_tuple(command_entry()) :: list()
Returns the Redis-style info tuple for a command entry.
Format: [name, arity, [flags...], first_key, last_key, step]
@spec lookup(binary()) :: {:ok, command_entry()} | :error
Looks up a command entry by name (case-insensitive).
Returns {:ok, entry} or :error.
@spec lookup_upper(binary()) :: {:ok, command_entry()} | :error
Looks up a command entry by an already-uppercase name.
Avoids the String.downcase/1 call in lookup/1 when the caller
already has an uppercase command name (e.g. from normalise_cmd).
Returns {:ok, entry} or :error.
@spec names() :: [binary()]
Returns all command names as lowercase strings.