Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt

Use this file to discover all available pages before exploring further.

RedisResource exposes Redis keys as files under a single mount. The base of every key is the configured keyPrefix.
Node only. Requires the redis@^5 peer dependency. The browser SDK doesn’t ship a Redis client.

Install

pnpm add @struktoai/mirage-node redis

Config

import { MountMode, RedisResource, Workspace } from '@struktoai/mirage-node'

const redis = new RedisResource({
  url: process.env.REDIS_URL ?? 'redis://localhost:6379',
  keyPrefix: 'mirage/',
})

const ws = new Workspace({ '/r': redis }, { mode: MountMode.WRITE })
await ws.execute('echo "hello" | tee /r/greet')
await ws.execute('cat /r/greet')
FieldDefaultNotes
urlredis://localhost:6379Standard Redis connection URL. Redacted in snapshots.
keyPrefix''Prefix prepended to every key. Useful for multi-tenant Redis instances.

Mount mode

read, write, exec. For the broader Redis semantics (binary keys, key patterns, snapshot caveats) see the Python Redis docs.