Registry / database / redis-cli

redis-cli

JSON →
library2.1.2jsnpmunverified

redis-cli is a Node.js-based command-line interface tool designed for interacting with Redis servers, offering an alternative to the official C-based Redis CLI. It allows users to connect to Redis instances, including those in cluster mode, and execute Redis commands directly from their terminal. The package is currently at version 2.1.2, though the provided release history primarily details updates up to version 1.4.0, which included bug fixes and blocking mode support, as well as vulnerability patches in earlier 1.3.x releases. While it mirrors many features of the official CLI, such as host, port, authentication, and TLS connection options, its key differentiator is its JavaScript/TypeScript implementation, potentially appealing to Node.js developers seeking a pure-JS ecosystem tool or a CLI that could be more easily extended within a Node.js project. Its release cadence appears infrequent based on the visible history, suggesting a maintenance-focused development approach.

npm install redis-cli
INSTALL
IMPORT
SIG · REDIS-CLI
R
redis-cli
databasejavascriptv2.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Demonstrates global installation and basic command-line usage for connecting to Redis instances, including cluster mode.

$ npm install -g redis-cli # Connect to default Redis instance (127.0.0.1:6379) $ rdcli # Connect to a specific host and port $ rdcli -h 10.4.23.235 -p 6380 # Connect in cluster mode $ rdcli -c -h my-cluster-host
redis-cli --version
Debug
Known issues
breakingVersion 1.3.1 included fixes for security vulnerabilities. Users running versions older than 1.3.1 are strongly advised to upgrade immediately to a more recent secure version.
fix
Upgrade to the latest available version: `npm install -g redis-cli@latest`
affects: <1.3.1
gotchaThe roadmap indicates that the tool might not fully support all commands when connecting to 'cluster-like redis (PaaS)' instances, which may restrict certain Redis functionalities.
fix
Consult your Redis PaaS provider's documentation for supported commands and test critical operations in non-production environments first.
affects: >=1.0.0
gotchaThis package is designed as a standalone command-line interface tool and does not expose a programmatic API for `import` or `require()` within a Node.js application. Attempting to use it as a library will result in errors.
fix
Use the `rdcli` command directly from your shell or invoke it via `child_process` in Node.js for automation purposes.
affects: >=1.0.0
Errors
Common errors & fixes
rdcli: command not found
The redis-cli package was not installed globally or the global binaries path is not in your system's PATH.
fix
Ensure the package is installed globally: `npm install -g redis-cli`. If the issue persists, check your PATH environment variable.
Error: connect ECONNREFUSED 127.0.0.1:6379
The Redis server is not running, is configured to listen on a different address/port, or a firewall is blocking the connection.
fix
Verify that your Redis server is active and accessible. Check its configuration for the correct host and port, and ensure no firewall rules are preventing the connection. Use `--host` and `--port` options if different from default.
(error) MOVED 12345 10.0.0.1:6380
Attempting to run a Redis cluster command on a non-cluster enabled Redis instance, or connecting to a cluster without enabling cluster mode in `rdcli`.
fix
If connecting to a Redis cluster, ensure you include the `-c` or `--cluster` flag when running `rdcli`: `rdcli -c -h your-cluster-host`. If it's a standalone instance, ensure your command is appropriate for a non-cluster setup.
Upgrade
Version history
2.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
redis-cli — npm install redis-cli · libregistry