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

uapi-cli

v0.1.2

Published

LLM-first UAPI CLI with prebuilt Go binaries and npm DX

Readme

Uapi CLI

Uapi CLI Banner

Uapipro (uapis.cn) 的 LLM 优先命令行工具与原生 SDK。

底层由 Go 原生编译,内置完整的 OpenAPI 索引。它不仅是开发者的终端 API 调试工具,更是专为大语言模型和 AI Agent 设计的标准化工具执行工具哟。

通过接入本 CLI,您可以让您的 Agent 拥有 UAPI 平台的全量 API 能力。助力您更好的完成工作。

安装

推荐:全局安装(需 Node.js 环境)

npm i -g uapi-cli

单次免安装执行

npx uapi-cli discover ocr

Python AI 框架兼容调用

若在 Python 环境开发 AI 代理,可直接通过仓库提供的包装层调用:

python uapi_sdk_cli.py llm discover ocr
python uapi_llm_cli.py discover ocr

特性

  • 为 LLM 优化的输出结构:非交互式(非 TTY)环境下,默认输出紧凑的 llm 格式 JSON,精准匹配大模型上下文窗口,大幅减少 Token 消耗。
  • 极速冷启动:Go 原生二进制执行,告别运行时解析 openapi.yaml 的性能损耗,满足 AI 高频并发调用的低延迟要求。
  • 智能参数路由:使用 --set 传参,AI 或开发者无需分辨参数位于 Query 还是 Body 中,底层自动完成规范化路由,极大降低 AI 构造请求的错误率。
  • 开箱即用的多模态支持:原生支持 Multipart 本地文件上传与二进制数据流存储(如图片下载),复杂请求结构支持读取 .json 文件。
  • 多平台跨语言:通过 npm 极简分发,并提供 Python 兼容包装层,无缝对接 LangChain / AutoGPT 等 AI 框架。

命令参考

CLI 提供的 4 个核心元命令,完整覆盖了 AI 自主探索与执行的闭环:

# 1. 服务发现:允许 AI 通过关键词搜索需要的接口
uapi discover bilibili

# 2. 获取目录:列出平台所有的 API 标签类目
uapi tags

# 3. 阅读规范:允许 AI 获取指定接口的参数结构与说明
uapi schema post-image-ocr

# 4. 执行调用:发起实际的 API 请求
uapi call get-network-myip

使用示例

基础调用与智能路由

利用 --set 模糊传参,CLI 自动将参数派发至正确位置:

uapi call get-social-bilibili-userinfo --set uid=1945126

缓存穿透

追加 --disable-cache 自动生成时间戳 _t 参数,强制请求最新数据:

uapi call get-social-bilibili-userinfo --set uid=1945126 --disable-cache

OCR 图像识别(多模态)

处理网络 URL 图片:

uapi call post-image-ocr \
  --body url=https://uapis.cn/ocr-samples/bilingual-poetry-sample.png \
  --body need_location=false

处理并上传本地图片文件:

(注:使用 --file 声明文件流)

uapi call post-image-ocr \
  --file file=./demo.png \
  --body image_name=demo.png \
  --body need_location=false

二进制流调度与混合端点

以必应每日一图 API 为例,展示如何调度不同类型的返回格式。

请求 JSON 结构化数据:

uapi call get-image-bing-daily --query format=json --query resolution=1080

直接下载二进制图片并保存:

uapi call get-image-bing-daily --query resolution=1080 --out ./bing.jpg

复杂数据结构输入

当参数层级较深时,可直接挂载 JSON 文件:

uapi call post-image-ocr --json-file request.json

进阶配置

输出格式(--format

  • llm:非 TTY 环境默认。剔除冗余字段的精简 JSON 响应包,包含 okoperationresponse.data,专为 LLM 解析设计。
  • pretty:TTY 终端默认。带有颜色高亮和缩进,适合人类开发者阅读。
  • json:完整的调试级 JSON 输出。
  • raw:仅输出原始 HTTP 响应体(若为二进制文件下载,则打印本地保存路径)。

请求预检(--dry-run

仅用于验证 AI 生成的请求结构是否合法,返回标准化请求参数但不发起真实网络调用:

uapi call post-image-ocr --body need_location=false --dry-run

环境变量

| 变量 | 描述 | | :--- | :--- | | UAPI_TOKEN | UAPI Pro 平台认证 Token | | UAPI_BASE_URL | 网关地址覆写(默认请求官方网关) | | UAPI_TIMEOUT | 全局网络请求超时时间 | | UAPI_CLI_BINARY | 自定义底层 Go 二进制可执行文件路径 |

源码与开发

如需参与底层 CLI 开发或自行编译:

cd uapi-cli-npm

# 编译适配当前平台的原生二进制文件
npm run build:local

# 本地调试调用
node ./bin/uapi.js discover ocr

# 为全平台交叉编译发布包
npm run build:release