Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Effect KitRedis

Administration

Look up RedisAdmin and its server, ACL, config, client and diagnostics commands.

RedisAdmin groups the commands that manage a server instead of its data. Each call runs on a leased session of an explicitly configured backend, and nothing is broadcast to other nodes.

Example (Reading Server Information)

import {  } from "effect";

import {  } from "@effect-kit/redis";

const  = .(function* () {
  const  = yield* ;

  const info = yield* .(["server"]);
const info: ServerInfo
const size = yield* .();
const size: bigint
return { : ..(() => .), }; });

info parses the reply into sections. Values stay strings, so versions and counters are not turned into JavaScript numbers.

Some replies are redacted

Replies that can contain secrets or application data, such as configGet, aclList, clientList and slowlogGet, are wrapped in Redacted. Read them with Redacted.value.

RedisAdmin is provided by the Node and Bun layers and needs RedisSessions. Upstash has no RedisAdmin. Two members are not commands. admin.execute(command) runs any Command on a session, and admin.withSession(body) gives you the RedisSession.

Connection checks on Redis

MethodCommandReply typePurpose
redis.pingPINGvoidCheck that the server answers.
redis.pingMessagePINGUint8ArraySend a message and get it back.
redis.echoECHOUint8ArraySend a message and get it back.

Server information and configuration

MethodCommandReply typePurpose
admin.configGetCONFIG GETRedacted<readonly (readonly [Uint8Array, Uint8Array])[]>Read configuration parameters by pattern.
admin.configSetCONFIG SETvoidChange configuration parameters.
admin.configRewriteCONFIG REWRITEvoidWrite the running configuration to the config file.
admin.configResetStatCONFIG RESETSTATvoidReset server statistics.
admin.configHelpCONFIG HELPreadonly string[]Return the CONFIG help text.
admin.infoINFOServerInfoRead and parse server information by section.
admin.dbsizeDBSIZEbigintCount the keys in the current database.
admin.timeTIMEreadonly [bigint, bigint]Read the server clock.
admin.lastSaveLASTSAVEbigintReturn the time of the last successful save.
admin.roleROLEreadonly RespValue[]Return the server's replication role.
admin.lolwutLOLWUTstringReturn the LOLWUT text.

Persistence, replication and backup

MethodCommandReply typePurpose
admin.saveSAVEvoidWrite a snapshot, blocking the server.
admin.bgsaveBGSAVEstringWrite a snapshot in the background.
admin.bgrewriteaofBGREWRITEAOFstringRewrite the append-only file in the background.
admin.flushDbFLUSHDBvoidDelete every key in the current database.
admin.flushAllFLUSHALLvoidDelete every key in every database.
admin.swapDbSWAPDBvoidSwap two databases.
admin.replicaOfREPLICAOFstringMake the server a replica of another, or stop replicating.
admin.slaveOfSLAVEOFstringOlder name for REPLICAOF.
admin.failoverFAILOVERvoidStart a coordinated failover to a replica.
admin.migrateMIGRATE"NOKEY" | "OK"Move keys to another server.
admin.flushSlotsSFLUSHreadonly (readonly [bigint, bigint])[]Delete keys in slot ranges (experimental).
admin.backupStartBACKUP STARTvoidStart a backup.
admin.backupSealBACKUP SEALvoidSeal a backup.
admin.backupAbortBACKUP ABORTvoidAbort a backup.
admin.backupCleanupBACKUP CLEANUPvoidRemove backup files.
admin.backupListBACKUP LISTRedacted<readonly Uint8Array[]>List backups.
admin.backupStatusBACKUP STATUSBackupStatusReturn backup status.
admin.backupHelpBACKUP HELPreadonly string[]Return the BACKUP help text.

Memory, logs and latency

MethodCommandReply typePurpose
admin.memoryUsageMEMORY USAGEOption<bigint>Estimate the memory used by a key.
admin.memoryStatsMEMORY STATSreadonly (readonly [string, RespValue])[]Return memory statistics as pairs.
admin.memoryDoctorMEMORY DOCTORstringReturn memory advice text.
admin.memoryMallocStatsMEMORY MALLOC-STATSstringReturn allocator statistics.
admin.memoryPurgeMEMORY PURGEvoidAsk the allocator to release memory.
admin.memoryHelpMEMORY HELPreadonly string[]Return the MEMORY help text.
admin.slowlogGetSLOWLOG GETRedacted<readonly RespValue[]>Read slow log entries.
admin.slowlogLenSLOWLOG LENbigintCount slow log entries.
admin.slowlogResetSLOWLOG RESETvoidClear the slow log.
admin.slowlogHelpSLOWLOG HELPreadonly string[]Return the SLOWLOG help text.
admin.commandlogGetCOMMANDLOG GETRedacted<readonly RespValue[]>Read command log entries.
admin.commandlogLenCOMMANDLOG LENbigintCount command log entries.
admin.commandlogResetCOMMANDLOG RESETvoidClear a command log.
admin.commandlogHelpCOMMANDLOG HELPreadonly string[]Return the COMMANDLOG help text.
admin.latencyLatestLATENCY LATESTreadonly (readonly [string, bigint, bigint, bigint])[]Return the latest latency events.
admin.latencyHistoryLATENCY HISTORYreadonly (readonly [bigint, bigint])[]Return the history of one latency event.
admin.latencyHistogramLATENCY HISTOGRAMreadonly (readonly [string, RespValue])[]Return per-command latency histograms.
admin.latencyGraphLATENCY GRAPHstringReturn an ASCII graph of an event.
admin.latencyDoctorLATENCY DOCTORstringReturn latency advice text.
admin.latencyResetLATENCY RESETbigintReset latency events.
admin.latencyHelpLATENCY HELPreadonly string[]Return the LATENCY help text.
admin.hotkeysStartHOTKEYS STARTvoidStart collecting hot key metrics.
admin.hotkeysGetHOTKEYS GETRedacted<readonly (readonly (readonly [string, RespValue])[])[]>Read hot key results.
admin.hotkeysStopHOTKEYS STOPvoidStop collecting.
admin.hotkeysResetHOTKEYS RESETvoidClear hot key results.
admin.hotkeysHelpHOTKEYS HELPreadonly string[]Return the HOTKEYS help text.

Clients, modules and commands

MethodCommandReply typePurpose
admin.clientIdCLIENT IDbigintReturn the connection ID.
admin.clientInfoCLIENT INFORedacted<string>Return information about this connection.
admin.clientListCLIENT LISTRedacted<string>List client connections.
admin.clientGetNameCLIENT GETNAMEOption<string>Read the connection name.
admin.clientSetNameCLIENT SETNAMEvoidSet the connection name.
admin.clientSetInfoCLIENT SETINFOvoidSet library name or version for the connection.
admin.clientGetRedirCLIENT GETREDIRbigintReturn the tracking redirect ID.
admin.clientNoEvictCLIENT NO-EVICTvoidProtect this connection from client eviction.
admin.clientNoTouchCLIENT NO-TOUCHvoidStop this connection updating key access times.
admin.clientPauseCLIENT PAUSEvoidPause client commands.
admin.clientUnpauseCLIENT UNPAUSEvoidResume paused clients.
admin.clientUnblockCLIENT UNBLOCKbooleanUnblock a client waiting on a blocking command.
admin.clientKillCLIENT KILLbigintClose connections that match filters.
admin.clientKillAddressCLIENT KILLvoidClose the connection at an address.
admin.clientHelpCLIENT HELPreadonly string[]Return the CLIENT help text.
admin.echoECHOUint8ArrayReturn the message sent.
admin.moduleListMODULE LISTreadonly (readonly (readonly [string, RespValue])[])[]List loaded modules.
admin.moduleLoadMODULE LOADvoidLoad a module.
admin.moduleLoadExMODULE LOADEXvoidLoad a module with configuration.
admin.moduleUnloadMODULE UNLOADvoidUnload a module.
admin.moduleHelpMODULE HELPreadonly string[]Return the MODULE help text.
admin.commandCOMMANDreadonly RespValue[]Describe every server command.
admin.commandCountCOMMAND COUNTbigintCount the server's commands.
admin.commandInfoCOMMAND INFOreadonly RespValue[]Describe selected commands.
admin.commandDocsCOMMAND DOCSreadonly (readonly [string, RespValue])[]Return command documentation.
admin.commandGetKeysCOMMAND GETKEYSreadonly Uint8Array[]Extract the keys from a command line.
admin.commandGetKeysAndFlagsCOMMAND GETKEYSANDFLAGSreadonly (readonly [Uint8Array, readonly string[]])[]Extract keys with their access flags.
admin.commandListCOMMAND LISTreadonly string[]List command names, optionally filtered.
admin.commandHelpCOMMAND HELPreadonly string[]Return the COMMAND help text.

ACL

MethodCommandReply typePurpose
admin.aclCatACL CATreadonly string[]List ACL categories, or the commands in one.
admin.aclListACL LISTRedacted<readonly string[]>List ACL rules as strings.
admin.aclUsersACL USERSreadonly string[]List user names.
admin.aclGetUserACL GETUSERRedacted<Option<readonly (readonly [string, RespValue])[]>>Read one user's rules.
admin.aclSetUserACL SETUSERvoidCreate or change a user.
admin.aclDelUserACL DELUSERbigintDelete users.
admin.aclWhoAmIACL WHOAMIstringReturn the current user name.
admin.aclGenPassACL GENPASSRedacted<string>Generate a password.
admin.aclDryRunACL DRYRUNstringCheck whether a user could run a command.
admin.aclDigestACL DIGESTstringReturn a digest of the ACL.
admin.aclLogACL LOGRedacted<readonly (readonly (readonly [string, RespValue])[])[]>Read recent ACL security events.
admin.aclLogResetACL LOG RESETvoidClear the ACL log.
admin.aclLoadACL LOADvoidReload ACL rules from the ACL file.
admin.aclSaveACL SAVEvoidSave ACL rules to the ACL file.
admin.aclHelpACL HELPreadonly string[]Return the ACL help text.