npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oh-my-tool/redis

v0.3.3

Published

Redis extension for Oh My Tool (read-only get / scan / info / ping over RESP)

Readme

@oh-my-tool/redis

独立 Redis 能力扩展仓库(Oh My Tool),只读查询与检查。

  • 工具:redis.instances / redis.ping / redis.get / redis.scan / redis.info
  • 只读:不暴露任何写命令(SET/DEL/…),避免 Agent 误改缓存。
  • 零依赖:用 Bun.connect 自实现 RESP2 协议子集,无需安装任何 Redis 客户端。
  • 配置:复用 OMT 的 connection 白名单机制,Agent 只传 connection 名。

工具

| 工具 | 说明 | |---|---| | redis.instances | 列出已配置的 Redis 实例,不连接 Redis,也不显示 secret 名称 | | redis.ping | 连接健康检查 | | redis.get | 按类型读 key:string 直接取值;hash/list/set/zset 返回前 N 条(默认 100,上限 1000) | | redis.scan | 按 pattern 分页列出 keys,返回 cursor 与 keys(cursor="0" 表示结束) | | redis.info | key 元数据:类型、TTL(秒)、元素数量/字符串长度 |

所有工具 risk: read

配置

配置文件位于 %USERPROFILE%\\.oh-my-tool\\config.toml(Linux/macOS 为 ~/.oh-my-tool/config.toml)。

连接配置使用通用结构;Redis 专用参数放在 settings,密码引用放在 secrets

[extensions.redis.connections.iot-test]
environment = "test"

[extensions.redis.connections.iot-test.settings]
host = "redis-test.company.internal"
port = 6379
database = "0"        # Redis db index,>0 时自动 SELECT
username = "default"  # Redis ACL 用户名(无 ACL 用 default)
tls = false

[extensions.redis.connections.iot-test.secrets]
password = "redis:iot-test"  # 密码引用,不存明文;省略表示无密码 Redis
# 写密码(值从 stdin,存 Windows Credential Manager / Bun.secrets)
Write-Output "s3cret" | ohmytool secret set redis:iot-test

使用

ohmytool search "查 redis 缓存"
ohmytool describe redis.get
echo '{"connection":"iot-test","key":"user:10086"}' | ohmytool run redis.get --stdin
echo '{"connection":"iot-test","pattern":"user:*"}' | ohmytool run redis.scan --stdin
ohmytool run redis.instances
ohmytool run redis.instances --json

run 默认输出适合 Agent 阅读的分层文本;增加 --json 可输出机器可解析的 JSON。 也支持 --format=text|json|table|csv。hash/set/zset 读取使用有界扫描,超过 maxEntries 时返回 truncated: true

安全

  • 三层:OMT Policy(connection 白名单) → 工具面只读(无写命令)→ Redis 账号最小权限。
  • maxEntries / scan count 默认 100、上限 1000,防止一次拉爆。
  • TLS 默认校验证书;协议超时或响应异常后连接会被废弃,不会继续复用。
  • 密码只经 Bun.secrets,不进 config.toml、不返回 Agent。

安装进 Core

npm install @oh-my-tool/redis
ohmytool extension install ./node_modules/@oh-my-tool/redis

开发联调

npm install
npm test

发布包包含自包含的 Bun bundle,因此安装进 Core 后不需要手工创建 SDK junction。

发布

发布由 GitHub Actions 的 npm Trusted Publisher 完成。创建并推送与 package.jsonomt.manifest.json 一致的版本 tag 即可:

npm run version:release -- 0.2.1
npm install
npm run check
git add -A && git commit -m "release: v0.2.1"
git push origin main
git tag -a v0.2.1 -m "release: v0.2.1"
git push origin v0.2.1

测试

bun test:RESP 编解码(含分片/嵌套/错误)、真实 TCP fake server 端到端(连接/AUTH/SELECT/超时/错误响应)、handler mock(类型分发/限额/secret)。