commands library
The redis:* commands (redis:ping, redis:stats, redis:keys-audit,
redis:cli), for bootstrap/commands.dart:
import 'package:daravel_redis/commands.dart';
final List<CommandFactory> commands = [...redisCommands];
A library of its own, so the server does not compile the CLI it needs.
Classes
- CachePruneStaleTagsCommand
-
cache:prune-stale-tags [--store=redis]: drops expired keys from the tag lists of a Redis cache store (Laravel's command of the same name). - RedisCliCommand
-
redis:cli [--connection=default] [--write] [command ...]: one command, or a prompt reading commands untilquit. Only reading commands run unless--writeis given. - RedisInspectCommand
-
redis:inspect <key> [--connection=default]: what a key holds. Its toolredis_inspectgives AI agents the same throughmcp:serve; values stay hidden whenAPP_ENV=production. - RedisKeysAuditCommand
-
redis:keys-audit [--connection=cache] [--match=...] [--limit=20]: keys by type under the application's prefix, and cache keys without a time to live (they stay until deleted). - RedisPingCommand
-
redis:ping [--connection=default]: the server, its version, the mode and the round trip. - RedisStatsCommand
-
redis:stats [--connection=default]: what this client did, and what each master reports (INFO).
Constants
-
redisCommands
→ const List<
CommandFactory> -
The
redis:*commands, forbootstrap/commands.dart: -
redisReadCommands
→ const Set<
String> -
Commands
redis:cliruns without--write: those that only read (KEYSis left out: it blocks the server on a large database,SCANdoes not).
Functions
-
auditRedisKeys(
RedisClient client, {required String match, required String cachePrefix, int limit = 20}) → Future< RedisKeysAudit> -
Every key matching
match(on every master), counted by type, and the keys undercachePrefixthat never expire, at mostlimitof them: what a cache that only grows looks like. -
formatRedisReply(
Object? reply, [String indent = '']) → String -
A reply as
redis-cliprints it. -
inspectRedisKey(
RedisClient client, String key, {bool values = true, int limit = 20}) → Future< Map< String, Object?> > -
What one key holds: its type, time to live, encoding, size and memory,
and with
valuesthe firstlimititems (a string's first 1000 characters). Null fields where the server does not say. -
isReadOnlyRedisCommand(
List< String> args) → bool -
Whether
argsonly reads. -
parseRedisCommandLine(
String line) → List< String> -
A command line split as
redis-clidoes: on spaces, with"..."and'...'quoting (backslash escapes inside double quotes). -
parseRedisInfo(
Object? info) → Map< String, String> -
The fields of an
INFOreply.
Typedefs
-
RedisKeysAudit
= ({List<
String> cacheWithoutTtl, int keys, Map<String, int> types, int withoutTtl}) - What auditRedisKeys found.