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

mac-local-ocr

v1.0.0

Published

macOS 本地 OCR CLI + Claude Code 技能(Apple Vision,零依赖,图片不出本机)

Readme

mac-local-ocr

macOS 本地 OCR 工具 + Claude Code 技能。基于 Apple Vision 框架,零依赖,图片不出本机。

安装(其他 Mac)

npm install -g mac-local-ocr

安装过程会自动:

  1. 安装 ocr 全局命令(universal binary,Intel / Apple Silicon 通用)
  2. 安装 Claude Code 技能到 ~/.claude/skills/ocr/(重启 Claude Code 生效)

不需要 Xcode——二进制已预编译,只依赖 macOS 自带的 Vision 框架(macOS 10.15+)。

用法

ocr                      # 读剪贴板图片(截图后直接识别)
ocr 截图.png             # 识别文件(支持拖拽/通配符/目录)
ocr --json 截图.png      # 带坐标和置信度的结构化输出
ocr --lang en 图.png     # 指定语言(默认 zh-Hans + en-US)
ocr --fast 验证码.png    # 快速模式

从源码构建(开发)

git clone [email protected]:realpkuasule/mac-local-ocr.git
cd mac-local-ocr
npm run build             # 编译 universal binary 到 bin/ocr
npm test                  # 手动验证:scripts/validate.sh

结构:

| 文件 | 说明 | |------|------| | src/ocr.swift | 引擎源码 | | scripts/build.sh | 编译 universal binary(arm64 + x86_64) | | scripts/validate.sh | 发布前校验(构建 + 架构 + 功能) | | scripts/install-skill.mjs | postinstall:安装 Claude Code 技能 | | SKILL.md | Claude Code 技能定义 | | test/ | 测试图片 |

坐标说明

--json 输出中 bbox 为归一化坐标(0~1),原点在图片左下角,y 轴向上。 像素坐标换算:px = x * widthpy = y * height(从下往上)。

常见问题

  • ocr: command not found → 确认 npm 全局 bin 目录在 PATH(常见位置 /opt/homebrew/bin/usr/local/bin 或 npm prefix)
  • 识别不准 → 试试 --fast--lang 指定单语言
  • 卸载:npm uninstall -g mac-local-ocr(技能文件在 ~/.claude/skills/ocr/,可手动删除)