
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
LocalOCR 是一款专为开发者设计的命令行工具,旨在将复杂的图像内容提取流程简化为一条简单的指令。
npm install -g local-ocr
# 或使用 pnpm
pnpm install -g local-ocr
# 设置本地模型服务地址(默认:http://localhost:8000/v1)
local-ocr config set baseUrl http://localhost:8000/v1
# 设置模型名称(默认:glm-ocr)
local-ocr config set model glm-ocr
# 设置 API Key(本地部署可填 none)
local-ocr config set apiKey none
# 识别本地图片
local-ocr ocr ./screenshot.png
# 识别远程图片
local-ocr ocr https://example.com/image.jpg
# 不带参数,进入交互式模式
local-ocr ocr
ocr [image]对图片执行文字识别,输出提取的文本内容。
| 参数 / 选项 | 说明 |
|---|---|
[image] | 图片路径(本地)或 URL(http/https),省略则进入交互式输入 |
-o, --output <file> | 将识别结果保存到文件 |
--debug | 开启调试日志 |
支持的图片格式: jpg / jpeg / png / gif / webp / bmp / tiff
local-ocr ocr ./invoice.png
local-ocr ocr https://example.com/document.jpg
local-ocr ocr ./scan.png --output result.txt
config [action] [key] [value]管理 CLI 配置。
| Action | 说明 |
|---|---|
config / config get | 显示所有配置项 |
config get <key> | 显示指定配置项 |
config set <key> <value> | 设置配置项 |
config reset | 重置所有配置为默认值 |
可配置项:
| Key | 默认值 | 说明 |
|---|---|---|
baseUrl | http://localhost:8000/v1 | OpenAI 兼容端点地址 |
model | glm-ocr | 模型名称 |
apiKey | none | API 密钥(本地部署通常填 none) |
local-ocr config
local-ocr config get baseUrl
local-ocr config set baseUrl http://localhost:11434/v1
local-ocr config set model glm-4v-ocr
local-ocr config reset
| 选项 | 说明 |
|---|---|
--debug | 开启调试模式,输出详细日志 |
-h, --help | 显示帮助信息 |
-v, --version | 显示版本号 |
LocalOCR 通过 OpenAI 兼容接口与模型通信,任何支持该协议的本地推理服务均可使用,例如:
FAQs
LocalOCR 是一款专为开发者设计的命令行工具,旨在将复杂的图像内容提取流程简化为一条简单的指令。
We found that local-ocr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.