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

@moziaverse/context-cli

v0.2.0

Published

Mozia 企业上下文只读命令行客户端

Readme

@moziaverse/context-cli

Mozia 企业上下文只读命令行客户端。它通过统一 Context API 读取已授权的企业数据, 不直接持有底层数据源凭据。

安装

需要 Node.js 20 或更高版本。

从 npm 全局安装:

npm install --global @moziaverse/context-cli

配置

由管理员创建 Service Token,或由系统签发 Personal Token,然后配置:

export CONTEXT_API_URL="https://context.example.com"
export CONTEXT_API_TOKEN="..."

也可以从标准输入传入令牌,避免令牌出现在命令参数和 Shell 历史中:

printenv CONTEXT_API_TOKEN | context-cli whoami --token-stdin

CLI 不提供 --token <value> 参数。

命令

context-cli whoami
context-cli list context://openviking/projects/example/
context-cli search "项目风险" --source projects
context-cli read context://oa/workflows/123
context-cli query context://erp/records --limit 100
context-cli stat context://oa/attachments/123
context-cli download context://oa/attachments/123 --output ./invoice.pdf

默认输出 JSON,可用 --format text 输出适合阅读的文本。query 支持时间范围、过滤、 排序、字段选择、分组聚合和游标分页;完整参数请运行:

context-cli --help

退出码

  • 0:成功
  • 1:参数、网络或服务错误
  • 2:未认证或令牌失效
  • 3:没有访问权限
  • 4:资源不存在

安全边界

  • 只支持 listsearchreadquerystatdownload 只读操作。
  • Agent 使用按运行签发的短期令牌;个人工具使用绑定用户授权的 Personal Token;外部 Agent 使用管理员创建的 Service Token。
  • 令牌只通过环境变量、标准输入或系统密钥管理工具提供,不写入命令参数。
  • 所有 Context API 访问都会在服务端记录权限结果和审计信息。

开发

npm --prefix apps/context-cli test
npm --prefix apps/context-cli run verify:package

源码位于 MoziaVerse/mozia-org-platform